More minor fixes, 370

This commit is contained in:
modmuss50 2019-02-22 14:11:55 +00:00
parent d68c65641d
commit a5b2adac78
8 changed files with 23 additions and 24 deletions

View file

@ -97,9 +97,8 @@ public class TechReborn {
// Sounds // Sounds
ModSounds.init(); ModSounds.init();
// Client only init, needs to be done before parts system // Client only init, needs to be done before parts system
proxy.init(event); proxy.init();
// WorldGen // WorldGen
worldGen.load();
//GameRegistry.registerWorldGenerator(worldGen, 0); //GameRegistry.registerWorldGenerator(worldGen, 0);
//GameRegistry.registerWorldGenerator(new OilLakeGenerator(), 0); //GameRegistry.registerWorldGenerator(new OilLakeGenerator(), 0);
// Register Gui Handler // Register Gui Handler
@ -111,7 +110,6 @@ public class TechReborn {
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler()); MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
MinecraftForge.EVENT_BUS.register(new MultiblockServerTickHandler()); MinecraftForge.EVENT_BUS.register(new MultiblockServerTickHandler());
MinecraftForge.EVENT_BUS.register(new TRTickHandler()); MinecraftForge.EVENT_BUS.register(new TRTickHandler());
MinecraftForge.EVENT_BUS.register(worldGen.retroGen);
//Village stuff //Village stuff
if (ConfigTechReborn.enableRubberTreePlantation) { if (ConfigTechReborn.enableRubberTreePlantation) {
VillagerRegistry.instance().registerVillageCreationHandler(new VillagePlantaionHandler()); VillagerRegistry.instance().registerVillageCreationHandler(new VillagePlantaionHandler());
@ -131,7 +129,7 @@ public class TechReborn {
@SubscribeEvent @SubscribeEvent
public void postinit() { public void postinit() {
proxy.postInit(event); proxy.postInit();
ModRecipes.postInit(); ModRecipes.postInit();
LOGGER.info(RecipeHandler.recipeList.size() + " recipes loaded"); LOGGER.info(RecipeHandler.recipeList.size() + " recipes loaded");

View file

@ -25,6 +25,7 @@
package techreborn.itemblocks; package techreborn.itemblocks;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import techreborn.TechReborn; import techreborn.TechReborn;
@ -34,8 +35,6 @@ import techreborn.TechReborn;
public class ItemBlockRubberSapling extends ItemBlock { public class ItemBlockRubberSapling extends ItemBlock {
public ItemBlockRubberSapling(Block block) { public ItemBlockRubberSapling(Block block) {
super(block); super(block, new Item.Properties().group(TechReborn.ITEMGROUP));
setCreativeTab(TechReborn.TAB);
setTranslationKey("techreborn.rubberSapling");
} }
} }

View file

@ -70,9 +70,9 @@ public class DynamicCell extends Item {
//TODO: Property ItemUtils.isItemEquals tags equality handling? //TODO: Property ItemUtils.isItemEquals tags equality handling?
if (stack.hasTag()) { if (stack.hasTag()) {
NBTTagCompound tag = stack.getTag(); NBTTagCompound tag = stack.getTag();
if (tag.getSize() != 1 || tag.hasKey("Fluid")) { if (tag.size() != 1 || tag.contains("Fluid")) {
NBTTagCompound clearTag = new NBTTagCompound(); NBTTagCompound clearTag = new NBTTagCompound();
clearTag.setTag("Fluid", tag.getCompoundTag("Fluid")); clearTag.put("Fluid", tag.getCompound("Fluid"));
stack.setTag(clearTag); stack.setTag(clearTag);
} }
} }

View file

@ -58,8 +58,8 @@ public class ItemFrequencyTransmitter extends Item {
@Override @Override
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public float call(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { public float call(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
if (!stack.isEmpty() && stack.hasTag() && stack.getTag() != null && stack.getTag().hasKey("x") if (!stack.isEmpty() && stack.hasTag() && stack.getTag() != null && stack.getTag().contains("x")
&& stack.getTag().hasKey("y") && stack.getTag().hasKey("z") && stack.getTag().hasKey("dim")) { && stack.getTag().contains("y") && stack.getTag().contains("z") && stack.getTag().contains("dim")) {
return 1.0F; return 1.0F;
} }
return 0.0F; return 0.0F;

View file

@ -39,6 +39,7 @@ import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.common.util.NonNullSupplier;
import net.minecraftforge.energy.CapabilityEnergy; import net.minecraftforge.energy.CapabilityEnergy;
import net.minecraftforge.energy.IEnergyStorage; import net.minecraftforge.energy.IEnergyStorage;
import reborncore.api.IListInfoProvider; import reborncore.api.IListInfoProvider;
@ -50,6 +51,7 @@ import techreborn.blocks.cable.BlockCable;
import techreborn.init.TRContent; import techreborn.init.TRContent;
import techreborn.init.TRTileEntities; import techreborn.init.TRTileEntities;
import javax.annotation.Nonnull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -89,7 +91,7 @@ public class TileCable extends TileEntity
@Override @Override
public <T> LazyOptional<T> getCapability(Capability<T> capability) { public <T> LazyOptional<T> getCapability(Capability<T> capability) {
if (capability == CapabilityEnergy.ENERGY) { if (capability == CapabilityEnergy.ENERGY) {
return CapabilityEnergy.ENERGY.cast(this); return LazyOptional.of(() -> (T)this);
} }
return super.getCapability(capability); return super.getCapability(capability);
} }

View file

@ -30,7 +30,7 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.ForgeModContainer; import net.minecraftforge.common.ForgeMod;
import reborncore.api.IToolDrop; import reborncore.api.IToolDrop;
import reborncore.api.tile.ItemHandlerProvider; import reborncore.api.tile.ItemHandlerProvider;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
@ -96,7 +96,7 @@ public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDr
updateState(); updateState();
burnItem = inventory.getStackInSlot(fuelSlot); burnItem = inventory.getStackInSlot(fuelSlot);
if (inventory.getStackInSlot(fuelSlot).getCount() == 1) { 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)); inventory.setStackInSlot(fuelSlot, new ItemStack(Items.BUCKET));
} else { } else {
inventory.setStackInSlot(fuelSlot, ItemStack.EMPTY); inventory.setStackInSlot(fuelSlot, ItemStack.EMPTY);

View file

@ -25,20 +25,20 @@
package techreborn.tiles.storage.idsu; package techreborn.tiles.storage.idsu;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.storage.MapStorage;
import net.minecraft.world.storage.WorldSavedDataStorage; import net.minecraft.world.storage.WorldSavedDataStorage;
import techreborn.TechReborn; import techreborn.TechReborn;
public class IDSUManager { public class IDSUManager {
public static IDataIDSU getData(World world) { public static IDataIDSU getData(World world) {
WorldSavedDataStorage storage = world.getMapStorage(); WorldSavedDataStorage storage = world.getSavedDataStorage();
IDSUSaveManger instance = (IDSUSaveManger) storage.getOrLoadData(IDSUSaveManger.class, TechReborn.MOD_ID + "_IDSU"); 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"); // if (instance == null) {
storage.setData(TechReborn.MOD_ID + "_IDSU", instance); // instance = new IDSUSaveManger(TechReborn.MOD_ID + "_IDSU");
} // storage.setData(TechReborn.MOD_ID + "_IDSU", instance);
return instance; // }
// return instance;
} }
} }

View file

@ -61,7 +61,7 @@ public class StackWIPHandler {
private void addHead(String name) { private void addHead(String name) {
ItemStack head = new ItemStack(Items.PLAYER_HEAD, 3); ItemStack head = new ItemStack(Items.PLAYER_HEAD, 3);
head.setTag(new NBTTagCompound()); head.setTag(new NBTTagCompound());
head.getTag().setTag("SkullOwner", new NBTTagString(name)); head.getTag().put("SkullOwner", new NBTTagString(name));
devHeads.add(head); devHeads.add(head);
} }