new multiblock sys for assembler

This commit is contained in:
Bob 2023-07-05 22:42:36 +02:00
parent 5f109b61ec
commit 25a7a6c345
8 changed files with 45 additions and 38 deletions

View File

@ -75,7 +75,7 @@ public interface IEnergyConnector extends ILoadedTile {
red = true;
}
if(particleDebug) {//
if(particleDebug) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "network");
data.setString("mode", "power");

View File

@ -1203,8 +1203,6 @@ public class ModBlocks {
public static Block dummy_block_drill;
public static Block dummy_port_drill;
public static Block dummy_block_assembler;
public static Block dummy_port_assembler;
public static Block dummy_block_ams_limiter;
public static Block dummy_port_ams_limiter;
public static Block dummy_block_ams_emitter;
@ -2350,8 +2348,6 @@ public class ModBlocks {
dummy_block_drill = new DummyBlockDrill(Material.iron, false).setBlockName("dummy_block_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
dummy_port_drill = new DummyBlockDrill(Material.iron, true).setBlockName("dummy_port_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
dummy_block_assembler = new DummyBlockAssembler(Material.iron, false).setBlockName("dummy_block_assembler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
dummy_port_assembler = new DummyBlockAssembler(Material.iron, true).setBlockName("dummy_port_assembler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
dummy_block_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_block_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
dummy_port_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_port_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
dummy_block_ams_emitter = new DummyBlockAMSEmitter(Material.iron).setBlockName("dummy_block_ams_emitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
@ -3444,8 +3440,6 @@ public class ModBlocks {
//Multiblock Dummy Blocks
GameRegistry.registerBlock(dummy_block_drill, dummy_block_drill.getUnlocalizedName());
GameRegistry.registerBlock(dummy_port_drill, dummy_port_drill.getUnlocalizedName());
GameRegistry.registerBlock(dummy_block_assembler, dummy_block_assembler.getUnlocalizedName());
GameRegistry.registerBlock(dummy_port_assembler, dummy_port_assembler.getUnlocalizedName());
GameRegistry.registerBlock(dummy_block_ams_limiter, dummy_block_ams_limiter.getUnlocalizedName());
GameRegistry.registerBlock(dummy_port_ams_limiter, dummy_port_ams_limiter.getUnlocalizedName());
GameRegistry.registerBlock(dummy_block_ams_emitter, dummy_block_ams_emitter.getUnlocalizedName());

View File

@ -4,8 +4,10 @@ import com.hbm.blocks.BlockDummyable;
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class MachineAssembler extends BlockDummyable {
@ -28,4 +30,24 @@ public class MachineAssembler extends BlockDummyable {
public int getOffset() {
return 1;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
return this.standardOpenBehavior(world, x, y, z, player, 0);
}
@Override
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;
z -= dir.offsetZ;
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
this.makeExtra(world, x + rot.offsetX * 2, y, z + rot.offsetZ * 2);
this.makeExtra(world, x - rot.offsetX * 1, y, z - rot.offsetZ * 1);
this.makeExtra(world, x + rot.offsetX * 2 - dir.offsetX, y, z + rot.offsetZ * 2 - dir.offsetZ);
this.makeExtra(world, x - rot.offsetX * 1 - dir.offsetX, y, z - rot.offsetZ * 1 - dir.offsetZ);
}
}

View File

@ -170,7 +170,6 @@ public class EntityFBI extends EntityMob implements IRangedAttackMob {
canDestroy.add(Blocks.trapdoor);
canDestroy.add(ModBlocks.machine_press);
canDestroy.add(ModBlocks.machine_epress);
canDestroy.add(ModBlocks.dummy_block_assembler);
canDestroy.add(ModBlocks.machine_chemplant);
canDestroy.add(ModBlocks.machine_crystallizer);
canDestroy.add(ModBlocks.machine_turbine);

View File

@ -1128,6 +1128,8 @@ public class MainRegistry {
ignoreMappings.add("hbm:tile.oil_duct");
ignoreMappings.add("hbm:tile.gas_duct_solid");
ignoreMappings.add("hbm:tile.gas_duct");
ignoreMappings.add("hbm:tile.dummy_block_assembler");
ignoreMappings.add("hbm:tile.dummy_port_assembler");
/// REMAP ///
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);

View File

@ -99,7 +99,6 @@ public class NEIConfig implements IConfigureNEI {
API.hideItem(new ItemStack(ModItems.burnt_bark));
API.hideItem(new ItemStack(ModItems.ams_core_thingy));
}
API.hideItem(new ItemStack(ModBlocks.dummy_block_assembler));
API.hideItem(new ItemStack(ModBlocks.dummy_block_drill));
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_base));
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_emitter));
@ -108,7 +107,6 @@ public class NEIConfig implements IConfigureNEI {
API.hideItem(new ItemStack(ModBlocks.dummy_block_blast));
API.hideItem(new ItemStack(ModBlocks.dummy_block_uf6));
API.hideItem(new ItemStack(ModBlocks.dummy_block_puf6));
API.hideItem(new ItemStack(ModBlocks.dummy_port_assembler));
API.hideItem(new ItemStack(ModBlocks.dummy_port_drill));
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_base));
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_emitter));

View File

@ -24,6 +24,7 @@ import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.tileentity.machine.storage.TileEntityCrateBase;
import com.hbm.tileentity.machine.storage.TileEntityCrateIron;
import com.hbm.tileentity.machine.storage.TileEntityCrateSteel;
import com.hbm.util.fauxpointtwelve.DirPos;
import api.hbm.energy.IBatteryItem;
import api.hbm.energy.IEnergyUser;
@ -207,19 +208,19 @@ public class TileEntityMachineAssembler extends TileEntityMachineBase implements
TileEntity te1 = null;
TileEntity te2 = null;
if(meta == 2) {
if(meta == 14) {
te1 = worldObj.getTileEntity(xCoord - 2, yCoord, zCoord);
te2 = worldObj.getTileEntity(xCoord + 3, yCoord, zCoord - 1);
}
if(meta == 3) {
if(meta == 15) {
te1 = worldObj.getTileEntity(xCoord + 2, yCoord, zCoord);
te2 = worldObj.getTileEntity(xCoord - 3, yCoord, zCoord + 1);
}
if(meta == 4) {
if(meta == 13) {
te1 = worldObj.getTileEntity(xCoord, yCoord, zCoord + 2);
te2 = worldObj.getTileEntity(xCoord - 1, yCoord, zCoord - 3);
}
if(meta == 5) {
if(meta == 12) {
te1 = worldObj.getTileEntity(xCoord, yCoord, zCoord - 2);
te2 = worldObj.getTileEntity(xCoord + 1, yCoord, zCoord + 3);
}
@ -284,34 +285,25 @@ public class TileEntityMachineAssembler extends TileEntityMachineBase implements
}
private void updateConnections() {
this.getBlockMetadata();
if(this.blockMetadata == 5) {
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord, Library.NEG_X);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord + 1, Library.NEG_X);
this.trySubscribe(worldObj, xCoord + 3, yCoord, zCoord, Library.POS_X);
this.trySubscribe(worldObj, xCoord + 3, yCoord, zCoord + 1, Library.POS_X);
} else if(this.blockMetadata == 3) {
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 2, Library.NEG_Z);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord - 2, Library.NEG_Z);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 3, Library.POS_Z);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord + 3, Library.POS_Z);
} else if(this.blockMetadata == 4) {
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord, Library.POS_X);
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord - 1, Library.POS_X);
this.trySubscribe(worldObj, xCoord - 3, yCoord, zCoord, Library.NEG_X);
this.trySubscribe(worldObj, xCoord - 3, yCoord, zCoord - 1, Library.NEG_X);
} else if(this.blockMetadata == 2) {
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 2, Library.POS_Z);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord + 2, Library.POS_Z);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 3, Library.NEG_Z);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord - 3, Library.NEG_Z);
for(DirPos pos : getConPos()) {
this.trySubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
}
public DirPos[] getConPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset).getOpposite();
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
return new DirPos[] {
new DirPos(xCoord + rot.offsetX * 3, yCoord, zCoord + rot.offsetZ * 3, rot),
new DirPos(xCoord - rot.offsetX * 2, yCoord, zCoord - rot.offsetZ * 2, rot.getOpposite()),
new DirPos(xCoord + rot.offsetX * 3 + dir.offsetX, yCoord, zCoord + rot.offsetZ * 3 + dir.offsetZ, rot),
new DirPos(xCoord - rot.offsetX * 2 + dir.offsetX, yCoord, zCoord - rot.offsetZ * 2 + dir.offsetZ, rot.getOpposite())
};
}
public void onChunkUnload() {
if(audio != null) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B