-
Notifications
You must be signed in to change notification settings - Fork 81
/
NaturaOredict.java
244 lines (201 loc) · 8.58 KB
/
NaturaOredict.java
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
package com.progwml6.natura.oredict;
import org.apache.logging.log4j.Logger;
import com.google.common.eventbus.Subscribe;
import com.progwml6.natura.common.NaturaPulse;
import com.progwml6.natura.common.config.Config;
import com.progwml6.natura.decorative.NaturaDecorative;
import com.progwml6.natura.library.Util;
import com.progwml6.natura.nether.NaturaNether;
import com.progwml6.natura.nether.block.glass.BlockNetherGlass;
import com.progwml6.natura.overworld.NaturaOverworld;
import com.progwml6.natura.shared.NaturaCommons;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.oredict.OreDictionary;
import slimeknights.mantle.pulsar.pulse.Pulse;
@Pulse(id = NaturaOredict.PulseId, description = "Everything that has to do with the ore dictionary", forced = true)
public class NaturaOredict extends NaturaPulse
{
public static final String PulseId = "NaturaOredict";
static final Logger log = Util.getLogger(PulseId);
@Subscribe
public void init(FMLInitializationEvent event)
{
ensureOredict();
registerCommons();
registerOverworld();
registerNether();
registerDecorative();
}
private static void ensureOredict()
{
oredict(Items.BOWL, "bowlWood");
oredict(Blocks.CHEST, "chestWood");
oredict(Blocks.TRAPPED_CHEST, "chestWood");
}
private static void registerCommons()
{
oredict(NaturaCommons.bloodwood_emptybowl, "bowlWood");
oredict(NaturaCommons.ghostwood_emptybowl, "bowlWood");
oredict(NaturaCommons.darkwood_emptybowl, "bowlWood");
oredict(NaturaCommons.fusewood_emptybowl, "bowlWood");
oredict(NaturaCommons.barley, "cropBarley");
oredict(NaturaCommons.cotton, "cropCotton");
oredict(NaturaCommons.barleyFlour, "foodFlour");
oredict(NaturaCommons.wheatFlour, "foodFlour");
oredict(NaturaCommons.barley, "listAllgrain");
oredict(NaturaCommons.wheatFlour, "foodEqualswheat");
oredict(NaturaCommons.blueDye, "dyeBlue");
oredict(NaturaCommons.sulfurPowder, "dustSulphur");
oredict(NaturaCommons.sulfurPowder, "dustSulfur");
oredict(NaturaCommons.sticks, "stickWood");
}
private static void registerOverworld()
{
if (isOverworldLoaded())
{
if (Config.dropBarley)
{
MinecraftForge.addGrassSeed(NaturaOverworld.barley_seeds, 3);
}
if (Config.dropCotton)
{
MinecraftForge.addGrassSeed(NaturaOverworld.cotton_seeds, 3);
}
// Food
oredict(NaturaCommons.raspberry, "cropRaspberry");
oredict(NaturaCommons.raspberry, "listAllfruit");
oredict(NaturaCommons.blueberry, "cropBlueberry");
oredict(NaturaCommons.blueberry, "listAllfruit");
oredict(NaturaCommons.blackberry, "cropBlackberry");
oredict(NaturaCommons.blackberry, "listAllfruit");
oredict(NaturaCommons.maloberry, "cropMaloberry");
oredict(NaturaCommons.maloberry, "listAllfruit");
// Planks
oredict(NaturaOverworld.overworldPlanks, "plankWood");
// Logs
oredict(NaturaOverworld.overworldLog, "logWood");
oredict(NaturaOverworld.overworldLog2, "logWood");
oredict(NaturaOverworld.redwoodLog, "logWood");
// Slabs
oredict(NaturaOverworld.overworldSlab, "slabWood");
oredict(NaturaOverworld.overworldSlab2, "slabWood");
// Saplings
oredict(NaturaOverworld.overworldSapling, "treeSapling");
oredict(NaturaOverworld.overworldSapling2, "treeSapling");
oredict(NaturaOverworld.redwoodSapling, "treeSapling");
// Leaves
oredict(NaturaOverworld.overworldLeaves, "treeLeaves");
oredict(NaturaOverworld.overworldLeaves2, "treeLeaves");
oredict(NaturaOverworld.redwoodLeaves, "treeLeaves");
// Stairs
oredict(NaturaOverworld.overworldStairsAmaranth, "stairWood");
oredict(NaturaOverworld.overworldStairsEucalyptus, "stairWood");
oredict(NaturaOverworld.overworldStairsHopseed, "stairWood");
oredict(NaturaOverworld.overworldStairsMaple, "stairWood");
oredict(NaturaOverworld.overworldStairsRedwood, "stairWood");
oredict(NaturaOverworld.overworldStairsSakura, "stairWood");
oredict(NaturaOverworld.overworldStairsSilverbell, "stairWood");
oredict(NaturaOverworld.overworldStairsTiger, "stairWood");
oredict(NaturaOverworld.overworldStairsWillow, "stairWood");
// Seeds
oredict(NaturaOverworld.barley_seeds, "seedBarley");
oredict(NaturaOverworld.cotton_seeds, "seedCotton");
oredict(NaturaOverworld.barley_seeds, "listAllseed");
oredict(NaturaOverworld.cotton_seeds, "listAllseed");
// Bookshelves
oredict(NaturaDecorative.overworldBookshelves, "bookshelf");
}
}
private static void registerNether()
{
// Nether
if (isNetherLoaded())
{
oredict(NaturaCommons.blightberry, "cropBlightberry");
oredict(NaturaCommons.blightberry, "listAllfruit");
oredict(NaturaCommons.duskberry, "cropDuskberry");
oredict(NaturaCommons.duskberry, "listAllfruit");
oredict(NaturaCommons.skyberry, "cropSkyberry");
oredict(NaturaCommons.skyberry, "listAllfruit");
oredict(NaturaCommons.stingberry, "cropStingberry");
oredict(NaturaCommons.stingberry, "listAllfruit");
// Tained Soil
oredict(NaturaNether.netherTaintedSoil, "taintedSoil");
// Planks
oredict(NaturaNether.netherPlanks, "plankWood");
// Logs
oredict(NaturaNether.netherLog, "logWood");
oredict(NaturaNether.netherLog2, "logWood");
// Slabs
oredict(NaturaNether.netherSlab, "slabWood");
// Saplings
oredict(NaturaNether.netherSapling, "treeSapling");
// Leaves
oredict(NaturaNether.netherLeaves, "treeLeaves");
oredict(NaturaNether.netherLeaves2, "treeLeaves");
// Stairs
oredict(NaturaNether.netherStairsBloodwood, "stairWood");
oredict(NaturaNether.netherStairsDarkwood, "stairWood");
oredict(NaturaNether.netherStairsGhostwood, "stairWood");
oredict(NaturaNether.netherStairsFusewood, "stairWood");
// Glass
oredict(NaturaNether.netherGlass, BlockNetherGlass.GlassType.SOUL.getMeta(), "glassSoul");
oredict(NaturaNether.netherGlass, "glass");
// Vines
OreDictionary.registerOre("cropVine", new ItemStack(NaturaNether.netherThornVines));
// Bookshelves
oredict(NaturaDecorative.netherBookshelves, "bookshelf");
}
}
private static void registerDecorative()
{
// Decorative
if (isDecorativeLoaded())
{
// Overworld
if (isOverworldLoaded())
{
oredict(NaturaDecorative.overworldWorkbenches, "crafterWood");
oredict(NaturaDecorative.overworldWorkbenches, "craftingTableWood");
}
// Nether
if (isNetherLoaded())
{
oredict(NaturaDecorative.netherWorkbenches, "crafterWood");
oredict(NaturaDecorative.netherWorkbenches, "craftingTableWood");
}
}
}
public static void oredict(Item item, String... name)
{
oredict(item, OreDictionary.WILDCARD_VALUE, name);
}
public static void oredict(Block block, String... name)
{
oredict(block, OreDictionary.WILDCARD_VALUE, name);
}
public static void oredict(Item item, int meta, String... name)
{
oredict(new ItemStack(item, 1, meta), name);
}
public static void oredict(Block block, int meta, String... name)
{
oredict(new ItemStack(block, 1, meta), name);
}
public static void oredict(ItemStack stack, String... names)
{
if (!stack.isEmpty() && stack.getItem() != Items.AIR)
{
for (String name : names)
{
OreDictionary.registerOre(name, stack);
}
}
}
}