mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
whatever
This commit is contained in:
parent
1d4d0166d6
commit
dc6e8e6561
@ -18,13 +18,16 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class FluidDuctBox extends FluidDuctBase implements IBlockMulti, ILookOverlay {
|
||||
|
||||
@ -163,6 +166,121 @@ public class FluidDuctBox extends FluidDuctBase implements IBlockMulti, ILookOve
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB entityBounding, List list, Entity entity) {
|
||||
|
||||
List<AxisAlignedBB> bbs = new ArrayList();
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileEntityPipeBaseNT) {
|
||||
TileEntityPipeBaseNT pipe = (TileEntityPipeBaseNT) te;
|
||||
FluidType type = pipe.getType();
|
||||
|
||||
double lower = 0.125D;
|
||||
double upper = 0.875D;
|
||||
double jLower = 0.0625D;
|
||||
double jUpper = 0.9375D; //TODO
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
for(int i = 2; i < 13; i += 3) {
|
||||
|
||||
if(meta > i) {
|
||||
lower += 0.0625D;
|
||||
upper -= 0.0625D;
|
||||
jLower += 0.0625D;
|
||||
jUpper -= 0.0625D;
|
||||
}
|
||||
}
|
||||
|
||||
boolean nX = canConnectTo(world, x, y, z, Library.NEG_X, type);
|
||||
boolean pX = canConnectTo(world, x, y, z, Library.POS_X, type);
|
||||
boolean nY = canConnectTo(world, x, y, z, Library.NEG_Y, type);
|
||||
boolean pY = canConnectTo(world, x, y, z, Library.POS_Y, type);
|
||||
boolean nZ = canConnectTo(world, x, y, z, Library.NEG_Z, type);
|
||||
boolean pZ = canConnectTo(world, x, y, z, Library.POS_Z, type);
|
||||
int mask = 0 + (pX ? 32 : 0) + (nX ? 16 : 0) + (pY ? 8 : 0) + (nY ? 4 : 0) + (pZ ? 2 : 0) + (nZ ? 1 : 0);
|
||||
|
||||
if(mask == 0) {
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.6875D, y + 0.3125D, z + 0.3125D, x + 1.0D, y + 0.6875D, z + 0.6875D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.0D, y + 0.3125D, z + 0.3125D, x + 0.3125D, y + 0.6875D, z + 0.6875D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.6875D, z + 0.3125D, x + 0.6875D, y + 1.0D, z + 0.6875D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.0D, z + 0.3125D, x + 0.6875D, y + 0.3125D, z + 0.6875D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.6875D, x + 0.6875D, y + 0.6875D, z + 1.0D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.0D, x + 0.6875D, y + 0.6875D, z + 0.3125D));
|
||||
} else if(mask == 0b100000 || mask == 0b010000 || mask == 0b110000) {
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.0D, y + 0.3125D, z + 0.3125D, x + 1.0D, y + 0.6875D, z + 0.6875D));
|
||||
} else if(mask == 0b001000 || mask == 0b000100 || mask == 0b001100) {
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.0D, z + 0.3125D, x + 0.6875D, y + 1.0D, z + 0.6875D));
|
||||
} else if(mask == 0b000010 || mask == 0b000001 || mask == 0b000011) {
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.0D, x + 0.6875D, y + 0.6875D, z + 1.0D));
|
||||
} else {
|
||||
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.3125D, x + 0.6875D, y + 0.6875D, z + 0.6875D));
|
||||
|
||||
if(pX) bbs.add(AxisAlignedBB.getBoundingBox(x + 0.6875D, y + 0.3125D, z + 0.3125D, x + 1.0D, y + 0.6875D, z + 0.6875D));
|
||||
if(nX) bbs.add(AxisAlignedBB.getBoundingBox(x + 0.0D, y + 0.3125D, z + 0.3125D, x + 0.3125D, y + 0.6875D, z + 0.6875D));
|
||||
if(pY) bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.6875D, z + 0.3125D, x + 0.6875D, y + 1.0D, z + 0.6875D));
|
||||
if(nY) bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.0D, z + 0.3125D, x + 0.6875D, y + 0.3125D, z + 0.6875D));
|
||||
if(pZ) bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.6875D, x + 0.6875D, y + 0.6875D, z + 1.0D));
|
||||
if(nZ) bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.0D, x + 0.6875D, y + 0.6875D, z + 0.3125D));
|
||||
}
|
||||
}
|
||||
|
||||
for(AxisAlignedBB bb : bbs) {
|
||||
if(entityBounding.intersectsWith(bb)) {
|
||||
list.add(bb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileEntityPipeBaseNT) {
|
||||
TileEntityPipeBaseNT pipe = (TileEntityPipeBaseNT) te;
|
||||
FluidType type = pipe.getType();
|
||||
|
||||
boolean nX = canConnectTo(world, x, y, z, Library.NEG_X, type);
|
||||
boolean pX = canConnectTo(world, x, y, z, Library.POS_X, type);
|
||||
boolean nY = canConnectTo(world, x, y, z, Library.NEG_Y, type);
|
||||
boolean pY = canConnectTo(world, x, y, z, Library.POS_Y, type);
|
||||
boolean nZ = canConnectTo(world, x, y, z, Library.NEG_Z, type);
|
||||
boolean pZ = canConnectTo(world, x, y, z, Library.POS_Z, type);
|
||||
int mask = 0 + (pX ? 32 : 0) + (nX ? 16 : 0) + (pY ? 8 : 0) + (nY ? 4 : 0) + (pZ ? 2 : 0) + (nZ ? 1 : 0);
|
||||
|
||||
if(mask == 0) {
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F);
|
||||
} else if(mask == 0b100000 || mask == 0b010000 || mask == 0b110000) {
|
||||
this.setBlockBounds(0F, 0.3125F, 0.3125F, 1F, 0.6875F, 0.6875F);
|
||||
} else if(mask == 0b001000 || mask == 0b000100 || mask == 0b001100) {
|
||||
this.setBlockBounds(0.3125F, 0F, 0.3125F, 0.6875F, 1F, 0.6875F);
|
||||
} else if(mask == 0b000010 || mask == 0b000001 || mask == 0b000011) {
|
||||
this.setBlockBounds(0.3125F, 0.3125F, 0F, 0.6875F, 0.6875F, 1F);
|
||||
} else {
|
||||
|
||||
this.setBlockBounds(
|
||||
nX ? 0F : 0.3125F,
|
||||
nY ? 0F : 0.3125F,
|
||||
nZ ? 0F : 0.3125F,
|
||||
pX ? 1F : 0.6875F,
|
||||
pY ? 1F : 0.6875F,
|
||||
pZ ? 1F : 0.6875F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir, FluidType type) {
|
||||
return Library.canConnectFluid(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
|
||||
|
||||
@ -95,9 +95,6 @@ public class FluidDuctStandard extends FluidDuctBase implements IBlockMulti, ILo
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB entityBounding, List list, Entity entity) {
|
||||
|
||||
List<AxisAlignedBB> bbs = new ArrayList();
|
||||
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.3125D, x + 0.6875D, y + 0.6875D, z + 0.6875D));
|
||||
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileEntityPipeBaseNT) {
|
||||
@ -119,16 +116,15 @@ public class FluidDuctStandard extends FluidDuctBase implements IBlockMulti, ILo
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.0D, z + 0.3125D, x + 0.6875D, y + 0.3125D, z + 0.6875D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.6875D, x + 0.6875D, y + 0.6875D, z + 1.0D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.0D, x + 0.6875D, y + 0.6875D, z + 0.3125D));
|
||||
} else if(mask == 0b100000 || mask == 0b010000) {
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.0D, y + 0.3125D, z + 0.3125D, x + 0.3125D, y + 0.6875D, z + 0.6875D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.0D, x + 0.6875D, y + 0.6875D, z + 0.3125D));
|
||||
} else if(mask == 0b001000 || mask == 0b000100) {
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.6875D, z + 0.3125D, x + 0.6875D, y + 1.0D, z + 0.6875D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.0D, z + 0.3125D, x + 0.6875D, y + 0.3125D, z + 0.6875D));
|
||||
} else if(mask == 0b000010 || mask == 0b000001) {
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.6875D, x + 0.6875D, y + 0.6875D, z + 1.0D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.0D, x + 0.6875D, y + 0.6875D, z + 0.3125D));
|
||||
} else if(mask == 0b100000 || mask == 0b010000 || mask == 0b110000) {
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.0D, y + 0.3125D, z + 0.3125D, x + 1.0D, y + 0.6875D, z + 0.6875D));
|
||||
} else if(mask == 0b001000 || mask == 0b000100 || mask == 0b001100) {
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.0D, z + 0.3125D, x + 0.6875D, y + 1.0D, z + 0.6875D));
|
||||
} else if(mask == 0b000010 || mask == 0b000001 || mask == 0b000011) {
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.0D, x + 0.6875D, y + 0.6875D, z + 1.0D));
|
||||
} else {
|
||||
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.3125D, y + 0.3125D, z + 0.3125D, x + 0.6875D, y + 0.6875D, z + 0.6875D));
|
||||
|
||||
if(pX) bbs.add(AxisAlignedBB.getBoundingBox(x + 0.6875D, y + 0.3125D, z + 0.3125D, x + 1.0D, y + 0.6875D, z + 0.6875D));
|
||||
if(nX) bbs.add(AxisAlignedBB.getBoundingBox(x + 0.0D, y + 0.3125D, z + 0.3125D, x + 0.3125D, y + 0.6875D, z + 0.6875D));
|
||||
@ -171,11 +167,11 @@ public class FluidDuctStandard extends FluidDuctBase implements IBlockMulti, ILo
|
||||
|
||||
if(mask == 0) {
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F);
|
||||
} else if(mask == 0b100000 || mask == 0b010000) {
|
||||
} else if(mask == 0b100000 || mask == 0b010000 || mask == 0b110000) {
|
||||
this.setBlockBounds(0F, 0.3125F, 0.3125F, 1F, 0.6875F, 0.6875F);
|
||||
} else if(mask == 0b001000 || mask == 0b000100) {
|
||||
} else if(mask == 0b001000 || mask == 0b000100 || mask == 0b001100) {
|
||||
this.setBlockBounds(0.3125F, 0F, 0.3125F, 0.6875F, 1F, 0.6875F);
|
||||
} else if(mask == 0b000010 || mask == 0b000001) {
|
||||
} else if(mask == 0b000010 || mask == 0b000001 || mask == 0b000011) {
|
||||
this.setBlockBounds(0.3125F, 0.3125F, 0F, 0.6875F, 0.6875F, 1F);
|
||||
} else {
|
||||
|
||||
|
||||
@ -121,6 +121,10 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements
|
||||
this.speed /= (overLevel + 1);
|
||||
this.consumption *= (overLevel + 1);
|
||||
|
||||
if(this.speed <= 0) {
|
||||
this.speed = 1;
|
||||
}
|
||||
|
||||
if(!canProcess()) {
|
||||
this.progress = 0;
|
||||
} else {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 359 B |
BIN
src/main/resources/assets/hbm/textures/blocks/fluid_valve_on.png
Normal file
BIN
src/main/resources/assets/hbm/textures/blocks/fluid_valve_on.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 372 B |
Binary file not shown.
|
After Width: | Height: | Size: 126 B |
Loading…
x
Reference in New Issue
Block a user