mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-20 12:09:39 +00:00
Clean up more null issues
This commit is contained in:
1 parent
1fa461430e
commit
4abbc92472
142 files changed
+707
-617
No files matched your search
@@ -100,7 +100,12 @@ public class PluginFarming extends BlankForestryPlugin {
|
||||
public static ProxyFarming proxy;
|
||||
|
||||
@Nullable
|
||||
public static BlockRegistryFarming blocks;
|
||||
private static BlockRegistryFarming blocks;
|
||||
|
||||
public static BlockRegistryFarming getBlocks() {
|
||||
Preconditions.checkState(blocks != null);
|
||||
return blocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
@@ -109,7 +114,8 @@ public class PluginFarming extends BlankForestryPlugin {
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
Preconditions.checkState(blocks != null);
|
||||
ItemRegistryCore coreItems = PluginCore.getItems();
|
||||
BlockRegistryFarming blocks = getBlocks();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
@@ -146,8 +152,8 @@ public class PluginFarming extends BlankForestryPlugin {
|
||||
Farmables.farmables.put("farmVegetables", new FarmableAgingCrop(new ItemStack(Items.CARROT), Blocks.CARROTS, BlockCrops.AGE, 7));
|
||||
Farmables.farmables.put("farmVegetables", new FarmableAgingCrop(new ItemStack(Items.BEETROOT_SEEDS), Blocks.BEETROOTS, BlockBeetroot.BEETROOT_AGE, 3));
|
||||
|
||||
//Foretsry fertilizer
|
||||
Farmables.fertilizers.put(new ItemStack(PluginCore.items.fertilizerCompound, 1, OreDictionary.WILDCARD_VALUE), 500);
|
||||
//Forestry fertilizer
|
||||
Farmables.fertilizers.put(new ItemStack(coreItems.fertilizerCompound, 1, OreDictionary.WILDCARD_VALUE), 500);
|
||||
|
||||
proxy.initializeModels();
|
||||
|
||||
@@ -231,9 +237,8 @@ public class PluginFarming extends BlankForestryPlugin {
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
ItemRegistryCore coreItems = PluginCore.items;
|
||||
Preconditions.checkState(blocks != null);
|
||||
Preconditions.checkState(coreItems != null);
|
||||
ItemRegistryCore coreItems = PluginCore.getItems();
|
||||
BlockRegistryFarming blocks = getBlocks();
|
||||
|
||||
ItemStack basic = blocks.farm.get(EnumFarmBlockType.PLAIN, 1);
|
||||
ItemStack gearbox = blocks.farm.get(EnumFarmBlockType.GEARBOX, 1);
|
||||
@@ -241,7 +246,6 @@ public class PluginFarming extends BlankForestryPlugin {
|
||||
ItemStack valve = blocks.farm.get(EnumFarmBlockType.VALVE, 1);
|
||||
ItemStack control = blocks.farm.get(EnumFarmBlockType.CONTROL, 1);
|
||||
|
||||
|
||||
for (EnumFarmBlockTexture block : EnumFarmBlockTexture.values()) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
block.saveToCompound(compound);
|
||||
@@ -312,10 +316,8 @@ public class PluginFarming extends BlankForestryPlugin {
|
||||
|
||||
@Override
|
||||
public void getHiddenItems(List<ItemStack> hiddenItems) {
|
||||
Preconditions.checkState(blocks != null);
|
||||
|
||||
// mushrooms are a workaround for the farm and should not be obtainable
|
||||
hiddenItems.add(new ItemStack(blocks.mushroom, 1, OreDictionary.WILDCARD_VALUE));
|
||||
hiddenItems.add(new ItemStack(getBlocks().mushroom, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
Reference in new issue
Block a user