fixes, iGen IO, nicer fluid tank model

This commit is contained in:
Bob 2022-07-22 23:58:42 +02:00
parent 0c0ca15dbf
commit ae6763ae7e
160 changed files with 4447 additions and 1394 deletions

View File

@ -3,10 +3,13 @@ package com.hbm.blocks.machine;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityFWatzCore;
import api.hbm.fluid.IFluidConnectorBlock;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -20,9 +23,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class FWatzHatch extends Block {
public class FWatzHatch extends Block implements IFluidConnectorBlock {
@SideOnly(Side.CLIENT)
private IIcon iconFront;
@ -58,37 +63,6 @@ public class FWatzHatch extends Block {
//this.setDefaultDirection(world, x, y, z);
}
private void setDefaultDirection(World world, int x, int y, int z) {
if(!world.isRemote)
{
Block block1 = world.getBlock(x, y, z - 1);
Block block2 = world.getBlock(x, y, z + 1);
Block block3 = world.getBlock(x - 1, y, z);
Block block4 = world.getBlock(x + 1, y, z);
byte b0 = 3;
if(block1.func_149730_j() && !block2.func_149730_j())
{
b0 = 3;
}
if(block2.func_149730_j() && !block1.func_149730_j())
{
b0 = 2;
}
if(block3.func_149730_j() && !block4.func_149730_j())
{
b0 = 5;
}
if(block4.func_149730_j() && !block3.func_149730_j())
{
b0 = 4;
}
world.setBlockMetadataWithNotify(x, y, z, b0, 2);
}
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
@ -111,6 +85,7 @@ public class FWatzHatch extends Block {
}
}
//this is fucking atrocious
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
@ -179,4 +154,9 @@ public class FWatzHatch extends Block {
return false;
}
}
@Override
public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
return type == Fluids.AMAT || type == Fluids.ASCHRAB;
}
}

View File

@ -2,7 +2,6 @@ package com.hbm.blocks.machine;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.MultiblockHandlerXR;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.TileEntityMachineIGenerator;
@ -10,7 +9,6 @@ import com.hbm.tileentity.machine.TileEntityMachineIGenerator;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@ -30,7 +28,7 @@ public class MachineIGenerator extends BlockDummyable {
if(meta >= extra)
return new TileEntityProxyCombo(false, true, true);
return null;
return new TileEntityProxyCombo(true, false, false);
}
@Override

View File

@ -3,10 +3,13 @@ package com.hbm.blocks.machine;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityWatzCore;
import api.hbm.fluid.IFluidConnectorBlock;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -20,9 +23,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class WatzHatch extends Block {
public class WatzHatch extends Block implements IFluidConnectorBlock {
@SideOnly(Side.CLIENT)
private IIcon iconFront;
@ -56,37 +61,6 @@ public class WatzHatch extends Block {
//this.setDefaultDirection(world, x, y, z);
}
private void setDefaultDirection(World world, int x, int y, int z) {
if(!world.isRemote)
{
Block block1 = world.getBlock(x, y, z - 1);
Block block2 = world.getBlock(x, y, z + 1);
Block block3 = world.getBlock(x - 1, y, z);
Block block4 = world.getBlock(x + 1, y, z);
byte b0 = 3;
if(block1.func_149730_j() && !block2.func_149730_j())
{
b0 = 3;
}
if(block2.func_149730_j() && !block1.func_149730_j())
{
b0 = 2;
}
if(block3.func_149730_j() && !block4.func_149730_j())
{
b0 = 5;
}
if(block4.func_149730_j() && !block3.func_149730_j())
{
b0 = 4;
}
world.setBlockMetadataWithNotify(x, y, z, b0, 2);
}
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
@ -177,4 +151,9 @@ public class WatzHatch extends Block {
return false;
}
}
@Override
public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
return type == Fluids.WATZ;
}
}

View File

@ -108,7 +108,7 @@ public class BobmazonOfferFactory {
weapons.add(new Offer(new ItemStack(ModItems.sat_chip), Requirement.CHEMICS, 35 * inflation));
weapons.add(new Offer(new ItemStack(ModBlocks.turret_cheapo), Requirement.CHEMICS, 70 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.turret_cheapo_ammo), Requirement.ASSEMBLY, 20 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.turret_control), Requirement.CHEMICS, 35 * inflation));
//weapons.add(new Offer(new ItemStack(ModItems.turret_control), Requirement.CHEMICS, 35 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.turret_chip), Requirement.CHEMICS, 80 * inflation));
weapons.add(new Offer(new ItemStack(ModBlocks.mine_ap, 4), Requirement.ASSEMBLY, 25 * inflation));
weapons.add(new Offer(new ItemStack(ModBlocks.emp_bomb), Requirement.CHEMICS, 90 * inflation));

