diff --git a/src/main/java/techreborn/TechReborn.java b/src/main/java/techreborn/TechReborn.java index da8187238..40f657f78 100644 --- a/src/main/java/techreborn/TechReborn.java +++ b/src/main/java/techreborn/TechReborn.java @@ -97,9 +97,8 @@ public class TechReborn { // Sounds ModSounds.init(); // Client only init, needs to be done before parts system - proxy.init(event); + proxy.init(); // WorldGen - worldGen.load(); //GameRegistry.registerWorldGenerator(worldGen, 0); //GameRegistry.registerWorldGenerator(new OilLakeGenerator(), 0); // Register Gui Handler @@ -111,7 +110,6 @@ public class TechReborn { MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler()); MinecraftForge.EVENT_BUS.register(new MultiblockServerTickHandler()); MinecraftForge.EVENT_BUS.register(new TRTickHandler()); - MinecraftForge.EVENT_BUS.register(worldGen.retroGen); //Village stuff if (ConfigTechReborn.enableRubberTreePlantation) { VillagerRegistry.instance().registerVillageCreationHandler(new VillagePlantaionHandler()); @@ -131,7 +129,7 @@ public class TechReborn { @SubscribeEvent public void postinit() { - proxy.postInit(event); + proxy.postInit(); ModRecipes.postInit(); LOGGER.info(RecipeHandler.recipeList.size() + " recipes loaded"); diff --git a/src/main/java/techreborn/itemblocks/ItemBlockRubberSapling.java b/src/main/java/techreborn/itemblocks/ItemBlockRubberSapling.java index 99250e384..f144bb644 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockRubberSapling.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockRubberSapling.java @@ -25,6 +25,7 @@ package techreborn.itemblocks; import net.minecraft.block.Block; +import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import techreborn.TechReborn; @@ -34,8 +35,6 @@ import techreborn.TechReborn; public class ItemBlockRubberSapling extends ItemBlock { public ItemBlockRubberSapling(Block block) { - super(block); - setCreativeTab(TechReborn.TAB); - setTranslationKey("techreborn.rubberSapling"); + super(block, new Item.Properties().group(TechReborn.ITEMGROUP)); } } diff --git a/src/main/java/techreborn/items/DynamicCell.java b/src/main/java/techreborn/items/DynamicCell.java index d5e9b5205..660e44f53 100644 --- a/src/main/java/techreborn/items/DynamicCell.java +++ b/src/main/java/techreborn/items/DynamicCell.java @@ -70,9 +70,9 @@ public class DynamicCell extends Item { //TODO: Property ItemUtils.isItemEquals tags equality handling? if (stack.hasTag()) { NBTTagCompound tag = stack.getTag(); - if (tag.getSize() != 1 || tag.hasKey("Fluid")) { + if (tag.size() != 1 || tag.contains("Fluid")) { NBTTagCompound clearTag = new NBTTagCompound(); - clearTag.setTag("Fluid", tag.getCompoundTag("Fluid")); + clearTag.put("Fluid", tag.getCompound("Fluid")); stack.setTag(clearTag); } } diff --git a/src/main/java/techreborn/items/ItemFrequencyTransmitter.java b/src/main/java/techreborn/items/ItemFrequencyTransmitter.java index 22125db68..cec97735c 100644 --- a/src/main/java/techreborn/items/ItemFrequencyTransmitter.java +++ b/src/main/java/techreborn/items/ItemFrequencyTransmitter.java @@ -58,8 +58,8 @@ public class ItemFrequencyTransmitter extends Item { @Override @OnlyIn(Dist.CLIENT) public float call(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { - if (!stack.isEmpty() && stack.hasTag() && stack.getTag() != null && stack.getTag().hasKey("x") - && stack.getTag().hasKey("y") && stack.getTag().hasKey("z") && stack.getTag().hasKey("dim")) { + if (!stack.isEmpty() && stack.hasTag() && stack.getTag() != null && stack.getTag().contains("x") + && stack.getTag().contains("y") && stack.getTag().contains("z") && stack.getTag().contains("dim")) { return 1.0F; } return 0.0F; diff --git a/src/main/java/techreborn/tiles/cable/TileCable.java b/src/main/java/techreborn/tiles/cable/TileCable.java index 0ada99f7f..b4c1dbc9c 100644 --- a/src/main/java/techreborn/tiles/cable/TileCable.java +++ b/src/main/java/techreborn/tiles/cable/TileCable.java @@ -39,6 +39,7 @@ import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.common.util.NonNullSupplier; import net.minecraftforge.energy.CapabilityEnergy; import net.minecraftforge.energy.IEnergyStorage; import reborncore.api.IListInfoProvider; @@ -50,6 +51,7 @@ import techreborn.blocks.cable.BlockCable; import techreborn.init.TRContent; import techreborn.init.TRTileEntities; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; @@ -89,7 +91,7 @@ public class TileCable extends TileEntity @Override public LazyOptional getCapability(Capability capability) { if (capability == CapabilityEnergy.ENERGY) { - return CapabilityEnergy.ENERGY.cast(this); + return LazyOptional.of(() -> (T)this); } return super.getCapability(capability); } diff --git a/src/main/java/techreborn/tiles/generator/basic/TileSolidFuelGenerator.java b/src/main/java/techreborn/tiles/generator/basic/TileSolidFuelGenerator.java index f8365b5c3..fac6b22ac 100644 --- a/src/main/java/techreborn/tiles/generator/basic/TileSolidFuelGenerator.java +++ b/src/main/java/techreborn/tiles/generator/basic/TileSolidFuelGenerator.java @@ -30,7 +30,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.EnumFacing; -import net.minecraftforge.common.ForgeModContainer; +import net.minecraftforge.common.ForgeMod; import reborncore.api.IToolDrop; import reborncore.api.tile.ItemHandlerProvider; import reborncore.common.blocks.BlockMachineBase; @@ -96,7 +96,7 @@ public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDr updateState(); burnItem = inventory.getStackInSlot(fuelSlot); if (inventory.getStackInSlot(fuelSlot).getCount() == 1) { - if (inventory.getStackInSlot(fuelSlot).getItem() == Items.LAVA_BUCKET || inventory.getStackInSlot(fuelSlot).getItem() == ForgeModContainer.getInstance().universalBucket) { + if (inventory.getStackInSlot(fuelSlot).getItem() == Items.LAVA_BUCKET || inventory.getStackInSlot(fuelSlot).getItem() == ForgeMod.getInstance().universalBucket) { inventory.setStackInSlot(fuelSlot, new ItemStack(Items.BUCKET)); } else { inventory.setStackInSlot(fuelSlot, ItemStack.EMPTY); diff --git a/src/main/java/techreborn/tiles/storage/idsu/IDSUManager.java b/src/main/java/techreborn/tiles/storage/idsu/IDSUManager.java index 87e5eaf4e..2b81a2663 100644 --- a/src/main/java/techreborn/tiles/storage/idsu/IDSUManager.java +++ b/src/main/java/techreborn/tiles/storage/idsu/IDSUManager.java @@ -25,20 +25,20 @@ package techreborn.tiles.storage.idsu; import net.minecraft.world.World; -import net.minecraft.world.storage.MapStorage; import net.minecraft.world.storage.WorldSavedDataStorage; import techreborn.TechReborn; public class IDSUManager { public static IDataIDSU getData(World world) { - WorldSavedDataStorage storage = world.getMapStorage(); - IDSUSaveManger instance = (IDSUSaveManger) storage.getOrLoadData(IDSUSaveManger.class, TechReborn.MOD_ID + "_IDSU"); - - if (instance == null) { - instance = new IDSUSaveManger(TechReborn.MOD_ID + "_IDSU"); - storage.setData(TechReborn.MOD_ID + "_IDSU", instance); - } - return instance; + WorldSavedDataStorage storage = world.getSavedDataStorage(); + throw new UnsupportedOperationException("needs rewriting anyway"); +// IDSUSaveManger instance = (IDSUSaveManger) storage.getOrLoadData(IDSUSaveManger.class, TechReborn.MOD_ID + "_IDSU"); +// +// if (instance == null) { +// instance = new IDSUSaveManger(TechReborn.MOD_ID + "_IDSU"); +// storage.setData(TechReborn.MOD_ID + "_IDSU", instance); +// } +// return instance; } } diff --git a/src/main/java/techreborn/utils/StackWIPHandler.java b/src/main/java/techreborn/utils/StackWIPHandler.java index 56d110a56..8c5cd3a4a 100644 --- a/src/main/java/techreborn/utils/StackWIPHandler.java +++ b/src/main/java/techreborn/utils/StackWIPHandler.java @@ -61,7 +61,7 @@ public class StackWIPHandler { private void addHead(String name) { ItemStack head = new ItemStack(Items.PLAYER_HEAD, 3); head.setTag(new NBTTagCompound()); - head.getTag().setTag("SkullOwner", new NBTTagString(name)); + head.getTag().put("SkullOwner", new NBTTagString(name)); devHeads.add(head); }