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

@ -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 <T> LazyOptional<T> getCapability(Capability<T> capability) {
if (capability == CapabilityEnergy.ENERGY) {
return CapabilityEnergy.ENERGY.cast(this);
return LazyOptional.of(() -> (T)this);
}
return super.getCapability(capability);
}

View file

@ -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);

View file

@ -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;
}
}