mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
watz core component functionality
This commit is contained in:
parent
5246b7fad1
commit
e138ff8b96
@ -45,7 +45,7 @@ public class Watz extends BlockDummyable {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
@ -59,5 +59,6 @@ public class Watz extends BlockDummyable {
|
||||
this.makeExtra(world, x - 2, y + 2, z);
|
||||
this.makeExtra(world, x, y + 2, z + 2);
|
||||
this.makeExtra(world, x, y + 2, z - 2);
|
||||
this.makeExtra(world, x, y + 2, z);
|
||||
}
|
||||
}
|
||||
|
||||
@ -444,7 +444,7 @@ public class AnvilRecipes {
|
||||
new AStack[] {new ComparableStack(ModItems.nugget_bismuth, 2), new OreDictStack(U238.billet(), 2), new OreDictStack(NB.dust(), 1)},
|
||||
new AnvilOutput(new ItemStack(ModItems.plate_bismuth, 1))).setTier(4));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new AStack[] {new OreDictStack(EUPH.ingot(), 4), new OreDictStack(AT.dust(), 2), new OreDictStack(VOLCANIC.gem(), 1)},
|
||||
new AStack[] {new OreDictStack(EUPH.ingot(), 4), new OreDictStack(AT.dust(), 3), new OreDictStack(BI.dust(), 1), new OreDictStack(VOLCANIC.gem(), 1), new ComparableStack(ModItems.ingot_osmiridium)},
|
||||
new AnvilOutput(new ItemStack(ModItems.plate_euphemium, 4))).setTier(6));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new AStack[] {new OreDictStack(DNT.ingot(), 4), new ComparableStack(ModItems.powder_spark_mix, 2), new OreDictStack(DESH.ingot(), 1)},
|
||||
|
||||
@ -1,22 +1,99 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.Watz;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityWatzStruct extends TileEntity {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(worldObj.isRemote)
|
||||
return;
|
||||
if(worldObj.isRemote) return;
|
||||
if(worldObj.getTotalWorldTime() % 20 != 0) return;
|
||||
|
||||
/*
|
||||
* skeptics may say that his is shit. i don't necessarily disagree, but it was both easy and quick to do
|
||||
* and it remains readable and not terribly long, so who the fuck cares.
|
||||
*/
|
||||
if(!cbr(ModBlocks.watz_cooler, 0, 1, 0)) return;
|
||||
if(!cbr(ModBlocks.watz_cooler, 0, 2, 0)) return;
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
if(!cbr(ModBlocks.watz_element, 1, i, 0)) return;
|
||||
if(!cbr(ModBlocks.watz_element, 2, i, 0)) return;
|
||||
if(!cbr(ModBlocks.watz_element, 0, i, 1)) return;
|
||||
if(!cbr(ModBlocks.watz_element, 0, i, 2)) return;
|
||||
if(!cbr(ModBlocks.watz_element, -1, i, 0)) return;
|
||||
if(!cbr(ModBlocks.watz_element, -2, i, 0)) return;
|
||||
if(!cbr(ModBlocks.watz_element, 0, i, -1)) return;
|
||||
if(!cbr(ModBlocks.watz_element, 0, i, -2)) return;
|
||||
if(!cbr(ModBlocks.watz_element, 1, i, 1)) return;
|
||||
if(!cbr(ModBlocks.watz_element, 1, i, -1)) return;
|
||||
if(!cbr(ModBlocks.watz_element, -1, i, 1)) return;
|
||||
if(!cbr(ModBlocks.watz_element, -1, i, -1)) return;
|
||||
if(!cbr(ModBlocks.watz_cooler, 2, i, 1)) return;
|
||||
if(!cbr(ModBlocks.watz_cooler, 2, i, -1)) return;
|
||||
if(!cbr(ModBlocks.watz_cooler, 1, i, 2)) return;
|
||||
if(!cbr(ModBlocks.watz_cooler, -1, i, 2)) return;
|
||||
if(!cbr(ModBlocks.watz_cooler, -2, i, 1)) return;
|
||||
if(!cbr(ModBlocks.watz_cooler, -2, i, -1)) return;
|
||||
if(!cbr(ModBlocks.watz_cooler, 1, i, -2)) return;
|
||||
if(!cbr(ModBlocks.watz_cooler, -1, i, -2)) return;
|
||||
|
||||
for(int j = -1; j < 2; j++) {
|
||||
if(!cbr(ModBlocks.watz_end, 3, i, j)) return;
|
||||
if(!cbr(ModBlocks.watz_end, j, i, 3)) return;
|
||||
if(!cbr(ModBlocks.watz_end, -3, i, j)) return;
|
||||
if(!cbr(ModBlocks.watz_end, j, i, -3)) return;
|
||||
}
|
||||
if(!cbr(ModBlocks.watz_end, 2, i, 2)) return;
|
||||
if(!cbr(ModBlocks.watz_end, 2, i, -2)) return;
|
||||
if(!cbr(ModBlocks.watz_end, -2, i, 2)) return;
|
||||
if(!cbr(ModBlocks.watz_end, -2, i, -2)) return;
|
||||
}
|
||||
|
||||
Watz watz = (Watz)ModBlocks.watz;
|
||||
BlockDummyable.safeRem = true;
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.watz, this.getBlockMetadata() + BlockDummyable.offset, 3);
|
||||
watz.fillSpace(worldObj, xCoord, yCoord, zCoord, ForgeDirection.NORTH, 0);
|
||||
BlockDummyable.safeRem = false;
|
||||
}
|
||||
|
||||
/** [G]et [B]lock at [R]elative position */
|
||||
private Block gbr(int x, int y, int z) {
|
||||
return worldObj.getBlock(xCoord + x, yCoord + y, zCoord + z);
|
||||
}
|
||||
|
||||
/** [C]heck [B]lock at [R]elative position */
|
||||
private boolean cbr(Block b, int x, int y, int z) {
|
||||
return b == gbr(x, y, z);
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 3,
|
||||
yCoord,
|
||||
zCoord - 3,
|
||||
xCoord + 4,
|
||||
yCoord + 3,
|
||||
zCoord + 4
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user