View File

@ -2384,7 +2384,7 @@ public class ModItems {
public static Item bomb_caller;
public static Item meteor_remote;
public static Item remote;
public static Item turret_control;
//public static Item turret_control;
public static Item turret_chip;
//public static Item turret_biometry;
@ -4807,7 +4807,7 @@ public class ModItems {
linker = new ItemTeleLink().setUnlocalizedName("linker").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":linker");
reactor_sensor = new ItemReactorSensor().setUnlocalizedName("reactor_sensor").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":reactor_sensor");
oil_detector = new ItemOilDetector().setUnlocalizedName("oil_detector").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":oil_detector");
turret_control = new ItemTurretControl().setUnlocalizedName("turret_control").setFull3D().setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":turret_control");
//turret_control = new ItemTurretControl().setUnlocalizedName("turret_control").setFull3D().setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":turret_control");
turret_chip = new ItemTurretChip().setUnlocalizedName("turret_chip").setMaxStackSize(1).setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":turret_chip");
//turret_biometry = new ItemTurretBiometry().setUnlocalizedName("turret_biometry").setFull3D().setMaxStackSize(1).setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":rei_scanner");
dosimeter = new ItemDosimeter().setUnlocalizedName("dosimeter").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":dosimeter");
@ -6943,7 +6943,7 @@ public class ModItems {
GameRegistry.registerItem(designator_range, designator_range.getUnlocalizedName());
GameRegistry.registerItem(designator_manual, designator_manual.getUnlocalizedName());
GameRegistry.registerItem(designator_arty_range, designator_arty_range.getUnlocalizedName());
GameRegistry.registerItem(turret_control, turret_control.getUnlocalizedName());
//GameRegistry.registerItem(turret_control, turret_control.getUnlocalizedName());
GameRegistry.registerItem(turret_chip, turret_chip.getUnlocalizedName());
//GameRegistry.registerItem(turret_biometry, turret_biometry.getUnlocalizedName());
GameRegistry.registerItem(linker, linker.getUnlocalizedName());

View File

@ -1107,6 +1107,9 @@ public class MainRegistry {
ignoreMappings.add("hbm:item.man_explosive");
ignoreMappings.add("hbm:item.crystal_energy");
ignoreMappings.add("hbm:item.pellet_coolant");
ignoreMappings.add("hbm:item.turret_control");
/// REMAP ///
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);
remapItems.put("hbm:item.man_explosive8", ModItems.explosive_lenses);

View File

@ -391,7 +391,7 @@ public class ResourceManager {
//Tank
public static final ResourceLocation tank_tex = new ResourceLocation(RefStrings.MODID, "textures/models/tank.png");
public static final ResourceLocation tank_label_tex = new ResourceLocation(RefStrings.MODID, "textures/models/tank_label/tank_NONE.png");
public static final ResourceLocation tank_label_tex = new ResourceLocation(RefStrings.MODID, "textures/models/tank/tank_NONE.png");
public static final ResourceLocation bat9000_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/bat9000.png");
public static final ResourceLocation orbus_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/orbus.png");

View File

@ -284,19 +284,6 @@ public class ItemRenderLibrary {
GL11.glEnable(GL11.GL_CULL_FACE);
}});
renderers.put(Item.getItemFromBlock(ModBlocks.machine_fluidtank), new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -2, 0);
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(3, 3, 3);
}
public void renderCommon() {
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.tank_tex); ResourceManager.fluidtank.renderPart("Tank");
GL11.glShadeModel(GL11.GL_FLAT);
bindTexture(ResourceManager.tank_label_tex); ResourceManager.fluidtank.renderPart("Label");
}});
renderers.put(Item.getItemFromBlock(ModBlocks.machine_well), new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -4, 0);
@ -1351,6 +1338,9 @@ public class ItemRenderLibrary {
ResourceManager.heater_firebox.renderPart("Main");
ResourceManager.heater_firebox.renderPart("Door");
}});
//hi there! it seems you are trying to register a new item renderer, most likely for a tile entity.
//please refer to the comment at the start of the file on how to do this without adding to this gigantic pile of feces.
}
private static void bindTexture(ResourceLocation res) {

View File

@ -2,17 +2,19 @@ package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.ModBlocks;
import com.hbm.lib.RefStrings;
import com.hbm.main.ResourceManager;
import com.hbm.render.item.ItemRenderBase;
import com.hbm.tileentity.machine.storage.TileEntityMachineFluidTank;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import net.minecraftforge.client.IItemRenderer;
public class RenderFluidTank extends TileEntitySpecialRenderer {
public class RenderFluidTank extends TileEntitySpecialRenderer implements IItemRendererProvider {
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
@ -20,46 +22,51 @@ public class RenderFluidTank extends TileEntitySpecialRenderer {
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
switch(tileEntity.getBlockMetadata()) {
case 2: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(0, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(180, 0F, 1F, 0F); break;
}
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotatef(90, 0F, 1F, 0F);
switch(tileEntity.getBlockMetadata()) {
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
bindTexture(ResourceManager.tank_tex);
ResourceManager.fluidtank.renderPart("Tank");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotatef(90, 0F, 1F, 0F);
switch(tileEntity.getBlockMetadata()) {
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
ResourceManager.fluidtank.renderPart("Frame");
String s = "NONE";
if(tileEntity instanceof TileEntityMachineFluidTank)
s = ((TileEntityMachineFluidTank) tileEntity).tank.getTankType().name();
s = ((TileEntityMachineFluidTank) tileEntity).tank.getTankType().getName();
bindTexture(new ResourceLocation(RefStrings.MODID, "textures/models/tank_label/tank_" + s + ".png"));
ResourceManager.fluidtank.renderPart("Label");
bindTexture(new ResourceLocation(RefStrings.MODID, "textures/models/tank/tank_" + s + ".png"));
ResourceManager.fluidtank.renderPart("Tank");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
@Override
public Item getItemForRenderer() {
return Item.getItemFromBlock(ModBlocks.machine_fluidtank);
}
@Override
public IItemRenderer getRenderer() {
return new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -2, 0);
GL11.glScaled(3.5, 3.5, 3.5);
}
public void renderCommon() {
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(0.75, 0.75, 0.75);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.tank_tex); ResourceManager.fluidtank.renderPart("Frame");
bindTexture(ResourceManager.tank_label_tex); ResourceManager.fluidtank.renderPart("Tank");
GL11.glShadeModel(GL11.GL_FLAT);
}};
}
}

View File

@ -13,9 +13,11 @@ import com.hbm.lib.Library;
import com.hbm.packet.AuxElectricityPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.util.fauxpointtwelve.DirPos;
import com.hbm.world.machine.FWatz;
import api.hbm.energy.IEnergyGenerator;
import api.hbm.fluid.IFluidStandardReceiver;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
@ -25,7 +27,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.world.World;
public class TileEntityFWatzCore extends TileEntityLoadedBase implements ISidedInventory, IReactor, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
public class TileEntityFWatzCore extends TileEntityLoadedBase implements ISidedInventory, IReactor, IEnergyGenerator, IFluidContainer, IFluidAcceptor, IFluidStandardReceiver {
public long power;
public final static long maxPower = 10000000000L;
@ -257,15 +259,26 @@ public class TileEntityFWatzCore extends TileEntityLoadedBase implements ISidedI
return 0;
}
public DirPos[] getConPos() {
return new DirPos[] {
new DirPos(xCoord + 10, yCoord - 11, zCoord, Library.POS_X),
new DirPos(xCoord - 10, yCoord - 11, zCoord, Library.NEG_X),
new DirPos(xCoord, yCoord - 11, zCoord + 10, Library.POS_Z),
new DirPos(xCoord, yCoord - 11, zCoord - 10, Library.NEG_Z)
};
}
@Override
public void updateEntity() {
if (this.isStructureValid(this.worldObj) && !worldObj.isRemote) {
if(!worldObj.isRemote && this.isStructureValid(this.worldObj)) {
this.sendPower(worldObj, xCoord + 10, yCoord - 11, zCoord, Library.POS_X);
this.sendPower(worldObj, xCoord - 10, yCoord - 11, zCoord, Library.NEG_X);
this.sendPower(worldObj, xCoord, yCoord - 11, zCoord + 10, Library.POS_Z);
this.sendPower(worldObj, xCoord, yCoord - 11, zCoord - 10, Library.NEG_Z);
for(DirPos pos : this.getConPos()) {
this.sendPower(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
this.trySubscribe(tanks[1].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
this.trySubscribe(tanks[2].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
if (hasFuse() && getSingularityType() > 0) {
if(cooldown) {
@ -422,4 +435,8 @@ public class TileEntityFWatzCore extends TileEntityLoadedBase implements ISidedI
else
return 0;
}
@Override
public FluidTank[] getReceivingTanks() {
return new FluidTank[] { tanks[1], tanks[2] };
}
}

View File

@ -1,11 +1,8 @@
package com.hbm.tileentity.machine;
import com.hbm.blocks.ModBlocks;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer;
import com.hbm.interfaces.IReactor;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems;
import com.hbm.lib.Library;
@ -22,7 +19,8 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class TileEntityFusionMultiblock extends TileEntity implements ISidedInventory, IReactor, IFluidContainer, IFluidAcceptor {
@Deprecated //old multiblock fusion reactor
public class TileEntityFusionMultiblock extends TileEntity implements ISidedInventory, IReactor {
public long power;
public final static long maxPower = 100000000;
@ -1192,50 +1190,4 @@ public class TileEntityFusionMultiblock extends TileEntity implements ISidedInve
if(worldObj.getBlock(x, y, z) == ModBlocks.plasma)
worldObj.setBlock(x, y, z, Blocks.air);
}
@Override
public void setFillForSync(int fill, int index) {
if(index < 3 && tanks[index] != null)
tanks[index].setFill(fill);
}
@Override
public void setTypeForSync(FluidType type, int index) {
if(index < 3 && tanks[index] != null)
tanks[index].setTankType(type);
}
@Override
public void setFluidFill(int i, FluidType type) {
if(type.name().equals(tanks[0].getTankType().name()))
tanks[0].setFill(i);
else if(type.name().equals(tanks[1].getTankType().name()))
tanks[1].setFill(i);
else if(type.name().equals(tanks[2].getTankType().name()))
tanks[2].setFill(i);
}
@Override
public int getFluidFill(FluidType type) {
if(type.name().equals(tanks[0].getTankType().name()))
return tanks[0].getFill();
else if(type.name().equals(tanks[1].getTankType().name()))
return tanks[1].getFill();
else if(type.name().equals(tanks[2].getTankType().name()))
return tanks[2].getFill();
else
return 0;
}
@Override
public int getMaxFluidFill(FluidType type) {
if(type.name().equals(tanks[0].getTankType().name()))
return tanks[0].getMaxFill();
else if(type.name().equals(tanks[1].getTankType().name()))
return tanks[1].getMaxFill();
else if(type.name().equals(tanks[2].getTankType().name()))
return tanks[2].getMaxFill();
else
return 0;
}
}

View File

@ -1,15 +1,10 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.hbm.blocks.machine.MachineGenerator;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFuelRod;
@ -28,7 +23,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
public class TileEntityMachineGenerator extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor {
@Deprecated //y'know, the single block reactor
public class TileEntityMachineGenerator extends TileEntity implements ISidedInventory {
private ItemStack slots[];
@ -518,44 +514,4 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
ExplosionNukeGeneric.waste(worldObj, this.xCoord, this.yCoord, this.zCoord, 35);
worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, Blocks.flowing_lava);
}
@Override
public int getMaxFluidFill(FluidType type) {
if(type.name().equals(tanks[0].getTankType().name()))
return tanks[0].getMaxFill();
else if(type.name().equals(tanks[1].getTankType().name()))
return tanks[1].getMaxFill();
else
return 0;
}
@Override
public void setFluidFill(int i, FluidType type) {
if(type.name().equals(tanks[0].getTankType().name()))
tanks[0].setFill(i);
else if(type.name().equals(tanks[1].getTankType().name()))
tanks[1].setFill(i);
}
@Override
public int getFluidFill(FluidType type) {
if(type.name().equals(tanks[0].getTankType().name()))
return tanks[0].getFill();
else if(type.name().equals(tanks[1].getTankType().name()))
return tanks[1].getFill();
else
return 0;
}
@Override
public void setFillForSync(int fill, int index) {
if(index < 2 && tanks[index] != null)
tanks[index].setFill(fill);
}
@Override
public void setTypeForSync(FluidType type, int index) {
if(index < 2 && tanks[index] != null)
tanks[index].setTankType(type);
}
}

View File

@ -10,19 +10,22 @@ import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.RTGUtil;
import com.hbm.util.fauxpointtwelve.DirPos;
import api.hbm.energy.IEnergyGenerator;
import api.hbm.fluid.IFluidStandardReceiver;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityMachineIGenerator extends TileEntityMachineBase implements IFluidAcceptor, IEnergyGenerator {
public class TileEntityMachineIGenerator extends TileEntityMachineBase implements IFluidAcceptor, IEnergyGenerator, IFluidStandardReceiver {
public long power;
public static final long maxPower = 1000000;
@ -52,6 +55,14 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
public String getName() {
return "container.iGenerator";
}
protected DirPos[] getConPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
return new DirPos[] {
new DirPos(xCoord + dir.offsetX * -4, yCoord, zCoord + dir.offsetZ * -4, dir.getOpposite()),
new DirPos(xCoord + dir.offsetX * 3, yCoord, zCoord + dir.offsetZ * 3, dir),
};
}
@Override
public void updateEntity() {
@ -60,9 +71,13 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
power = Library.chargeItemsFromTE(slots, 0, power, maxPower);
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
this.sendPower(worldObj, xCoord + dir.offsetX * -4, yCoord, zCoord + dir.offsetZ * -4, dir.getOpposite());
this.sendPower(worldObj, xCoord + dir.offsetX * 3, yCoord, zCoord + dir.offsetZ * 3, dir);
for(DirPos dir : getConPos()) {
this.sendPower(worldObj, dir.getX(), dir.getY(), dir.getZ(), dir.getDir());
for(FluidTank tank : tanks) {
this.trySubscribe(tank.getTankType(), worldObj, dir.getX(), dir.getY(), dir.getZ(), dir.getDir());
}
}
tanks[1].setType(9, 10, slots);
tanks[0].loadTank(1, 2, slots);
@ -174,6 +189,16 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
}
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
return i >= 3 && i <= 6 && TileEntityFurnace.getItemBurnTime(itemStack) > 0;
}
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return new int[] { 3, 4, 5, 6 };
}
@Override
public void networkUnpack(NBTTagCompound nbt) {
this.power = nbt.getLong("power");
@ -278,4 +303,9 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
public long getMaxPower() {
return this.maxPower;
}
@Override
public FluidTank[] getReceivingTanks() {
return new FluidTank[] { tanks[0], tanks[1], tanks[2] };
}
}

View File

@ -24,6 +24,8 @@ import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.TileEntityLoadedBase;
import api.hbm.energy.IEnergyGenerator;
import api.hbm.fluid.IFluidStandardSender;
import api.hbm.fluid.IFluidStandardTransceiver;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@ -35,7 +37,7 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityWatzCore extends TileEntityLoadedBase implements ISidedInventory, IReactor, IEnergyGenerator, IFluidContainer, IFluidSource {
public class TileEntityWatzCore extends TileEntityLoadedBase implements ISidedInventory, IReactor, IEnergyGenerator, IFluidContainer, IFluidSource, IFluidStandardSender {
public long power;
public final static long maxPower = 100000000;
@ -520,7 +522,7 @@ public class TileEntityWatzCore extends TileEntityLoadedBase implements ISidedIn
@Override
public void updateEntity() {
if (this.isStructureValid(this.worldObj)) {
if(this.isStructureValid(this.worldObj)) {
powerMultiplier = 100;
heatMultiplier = 100;
@ -554,6 +556,11 @@ public class TileEntityWatzCore extends TileEntityLoadedBase implements ISidedIn
this.sendPower(worldObj, xCoord, yCoord + 7, zCoord, ForgeDirection.UP);
this.sendPower(worldObj, xCoord, yCoord - 7, zCoord, ForgeDirection.DOWN);
this.sendFluid(tank.getTankType(), worldObj, xCoord + 4, yCoord, zCoord, Library.POS_X);
this.sendFluid(tank.getTankType(), worldObj, xCoord, yCoord, zCoord + 4, Library.POS_Z);
this.sendFluid(tank.getTankType(), worldObj, xCoord - 4, yCoord, zCoord, Library.NEG_X);
this.sendFluid(tank.getTankType(), worldObj, xCoord, yCoord, zCoord - 4, Library.NEG_Z);
if (age == 9 || age == 19) {
fillFluidInit(tank.getTankType());
@ -743,4 +750,8 @@ public class TileEntityWatzCore extends TileEntityLoadedBase implements ISidedIn
public void clearFluidList(FluidType type) {
list1.clear();
}
@Override
public FluidTank[] getSendingTanks() {
return new FluidTank[] { tank };
}
}

View File

@ -58,7 +58,26 @@ public class TileEntityCraneInserter extends TileEntityMachineBase implements IG
if(ret == null || ret.stackSize != stack.stackSize) {
slots[i] = ret;
this.markDirty();
break;
return;
}
}
}
//if the previous operation fails, repeat but use single items instead of the whole stack instead
//this should fix cases where the inserter can't insert into something that has a stack size limitation
for(int i = 0; i < slots.length; i++) {
ItemStack stack = slots[i];
if(stack != null) {
stack = stack.copy();
stack.stackSize = 1;
ItemStack ret = CraneInserter.addToInventory((IInventory) te, access, stack.copy(), dir.ordinal());
if(ret == null || ret.stackSize != stack.stackSize) {
this.decrStackSize(i, 1);
this.markDirty();
return;
}
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 889 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 984 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 973 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 912 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Some files were not shown because too many files have changed in this diff Show More