This commit is contained in:
parent
1dfa6c094f
commit
427963b40a
6 changed files with 62 additions and 30 deletions
|
@ -63,4 +63,5 @@ public class BlockGrinder extends BlockMachineBase implements IAdvancedRotationT
|
|||
{
|
||||
return prefix + "tier1_machine_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package techreborn.client;
|
|||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
|
@ -60,8 +61,8 @@ public class StackToolTipEvent
|
|||
try
|
||||
{
|
||||
Block block = Block.getBlockFromItem(event.getItemStack().getItem());
|
||||
if (block != null && block instanceof BlockContainer
|
||||
&& block.getClass().getCanonicalName().startsWith("techreborn."))
|
||||
if (block != null && (block instanceof BlockContainer || block instanceof ITileEntityProvider)
|
||||
&& Block.blockRegistry.getNameForObject(block).getResourceDomain().contains("techreborn"))
|
||||
{
|
||||
TileEntity tile = block.createTileEntity(Minecraft.getMinecraft().theWorld,
|
||||
block.getDefaultState());
|
||||
|
|
|
@ -2034,7 +2034,7 @@ public class ModRecipes {
|
|||
new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 5),
|
||||
new ItemStack(ModItems.parts, 8, 41),
|
||||
new ItemStack(Blocks.sapling, 6), ItemCells.getCellByName("methane", 1),
|
||||
ItemCells.getCellByName("carbon", 4), 5000, 5));
|
||||
ItemCells.getCellByName("carbon", 4), 5000, 5, false));
|
||||
|
||||
// Soul Sand Byproducts
|
||||
RecipeHandler.addRecipe(
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
package techreborn.tiles;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.power.IEnergyItemInfo;
|
||||
import reborncore.common.powerSystem.PoweredItem;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Reference;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TileCentrifuge extends TilePowerAcceptor
|
||||
implements IWrenchable, IInventory, ISidedInventory, IListInfoProvider
|
||||
implements IWrenchable, IInventory, IListInfoProvider
|
||||
{
|
||||
|
||||
public int tickTime;
|
||||
|
@ -51,6 +52,19 @@ public class TileCentrifuge extends TilePowerAcceptor
|
|||
super.updateEntity();
|
||||
crafter.updateEntity();
|
||||
charge(6);
|
||||
if (inventory.getStackInSlot(6) != null)
|
||||
{
|
||||
ItemStack stack = inventory.getStackInSlot(6);
|
||||
IEnergyItemInfo item = (IEnergyItemInfo) stack.getItem();
|
||||
if (item.canProvideEnergy(stack))
|
||||
{
|
||||
if (getEnergy() != getMaxPower())
|
||||
{
|
||||
addEnergy(item.getMaxTransfer(stack));
|
||||
PoweredItem.setEnergy(PoweredItem.getEnergy(stack) - item.getMaxTransfer(stack), stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -163,26 +177,26 @@ public class TileCentrifuge extends TilePowerAcceptor
|
|||
return inventory.isItemValidForSlot(slot, stack);
|
||||
}
|
||||
|
||||
// ISidedInventory
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3, 4, 5 } : new int[] { 0, 1, 2, 3, 4, 5 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side)
|
||||
{
|
||||
if (slotIndex >= 2)
|
||||
return false;
|
||||
return isItemValidForSlot(slotIndex, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side)
|
||||
{
|
||||
return slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5;
|
||||
}
|
||||
// // ISidedInventory
|
||||
// @Override
|
||||
// public int[] getSlotsForFace(EnumFacing side)
|
||||
// {
|
||||
// return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3, 4, 5 } : new int[] { 0, 1, 2, 3, 4, 5 };
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side)
|
||||
// {
|
||||
// if (slotIndex >= 2)
|
||||
// return false;
|
||||
// return isItemValidForSlot(slotIndex, itemStack);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side)
|
||||
// {
|
||||
// return slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5;
|
||||
// }
|
||||
|
||||
public int getProgressScaled(int scale)
|
||||
{
|
||||
|
|
|
@ -1,16 +1,23 @@
|
|||
package techreborn.tiles.storage;
|
||||
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 14/03/2016.
|
||||
*/
|
||||
public class TileBatBox extends TileEnergyStorage
|
||||
public class TileBatBox extends TileEnergyStorage implements IListInfoProvider
|
||||
{
|
||||
|
||||
public TileBatBox()
|
||||
{
|
||||
super("BatBox", 2, ModBlocks.batBox, EnumPowerTier.LOW, 32, 32, 4000);
|
||||
}
|
||||
@Override public void addInfo(List<String> info, boolean isRealTile)
|
||||
{
|
||||
info.add("Batbox");
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.util.Inventory;
|
||||
|
@ -15,7 +16,10 @@ import techreborn.init.ModBlocks;
|
|||
import techreborn.lib.Reference;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
|
||||
public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory
|
||||
import java.util.List;
|
||||
|
||||
public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory,
|
||||
IListInfoProvider
|
||||
{
|
||||
|
||||
public Inventory inventory = new Inventory(6, "TileGrinder", 64, this);
|
||||
|
@ -262,4 +266,9 @@ public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IInve
|
|||
{
|
||||
return inventory.getDisplayName();
|
||||
}
|
||||
|
||||
@Override public void addInfo(List<String> info, boolean isRealTile)
|
||||
{
|
||||
info.add("Macerator");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue