mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
funny water plant, configurable blast furnace IO sides, shredder IO fix
This commit is contained in:
parent
9748a34ed0
commit
084f5abd19
@ -475,6 +475,7 @@ public class ModBlocks {
|
||||
|
||||
public static Block plant_flower;
|
||||
public static Block plant_dead;
|
||||
public static Block reeds;
|
||||
|
||||
public static Block waste_earth;
|
||||
public static Block waste_mycelium;
|
||||
@ -1736,6 +1737,7 @@ public class ModBlocks {
|
||||
|
||||
plant_flower = new BlockNTMFlower().setBlockName("plant_flower").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGrass).setHardness(0.0F);
|
||||
plant_dead = new BlockDeadPlant().setBlockName("plant_dead").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGrass).setHardness(0.0F);
|
||||
reeds = new BlockReeds().setBlockName("reeds").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGrass).setHardness(0.0F);
|
||||
|
||||
waste_earth = new WasteEarth(Material.ground, true).setBlockName("waste_earth").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":waste_earth");
|
||||
waste_mycelium = new WasteEarth(Material.ground, true).setBlockName("waste_mycelium").setStepSound(Block.soundTypeGrass).setLightLevel(1F).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":waste_mycelium_side");
|
||||
@ -2819,6 +2821,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(deco_pipe_quad_marked, ItemBlockBase.class, deco_pipe_quad_marked.getUnlocalizedName());
|
||||
register(plant_flower);
|
||||
register(plant_dead);
|
||||
register(reeds);
|
||||
GameRegistry.registerBlock(mush, mush.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(mush_block, mush_block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(mush_block_stem, mush_block_stem.getUnlocalizedName());
|
||||
|
||||
76
src/main/java/com/hbm/blocks/generic/BlockReeds.java
Normal file
76
src/main/java/com/hbm/blocks/generic/BlockReeds.java
Normal file
@ -0,0 +1,76 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockReeds extends Block {
|
||||
|
||||
@SideOnly(Side.CLIENT) public IIcon iconMid;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconBottom;
|
||||
|
||||
public BlockReeds() {
|
||||
super(Material.plants);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
this.blockIcon = reg.registerIcon(RefStrings.MODID + ":reeds_top");
|
||||
this.iconMid = reg.registerIcon(RefStrings.MODID + ":reeds_mid");
|
||||
this.iconMid = reg.registerIcon(RefStrings.MODID + ":reeds_bottom");
|
||||
}
|
||||
|
||||
public IIcon getIcon(int height) {
|
||||
return height == 0 ? this.blockIcon : height == 1 ? this.iconMid : this.iconBottom;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y - 1, z);
|
||||
return block == Blocks.water || block == Blocks.flowing_water;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockStay(World world, int x, int y, int z) {
|
||||
return this.canPlaceBlockAt(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
}
|
||||
@ -184,6 +184,10 @@ public class EntityArtilleryRocket extends EntityThrowableInterp implements IChu
|
||||
public void writeEntityToNBT(NBTTagCompound nbt) {
|
||||
super.writeEntityToNBT(nbt);
|
||||
|
||||
if(this.lastTargetPos == null) {
|
||||
this.lastTargetPos = Vec3.createVectorHelper(posX, posY, posZ);
|
||||
}
|
||||
|
||||
nbt.setDouble("targetX", this.lastTargetPos.xCoord);
|
||||
nbt.setDouble("targetY", this.lastTargetPos.yCoord);
|
||||
nbt.setDouble("targetZ", this.lastTargetPos.zCoord);
|
||||
|
||||
@ -872,7 +872,7 @@ public class GUIHandler implements IGuiHandler {
|
||||
switch(ID) {
|
||||
case ModBlocks.guiID_test_difurnace: {
|
||||
if(entity instanceof TileEntityDiFurnace) {
|
||||
return new GUITestDiFurnace(player.inventory, (TileEntityDiFurnace) entity);
|
||||
return new GUIDiFurnace(player.inventory, (TileEntityDiFurnace) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -6,123 +6,82 @@ import com.hbm.tileentity.machine.TileEntityDiFurnace;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerDiFurnace extends Container {
|
||||
|
||||
|
||||
private TileEntityDiFurnace diFurnace;
|
||||
private int dualCookTime;
|
||||
private int dualPower;
|
||||
|
||||
|
||||
public ContainerDiFurnace(InventoryPlayer invPlayer, TileEntityDiFurnace tedf) {
|
||||
dualCookTime = 0;
|
||||
dualPower = 0;
|
||||
|
||||
|
||||
diFurnace = tedf;
|
||||
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 80, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 80, 54));
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 8, 36));
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 134, 36));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, this.diFurnace.dualCookTime);
|
||||
crafting.sendProgressBarUpdate(this, 1, this.diFurnace.dualPower);
|
||||
/**=====We are entering the magic realm of broken shit.=====**/
|
||||
}
|
||||
|
||||
//What is this!?
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
|
||||
{
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) {
|
||||
|
||||
if (var4 != null && var4.getHasStack())
|
||||
{
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if (par2 <= 3) {
|
||||
if (!this.mergeItemStack(var5, 4, this.inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
if(index >= 0 && index < 3 && button == 1 && mode == 0) {
|
||||
Slot slot = this.getSlot(index);
|
||||
if(!slot.getHasStack()) {
|
||||
if(!player.worldObj.isRemote) {
|
||||
if(index == 0) diFurnace.sideUpper = (byte) ((diFurnace.sideUpper + 1) % 6);
|
||||
if(index == 1) diFurnace.sideLower = (byte) ((diFurnace.sideLower + 1) % 6);
|
||||
if(index == 2) diFurnace.sideFuel = (byte) ((diFurnace.sideFuel + 1) % 6);
|
||||
|
||||
diFurnace.markDirty();
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(var5, 0, 3, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (var5.stackSize == 0)
|
||||
{
|
||||
var4.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return super.slotClick(index, button, mode, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if(var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 <= 3) {
|
||||
if(!this.mergeItemStack(var5, 4, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else if(!this.mergeItemStack(var5, 0, 3, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
for(int i = 0; i < this.crafters.size(); i++)
|
||||
{
|
||||
ICrafting par1 = (ICrafting)this.crafters.get(i);
|
||||
|
||||
if(this.dualCookTime != this.diFurnace.dualCookTime)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 0, this.diFurnace.dualCookTime);
|
||||
}
|
||||
|
||||
if(this.dualPower != this.diFurnace.dualPower)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 1, this.diFurnace.dualPower);
|
||||
}
|
||||
}
|
||||
|
||||
this.dualCookTime = this.diFurnace.dualCookTime;
|
||||
this.dualPower = this.diFurnace.dualPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 0)
|
||||
{
|
||||
diFurnace.dualCookTime = j;
|
||||
}
|
||||
if(i == 1)
|
||||
{
|
||||
diFurnace.dualPower = j;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerDiFurnace;
|
||||
@ -10,25 +12,54 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class GUIDiFurnace extends GuiContainer {
|
||||
|
||||
public class GUITestDiFurnace extends GuiContainer {
|
||||
|
||||
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/GUIDiFurnace.png");
|
||||
private TileEntityDiFurnace diFurnace;
|
||||
|
||||
public GUITestDiFurnace(InventoryPlayer invPlayer, TileEntityDiFurnace tedf) {
|
||||
public GUIDiFurnace(InventoryPlayer invPlayer, TileEntityDiFurnace tedf) {
|
||||
super(new ContainerDiFurnace(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int x, int y, float interp) {
|
||||
super.drawScreen(x, y, interp);
|
||||
|
||||
if(this.mc.thePlayer.inventory.getItemStack() == null) {
|
||||
for(int i = 0; i < 3; i++) {
|
||||
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
|
||||
|
||||
if(this.isMouseOverSlot(slot, x, y)) {
|
||||
|
||||
String label = EnumChatFormatting.YELLOW + "Accepts items from: ";
|
||||
byte dir = i == 0 ? diFurnace.sideUpper : i == 1 ? diFurnace.sideLower : diFurnace.sideFuel;
|
||||
label += ForgeDirection.getOrientation(dir);
|
||||
|
||||
this.func_146283_a(Arrays.asList(new String[] { label }), x, y - 30);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isMouseOverSlot(Slot slot, int x, int y) {
|
||||
return this.func_146978_c(slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
|
||||
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
@ -38,16 +69,18 @@ public class GUITestDiFurnace extends GuiContainer {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(diFurnace.hasPower())
|
||||
{
|
||||
|
||||
if(diFurnace.isInvalid() && diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord) instanceof TileEntityDiFurnace)
|
||||
diFurnace = (TileEntityDiFurnace) diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord);
|
||||
|
||||
if(diFurnace.hasPower()) {
|
||||
int i1 = diFurnace.getPowerRemainingScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 70 - i1, 201, 53 - i1, 16, i1);
|
||||
}
|
||||
|
||||
|
||||
int j1 = diFurnace.getDiFurnaceProgressScaled(24);
|
||||
drawTexturedModalRect(guiLeft + 101, guiTop + 35, 176, 14, j1 + 1, 17);
|
||||
|
||||
|
||||
if(diFurnace.hasPower() && diFurnace.canProcess()) {
|
||||
drawTexturedModalRect(guiLeft + 63, guiTop + 37, 176, 0, 14, 14);
|
||||
}
|
||||
@ -45,19 +45,10 @@ public class GUIMachineArcFurnace extends GuiInfoContainer {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
//failsafe TE clone
|
||||
//if initial TE invalidates, new TE is fetched
|
||||
//if initial ZE is still present, it'll be used instead
|
||||
//works so that container packets can still be used
|
||||
//efficiency!
|
||||
TileEntityMachineArcFurnace fs = null;
|
||||
|
||||
if(diFurnace.isInvalid() && diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord) instanceof TileEntityMachineArcFurnace)
|
||||
fs = (TileEntityMachineArcFurnace) diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord);
|
||||
else
|
||||
fs = diFurnace;
|
||||
diFurnace = (TileEntityMachineArcFurnace) diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord);
|
||||
|
||||
if(fs.hasPower()) {
|
||||
if(diFurnace.hasPower()) {
|
||||
int i = (int)diFurnace.getPowerRemainingScaled(34);
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 51 - i, 176, 67 - i, 16, i);
|
||||
}
|
||||
@ -67,7 +58,7 @@ public class GUIMachineArcFurnace extends GuiInfoContainer {
|
||||
drawTexturedModalRect(guiLeft + 55, guiTop + 35, 176, 0, 15, 16);
|
||||
}
|
||||
|
||||
int j1 = fs.getDiFurnaceProgressScaled(24);
|
||||
int j1 = diFurnace.getDiFurnaceProgressScaled(24);
|
||||
drawTexturedModalRect(guiLeft + 79, guiTop + 34, 176, 16, j1 + 1, 17);
|
||||
}
|
||||
}
|
||||
|
||||
@ -732,6 +732,7 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderDiode());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBoxDuct());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockDecoModel(ModBlocks.deco_computer.getRenderType(), ResourceManager.deco_computer));
|
||||
RenderingRegistry.registerBlockHandler(new RenderReeds());
|
||||
|
||||
RenderingRegistry.registerBlockHandler(new RenderFoundryBasin());
|
||||
RenderingRegistry.registerBlockHandler(new RenderFoundryMold());
|
||||
|
||||
55
src/main/java/com/hbm/render/block/RenderReeds.java
Normal file
55
src/main/java/com/hbm/render/block/RenderReeds.java
Normal file
@ -0,0 +1,55 @@
|
||||
package com.hbm.render.block;
|
||||
|
||||
import com.hbm.blocks.generic.BlockReeds;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class RenderReeds implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { }
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int colorMult = block.colorMultiplier(world, x, y, z);
|
||||
float r = (float) (colorMult >> 16 & 255) / 255.0F;
|
||||
float g = (float) (colorMult >> 8 & 255) / 255.0F;
|
||||
float b = (float) (colorMult & 255) / 255.0F;
|
||||
|
||||
int brightness = block.getMixedBrightnessForBlock(world, x, y, z);
|
||||
tessellator.setBrightness(brightness);
|
||||
|
||||
int depth = 0;
|
||||
for(int i = 1; i < 4; i++) {
|
||||
Block water = world.getBlock(x, y - i, z);
|
||||
depth = i;
|
||||
if(water != Blocks.water && water != Blocks.flowing_water) break;
|
||||
}
|
||||
|
||||
BlockReeds reeds = (BlockReeds) block;
|
||||
|
||||
for(int i = 0; i < depth; i++) {
|
||||
IIcon icon = reeds.getIcon(i == 0 ? 0 : i == depth - 1 ? 2 : 1);
|
||||
renderer.drawCrossedSquares(icon, x, y, z, 1.0F);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BlockReeds.renderID;
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,7 @@ import com.hbm.blocks.machine.MachineDiFurnace;
|
||||
import com.hbm.inventory.recipes.BlastFurnaceRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemRTGPellet;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.util.RTGUtil;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -16,7 +17,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
|
||||
public class TileEntityDiFurnace extends TileEntity implements ISidedInventory, INBTPacketReceiver {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
@ -25,9 +26,10 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
|
||||
public static final int maxPower = 12800;
|
||||
public static final int processingSpeed = 400;
|
||||
|
||||
private static final int[] slots_top = new int[] { 0 };
|
||||
private static final int[] slots_bottom = new int[] { 3 };
|
||||
private static final int[] slots_side = new int[] { 1 };
|
||||
private static final int[] slots_io = new int[] { 0, 1, 2 };
|
||||
public byte sideFuel = 1;
|
||||
public byte sideUpper = 1;
|
||||
public byte sideLower = 1;
|
||||
|
||||
private String customName;
|
||||
|
||||
@ -193,8 +195,8 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return slots_io;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -272,7 +274,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
this.hasPower();
|
||||
|
||||
boolean flag1 = false;
|
||||
|
||||
if(hasPower() && isProcessing()) {
|
||||
@ -322,10 +324,26 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
|
||||
flag1 = true;
|
||||
MachineDiFurnace.updateBlockState(this.dualCookTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setShort("time", (short) this.dualCookTime);
|
||||
data.setShort("fuel", (short) this.dualPower);
|
||||
data.setByteArray("modes", new byte[] {(byte) sideFuel, (byte) sideUpper, (byte) sideLower});
|
||||
INBTPacketReceiver.networkPack(this, data, 15);
|
||||
}
|
||||
|
||||
if(flag1) {
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.dualCookTime = nbt.getShort("time");
|
||||
this.dualPower = nbt.getShort("fuel");
|
||||
byte[] modes = nbt.getByteArray("modes");
|
||||
this.sideFuel = modes[0];
|
||||
this.sideUpper = modes[1];
|
||||
this.sideLower = modes[2];
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,9 +27,7 @@ public class TileEntityMachineShredder extends TileEntityLoadedBase implements I
|
||||
public static final long maxPower = 10000;
|
||||
public static final int processingSpeed = 60;
|
||||
|
||||
private static final int[] slots_top = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8};
|
||||
private static final int[] slots_bottom = new int[] {9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29};
|
||||
private static final int[] slots_side = new int[] {27, 28, 29};
|
||||
private static final int[] slots_io = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29};
|
||||
|
||||
private String customName;
|
||||
|
||||
@ -105,15 +103,9 @@ public class TileEntityMachineShredder extends TileEntityLoadedBase implements I
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
if(i < 9)
|
||||
return true;
|
||||
if(i == 29)
|
||||
if(stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 27 || i == 28)
|
||||
if(stack.getItem() instanceof ItemBlades)
|
||||
return true;
|
||||
if(i < 9) return ShredderRecipes.getShredderResult(stack) != null;
|
||||
if(i == 29) return stack.getItem() instanceof IBatteryItem;
|
||||
if(i == 27 || i == 28) return stack.getItem() instanceof ItemBlades;
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -180,22 +172,18 @@ public class TileEntityMachineShredder extends TileEntityLoadedBase implements I
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return side == 0 ? slots_bottom : (side == 1 ? slots_top : slots_side);
|
||||
return slots_io;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
|
||||
if(j != 1)
|
||||
return this.isItemValidForSlot(i, itemStack);
|
||||
|
||||
if(i >= 9 || !this.isItemValidForSlot(i, itemStack))
|
||||
public boolean canInsertItem(int slot, ItemStack itemStack, int side) {
|
||||
if(slot >= 9 || !this.isItemValidForSlot(slot, itemStack))
|
||||
return false;
|
||||
|
||||
if(slots[i] == null)
|
||||
if(slots[slot] == null)
|
||||
return true;
|
||||
|
||||
int size = slots[i].stackSize;
|
||||
int size = slots[slot].stackSize;
|
||||
|
||||
for(int k = 0; k < 9; k++) {
|
||||
if(slots[k] == null)
|
||||
@ -210,11 +198,8 @@ public class TileEntityMachineShredder extends TileEntityLoadedBase implements I
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
if(i >= 9 && i <= 26)
|
||||
return true;
|
||||
if(i >= 27 && i <= 29)
|
||||
if(itemStack.getItemDamage() == itemStack.getMaxDamage() && itemStack.getMaxDamage() > 0)
|
||||
return true;
|
||||
if(i >= 9 && i <= 26) return true;
|
||||
if(i >= 27 && i <= 28) if(itemStack.getItemDamage() == itemStack.getMaxDamage() && itemStack.getMaxDamage() > 0) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@ import com.hbm.entity.projectile.EntityZirnoxDebris;
|
||||
import com.hbm.entity.projectile.EntityZirnoxDebris.DebrisType;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
@ -32,10 +31,8 @@ import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/blocks/reeds_bottom.png
Normal file
BIN
src/main/resources/assets/hbm/textures/blocks/reeds_bottom.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 194 B |
BIN
src/main/resources/assets/hbm/textures/blocks/reeds_mid.png
Normal file
BIN
src/main/resources/assets/hbm/textures/blocks/reeds_mid.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 165 B |
BIN
src/main/resources/assets/hbm/textures/blocks/reeds_top.png
Normal file
BIN
src/main/resources/assets/hbm/textures/blocks/reeds_top.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 155 B |
Binary file not shown.
|
After Width: | Height: | Size: 837 B |
Binary file not shown.
|
After Width: | Height: | Size: 835 B |
Binary file not shown.
|
After Width: | Height: | Size: 814 B |
Loading…
x
Reference in New Issue
Block a user