This repository was archived by the owner on Dec 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdate_brewing.php
More file actions
72 lines (60 loc) · 1.95 KB
/
update_brewing.php
File metadata and controls
72 lines (60 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
//http://minecraft.gamepedia.com/Smelting 12/1/15
$smelting = array(
//--- Ores & Materials ---
'265|15,263',//Iron Ingot
'266|14,263',//Gold Ingot
'20|12,263',//Glass
'1|4,263',//Stone
'336|337,263',//Clay Brick
'405|87,263',//Nether Brick
'172|82,263',//Hardened Clay
'98-2|98,263',//Cracked Stone Bricks
'264|56,263',//Diamond Gem
'351-4|21,263',//Lapis Lazuli
'331|73,263',//Redstone Dust
'263|16,263',//Coal
'388|129,263',//Emerald
'406|153,263',//Nether Quartz
'263-1|17,263',//Charcoal
'263-1|17-1,263',//Charcoal
'263-1|17-2,263',//Charcoal
'263-1|17-3,263',//Charcoal
'263-1|17-4,263',//Charcoal
'263-1|17-5,263',//Charcoal
'351-2|81,263',//Cactus Green
'19|19-2,263',//Sponge
//---END Ores & Materials ---
//--- FOOD ---
'320|319,263',//Cooked Porkchop
'364|363,263',//Steak
'366|365,263',//Cooked Chicken
'350|349,263',//Cooked Fish
'393|392,263',//Baked Potato
'350-1|349-1,263',//Cooked Salmon
'424|423,263',//Cooked Mutton
'412|411,263',//Cooked Rabbit
//--- END FOOD ---
);
$xmlDoc = new DOMDocument('1.0', 'UTF-8');
$xmlDoc->formatOutput = true;
$xmlDoc->preserveWhiteSpace = false;
$xmlRoot = $xmlDoc->createElement("SmeltingItems");
$xmlRoot = $xmlDoc->appendChild($xmlRoot);
$q=0;
for($i=1; $i <= count($smelting); $i++) {
$parser_step_1 = explode("|", $smelting[$i]);
$parser_step_2_line_1 = $parser_step_1[0];
$parser_step_2_line_2 = explode(",", $parser_step_1[1]);
echo $parser_step_2_line_1."<br />";
$xmlItem = $xmlDoc->createElement("SmeltingItem");
$xmlItem = $xmlRoot->appendChild($xmlItem);
$xmlItem->setAttribute('SmeltNumber', $q++);
$xmlItem->appendChild($xmlDoc->createElement('Output', $parser_step_2_line_1));
$xmlItem->appendChild($xmlDoc->createElement('NumberOfOutput', '1'));
$xmlItem->appendChild($xmlDoc->createElement('Input1', $parser_step_2_line_2[0]));
$xmlItem->appendChild($xmlDoc->createElement('Input2', $parser_step_2_line_2[1]));
}
$xmlDoc->save("smelting.xml");
echo "Done!";
?>