Merge remote-tracking branch 'origin/master'

This commit is contained in:
Vaern 2021-12-03 19:42:46 -08:00
commit 8c076968b4
89 changed files with 1265 additions and 665 deletions

View File

@ -1,5 +1,6 @@
package api.hbm.energy;
import com.hbm.blocks.ModBlocks;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
@ -51,15 +52,17 @@ public interface IEnergyConnector {
* @param y
* @param z
*/
public default void trySubscribe(World world, int x, int y, int z) {
public default void trySubscribe(World world, int x, int y, int z, ForgeDirection dir) {
TileEntity te = world.getTileEntity(x, y, z);
boolean red = false;
if(te instanceof IEnergyConductor) {
IEnergyConductor con = (IEnergyConductor) te;
if(!con.canConnect(dir.getOpposite().getOpposite()))
return;
if(con.getPowerNet() != null && !con.getPowerNet().isSubscribed(this))
con.getPowerNet().subscribe(this);
@ -67,11 +70,14 @@ public interface IEnergyConnector {
red = true;
}
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaExt");
data.setString("mode", red ? "reddust" : "bluedust");
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x + world.rand.nextDouble(), y + world.rand.nextDouble(), z + world.rand.nextDouble()), new TargetPoint(world.provider.dimensionId, x + 0.5, y + 0.5, z + 0.5, 25));
if(particleDebug) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaExt");
data.setString("mode", red ? "reddust" : "bluedust");
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x + world.rand.nextDouble(), y + world.rand.nextDouble(), z + world.rand.nextDouble()), new TargetPoint(world.provider.dimensionId, x + 0.5, y + 0.5, z + 0.5, 25));
}
}
public default void tryUnsubscribe(World world, int x, int y, int z) {
TileEntity te = world.getTileEntity(x, y, z);
@ -83,4 +89,6 @@ public interface IEnergyConnector {
con.getPowerNet().unsubscribe(this);
}
}
public static final boolean particleDebug = false;
}

View File

@ -68,7 +68,7 @@ public interface IEnergyUser extends IEnergyConnector {
if(te instanceof IEnergyConnector) {
IEnergyConnector con = (IEnergyConnector) te;
if(con.canConnect(dir)) {
if(con.canConnect(dir.getOpposite())) {
long oldPower = this.getPower();
long transfer = oldPower - con.transferPower(oldPower);
this.setPower(oldPower - transfer);
@ -85,15 +85,17 @@ public interface IEnergyUser extends IEnergyConnector {
}
}
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaExt");
data.setString("mode", red ? "reddust" : "greendust");
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x + world.rand.nextDouble(), y + world.rand.nextDouble(), z + world.rand.nextDouble()), new TargetPoint(world.provider.dimensionId, x + 0.5, y + 0.5, z + 0.5, 25));
if(particleDebug) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaExt");
data.setString("mode", red ? "reddust" : "greendust");
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x + world.rand.nextDouble(), y + world.rand.nextDouble(), z + world.rand.nextDouble()), new TargetPoint(world.provider.dimensionId, x + 0.5, y + 0.5, z + 0.5, 25));
}
}
public default void updateStandardConnections(World world, int x, int y, int z) {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
this.trySubscribe(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir);
}
}

View File

@ -4,8 +4,11 @@ import com.hbm.lib.RefStrings;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
public class BlockBase extends Block {
private boolean beaconable = false;
public BlockBase() {
super(Material.rock);
@ -21,4 +24,14 @@ public class BlockBase extends Block {
this.setBlockTextureName(RefStrings.MODID + ":" + name);
return this;
}
public BlockBase setBeaconable() {
this.beaconable = true;
return this;
}
@Override
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
return this.beaconable;
}
}

View File

@ -0,0 +1,16 @@
package com.hbm.blocks;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
public interface ITooltipProvider {
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext);
public default EnumRarity getRarity(ItemStack stack) {
return EnumRarity.common;
}
}

View File

@ -691,6 +691,7 @@ public class ModBlocks {
public static Block red_wire_coated;
public static Block red_cable;
public static Block red_connector;
public static Block red_pylon;
public static Block cable_switch;
public static Block machine_detector;
@ -1477,7 +1478,7 @@ public class ModBlocks {
lamp_tritium_green_off = new ReinforcedLamp(Material.redstoneLight, false).setBlockName("lamp_tritium_green_off").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lamp_tritium_green_off");
lamp_tritium_green_on = new ReinforcedLamp(Material.redstoneLight, true).setBlockName("lamp_tritium_green_on").setStepSound(Block.soundTypeGlass).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lamp_tritium_green_on");
lamp_tritium_blue_off = new ReinforcedLamp(Material.redstoneLight, false).setBlockName("lamp_tritium_blue_off").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lamp_tritium_blue_off");
lamp_tritium_blue_on = new ReinforcedLamp(Material.redstoneLight, true).setBlockName("lamp_tritium_blue_on").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lamp_tritium_blue_on");
lamp_tritium_blue_on = new ReinforcedLamp(Material.redstoneLight, true).setBlockName("lamp_tritium_blue_on").setStepSound(Block.soundTypeGlass).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lamp_tritium_blue_on");
lamp_uv_off = new UVLamp(false).setBlockName("lamp_uv_off").setCreativeTab(MainRegistry.blockTab);
lamp_uv_on = new UVLamp(true).setBlockName("lamp_uv_on").setCreativeTab(null);
@ -1792,6 +1793,7 @@ public class ModBlocks {
red_wire_coated = new WireCoated(Material.iron).setBlockName("red_wire_coated").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_wire_coated");
red_cable = new BlockCable(Material.iron).setBlockName("red_cable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":cable_neo");
rf_cable = new BlockRFCable(Material.iron).setBlockName("rf_cable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":rf_cable_icon");
red_connector = new ConnectorRedWire(Material.iron).setBlockName("red_connector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_connector");
red_pylon = new PylonRedWire(Material.iron).setBlockName("red_pylon").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_pylon");
cable_switch = new CableSwitch(Material.iron).setBlockName("cable_switch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":cable_switch_off");
machine_detector = new PowerDetector(Material.iron).setBlockName("machine_detector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_detector_off");
@ -2258,9 +2260,9 @@ public class ModBlocks {
GameRegistry.registerBlock(ore_coltan, ore_coltan.getUnlocalizedName());
//Stone clusters
GameRegistry.registerBlock(cluster_iron, ItemBlockCluster.class, cluster_iron.getUnlocalizedName());
GameRegistry.registerBlock(cluster_titanium, ItemBlockCluster.class, cluster_titanium.getUnlocalizedName());
GameRegistry.registerBlock(cluster_aluminium, ItemBlockCluster.class, cluster_aluminium.getUnlocalizedName());
GameRegistry.registerBlock(cluster_iron, ItemBlockBase.class, cluster_iron.getUnlocalizedName());
GameRegistry.registerBlock(cluster_titanium, ItemBlockBase.class, cluster_titanium.getUnlocalizedName());
GameRegistry.registerBlock(cluster_aluminium, ItemBlockBase.class, cluster_aluminium.getUnlocalizedName());
//Bedrock ores
GameRegistry.registerBlock(ore_bedrock_coltan, ore_bedrock_coltan.getUnlocalizedName());
@ -2307,20 +2309,20 @@ public class ModBlocks {
GameRegistry.registerBlock(ore_gneiss_gas, ore_gneiss_gas.getUnlocalizedName());
//Depth ores
GameRegistry.registerBlock(ore_depth_cinnebar, ItemBlockDepth.class, ore_depth_cinnebar.getUnlocalizedName());
GameRegistry.registerBlock(ore_depth_zirconium, ItemBlockDepth.class, ore_depth_zirconium.getUnlocalizedName());
GameRegistry.registerBlock(cluster_depth_iron, ItemBlockDepth.class, cluster_depth_iron.getUnlocalizedName());
GameRegistry.registerBlock(cluster_depth_titanium, ItemBlockDepth.class, cluster_depth_titanium.getUnlocalizedName());
GameRegistry.registerBlock(cluster_depth_tungsten, ItemBlockDepth.class, cluster_depth_tungsten.getUnlocalizedName());
GameRegistry.registerBlock(ore_depth_cinnebar, ItemBlockBase.class, ore_depth_cinnebar.getUnlocalizedName());
GameRegistry.registerBlock(ore_depth_zirconium, ItemBlockBase.class, ore_depth_zirconium.getUnlocalizedName());
GameRegistry.registerBlock(cluster_depth_iron, ItemBlockBase.class, cluster_depth_iron.getUnlocalizedName());
GameRegistry.registerBlock(cluster_depth_titanium, ItemBlockBase.class, cluster_depth_titanium.getUnlocalizedName());
GameRegistry.registerBlock(cluster_depth_tungsten, ItemBlockBase.class, cluster_depth_tungsten.getUnlocalizedName());
//Nether depth ores
GameRegistry.registerBlock(ore_depth_nether_neodymium, ItemBlockDepth.class, ore_depth_nether_neodymium.getUnlocalizedName());
GameRegistry.registerBlock(ore_depth_nether_neodymium, ItemBlockBase.class, ore_depth_nether_neodymium.getUnlocalizedName());
//Basalt ores
GameRegistry.registerBlock(basalt_sulfur, basalt_sulfur.getUnlocalizedName());
GameRegistry.registerBlock(basalt_fluorite, basalt_fluorite.getUnlocalizedName());
GameRegistry.registerBlock(basalt_asbestos, basalt_asbestos.getUnlocalizedName());
GameRegistry.registerBlock(basalt_gem, ItemBlockCluster.class, basalt_gem.getUnlocalizedName());
GameRegistry.registerBlock(basalt_gem, ItemBlockBase.class, basalt_gem.getUnlocalizedName());
//End Ores
GameRegistry.registerBlock(ore_tikite, ore_tikite.getUnlocalizedName());
@ -2337,13 +2339,13 @@ public class ModBlocks {
GameRegistry.registerBlock(gneiss_brick, gneiss_brick.getUnlocalizedName());
GameRegistry.registerBlock(gneiss_tile, gneiss_tile.getUnlocalizedName());
GameRegistry.registerBlock(gneiss_chiseled, gneiss_chiseled.getUnlocalizedName());
GameRegistry.registerBlock(stone_depth, ItemBlockDepth.class, stone_depth.getUnlocalizedName());
GameRegistry.registerBlock(depth_brick, ItemBlockDepth.class, depth_brick.getUnlocalizedName());
GameRegistry.registerBlock(depth_tiles, ItemBlockDepth.class, depth_tiles.getUnlocalizedName());
GameRegistry.registerBlock(stone_depth_nether, ItemBlockDepth.class, stone_depth_nether.getUnlocalizedName());
GameRegistry.registerBlock(depth_nether_brick, ItemBlockDepth.class, depth_nether_brick.getUnlocalizedName());
GameRegistry.registerBlock(depth_nether_tiles, ItemBlockDepth.class, depth_nether_tiles.getUnlocalizedName());
GameRegistry.registerBlock(depth_dnt, ItemBlockDepth.class, depth_dnt.getUnlocalizedName());
GameRegistry.registerBlock(stone_depth, ItemBlockBase.class, stone_depth.getUnlocalizedName());
GameRegistry.registerBlock(depth_brick, ItemBlockBase.class, depth_brick.getUnlocalizedName());
GameRegistry.registerBlock(depth_tiles, ItemBlockBase.class, depth_tiles.getUnlocalizedName());
GameRegistry.registerBlock(stone_depth_nether, ItemBlockBase.class, stone_depth_nether.getUnlocalizedName());
GameRegistry.registerBlock(depth_nether_brick, ItemBlockBase.class, depth_nether_brick.getUnlocalizedName());
GameRegistry.registerBlock(depth_nether_tiles, ItemBlockBase.class, depth_nether_tiles.getUnlocalizedName());
GameRegistry.registerBlock(depth_dnt, ItemBlockBase.class, depth_dnt.getUnlocalizedName());
GameRegistry.registerBlock(basalt, basalt.getUnlocalizedName());
GameRegistry.registerBlock(basalt_smooth, basalt_smooth.getUnlocalizedName());
GameRegistry.registerBlock(basalt_brick, basalt_brick.getUnlocalizedName());
@ -2411,13 +2413,13 @@ public class ModBlocks {
GameRegistry.registerBlock(ancient_scrap, ItemBlockHazard.class, ancient_scrap.getUnlocalizedName());
GameRegistry.registerBlock(block_corium, ItemBlockHazard.class, block_corium.getUnlocalizedName());
GameRegistry.registerBlock(block_corium_cobble, ItemBlockHazard.class, block_corium_cobble.getUnlocalizedName());
GameRegistry.registerBlock(block_schraranium, ItemBlockSchrabidium.class, block_schraranium.getUnlocalizedName());
GameRegistry.registerBlock(block_schrabidium, ItemBlockSchrabidium.class, block_schrabidium.getUnlocalizedName());
GameRegistry.registerBlock(block_schrabidate, ItemBlockSchrabidium.class, block_schrabidate.getUnlocalizedName());
GameRegistry.registerBlock(block_solinium, ItemBlockSchrabidium.class, block_solinium.getUnlocalizedName());
GameRegistry.registerBlock(block_schrabidium_fuel, ItemBlockSchrabidium.class, block_schrabidium_fuel.getUnlocalizedName());
GameRegistry.registerBlock(block_schraranium, ItemBlockBase.class, block_schraranium.getUnlocalizedName());
GameRegistry.registerBlock(block_schrabidium, ItemBlockBase.class, block_schrabidium.getUnlocalizedName());
GameRegistry.registerBlock(block_schrabidate, ItemBlockBase.class, block_schrabidate.getUnlocalizedName());
GameRegistry.registerBlock(block_solinium, ItemBlockBase.class, block_solinium.getUnlocalizedName());
GameRegistry.registerBlock(block_schrabidium_fuel, ItemBlockBase.class, block_schrabidium_fuel.getUnlocalizedName());
GameRegistry.registerBlock(block_euphemium, ItemBlockLore.class, block_euphemium.getUnlocalizedName());
GameRegistry.registerBlock(block_schrabidium_cluster, ItemBlockSchrabidium.class, block_schrabidium_cluster.getUnlocalizedName());
GameRegistry.registerBlock(block_schrabidium_cluster, ItemBlockBase.class, block_schrabidium_cluster.getUnlocalizedName());
GameRegistry.registerBlock(block_euphemium_cluster, ItemBlockLore.class, block_euphemium_cluster.getUnlocalizedName());
GameRegistry.registerBlock(block_dineutronium, block_dineutronium.getUnlocalizedName());
GameRegistry.registerBlock(block_magnetized_tungsten, block_magnetized_tungsten.getUnlocalizedName());
@ -2490,7 +2492,7 @@ public class ModBlocks {
GameRegistry.registerBlock(reinforced_stone, ItemBlockBlastInfo.class, reinforced_stone.getUnlocalizedName());
GameRegistry.registerBlock(reinforced_ducrete, ItemBlockBlastInfo.class, reinforced_ducrete.getUnlocalizedName());
GameRegistry.registerBlock(concrete_smooth, ItemBlockBlastInfo.class, concrete_smooth.getUnlocalizedName());
GameRegistry.registerBlock(concrete_colored, ItemBlockColored.class, concrete_colored.getUnlocalizedName());
GameRegistry.registerBlock(concrete_colored, ItemBlockColoredConcrete.class, concrete_colored.getUnlocalizedName());
GameRegistry.registerBlock(concrete, ItemBlockBlastInfo.class, concrete.getUnlocalizedName());
GameRegistry.registerBlock(concrete_asbestos, ItemBlockBlastInfo.class, concrete_asbestos.getUnlocalizedName());
GameRegistry.registerBlock(ducrete_smooth, ItemBlockBlastInfo.class, ducrete_smooth.getUnlocalizedName());
@ -2571,30 +2573,30 @@ public class ModBlocks {
GameRegistry.registerBlock(steel_beam, steel_beam.getUnlocalizedName());
GameRegistry.registerBlock(steel_scaffold, steel_scaffold.getUnlocalizedName());
GameRegistry.registerBlock(steel_grate, steel_grate.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe, ItemBlockDecoPipe.class, deco_pipe.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rusted, ItemBlockDecoPipe.class, deco_pipe_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_green, ItemBlockDecoPipe.class, deco_pipe_green.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_green_rusted, ItemBlockDecoPipe.class, deco_pipe_green_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_red, ItemBlockDecoPipe.class, deco_pipe_red.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_marked, ItemBlockDecoPipe.class, deco_pipe_marked.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rim, ItemBlockDecoPipe.class, deco_pipe_rim.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rim_rusted, ItemBlockDecoPipe.class, deco_pipe_rim_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rim_green, ItemBlockDecoPipe.class, deco_pipe_rim_green.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rim_green_rusted, ItemBlockDecoPipe.class, deco_pipe_rim_green_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rim_red, ItemBlockDecoPipe.class, deco_pipe_rim_red.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rim_marked, ItemBlockDecoPipe.class, deco_pipe_rim_marked.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_framed, ItemBlockDecoPipe.class, deco_pipe_framed.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_framed_rusted, ItemBlockDecoPipe.class, deco_pipe_framed_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_framed_green, ItemBlockDecoPipe.class, deco_pipe_framed_green.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_framed_green_rusted, ItemBlockDecoPipe.class, deco_pipe_framed_green_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_framed_red, ItemBlockDecoPipe.class, deco_pipe_framed_red.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_framed_marked, ItemBlockDecoPipe.class, deco_pipe_framed_marked.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_quad, ItemBlockDecoPipe.class, deco_pipe_quad.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_quad_rusted, ItemBlockDecoPipe.class, deco_pipe_quad_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_quad_green, ItemBlockDecoPipe.class, deco_pipe_quad_green.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_quad_green_rusted, ItemBlockDecoPipe.class, deco_pipe_quad_green_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_quad_red, ItemBlockDecoPipe.class, deco_pipe_quad_red.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_quad_marked, ItemBlockDecoPipe.class, deco_pipe_quad_marked.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe, ItemBlockBase.class, deco_pipe.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rusted, ItemBlockBase.class, deco_pipe_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_green, ItemBlockBase.class, deco_pipe_green.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_green_rusted, ItemBlockBase.class, deco_pipe_green_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_red, ItemBlockBase.class, deco_pipe_red.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_marked, ItemBlockBase.class, deco_pipe_marked.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rim, ItemBlockBase.class, deco_pipe_rim.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rim_rusted, ItemBlockBase.class, deco_pipe_rim_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rim_green, ItemBlockBase.class, deco_pipe_rim_green.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rim_green_rusted, ItemBlockBase.class, deco_pipe_rim_green_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rim_red, ItemBlockBase.class, deco_pipe_rim_red.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rim_marked, ItemBlockBase.class, deco_pipe_rim_marked.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_framed, ItemBlockBase.class, deco_pipe_framed.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_framed_rusted, ItemBlockBase.class, deco_pipe_framed_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_framed_green, ItemBlockBase.class, deco_pipe_framed_green.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_framed_green_rusted, ItemBlockBase.class, deco_pipe_framed_green_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_framed_red, ItemBlockBase.class, deco_pipe_framed_red.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_framed_marked, ItemBlockBase.class, deco_pipe_framed_marked.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_quad, ItemBlockBase.class, deco_pipe_quad.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_quad_rusted, ItemBlockBase.class, deco_pipe_quad_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_quad_green, ItemBlockBase.class, deco_pipe_quad_green.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_quad_green_rusted, ItemBlockBase.class, deco_pipe_quad_green_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_quad_red, ItemBlockBase.class, deco_pipe_quad_red.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_quad_marked, ItemBlockBase.class, deco_pipe_quad_marked.getUnlocalizedName());
GameRegistry.registerBlock(mush, mush.getUnlocalizedName());
GameRegistry.registerBlock(mush_block, mush_block.getUnlocalizedName());
GameRegistry.registerBlock(mush_block_stem, mush_block_stem.getUnlocalizedName());
@ -2768,16 +2770,16 @@ public class ModBlocks {
GameRegistry.registerBlock(bomber, bomber.getUnlocalizedName());
//Machines
GameRegistry.registerBlock(anvil_iron, ItemBlockAnvil.class, anvil_iron.getUnlocalizedName());
GameRegistry.registerBlock(anvil_lead, ItemBlockAnvil.class, anvil_lead.getUnlocalizedName());
GameRegistry.registerBlock(anvil_steel, ItemBlockAnvil.class, anvil_steel.getUnlocalizedName());
GameRegistry.registerBlock(anvil_meteorite, ItemBlockAnvil.class, anvil_meteorite.getUnlocalizedName());
GameRegistry.registerBlock(anvil_starmetal, ItemBlockAnvil.class, anvil_starmetal.getUnlocalizedName());
GameRegistry.registerBlock(anvil_ferrouranium, ItemBlockAnvil.class, anvil_ferrouranium.getUnlocalizedName());
GameRegistry.registerBlock(anvil_bismuth, ItemBlockAnvil.class, anvil_bismuth.getUnlocalizedName());
GameRegistry.registerBlock(anvil_schrabidate, ItemBlockAnvil.class, anvil_schrabidate.getUnlocalizedName());
GameRegistry.registerBlock(anvil_dnt, ItemBlockAnvil.class, anvil_dnt.getUnlocalizedName());
GameRegistry.registerBlock(anvil_murky, ItemBlockAnvil.class, anvil_murky.getUnlocalizedName());
GameRegistry.registerBlock(anvil_iron, ItemBlockBase.class, anvil_iron.getUnlocalizedName());
GameRegistry.registerBlock(anvil_lead, ItemBlockBase.class, anvil_lead.getUnlocalizedName());
GameRegistry.registerBlock(anvil_steel, ItemBlockBase.class, anvil_steel.getUnlocalizedName());
GameRegistry.registerBlock(anvil_meteorite, ItemBlockBase.class, anvil_meteorite.getUnlocalizedName());
GameRegistry.registerBlock(anvil_starmetal, ItemBlockBase.class, anvil_starmetal.getUnlocalizedName());
GameRegistry.registerBlock(anvil_ferrouranium, ItemBlockBase.class, anvil_ferrouranium.getUnlocalizedName());
GameRegistry.registerBlock(anvil_bismuth, ItemBlockBase.class, anvil_bismuth.getUnlocalizedName());
GameRegistry.registerBlock(anvil_schrabidate, ItemBlockBase.class, anvil_schrabidate.getUnlocalizedName());
GameRegistry.registerBlock(anvil_dnt, ItemBlockBase.class, anvil_dnt.getUnlocalizedName());
GameRegistry.registerBlock(anvil_murky, ItemBlockBase.class, anvil_murky.getUnlocalizedName());
GameRegistry.registerBlock(machine_press, machine_press.getUnlocalizedName());
GameRegistry.registerBlock(machine_epress, machine_epress.getUnlocalizedName());
@ -2825,15 +2827,15 @@ public class ModBlocks {
GameRegistry.registerBlock(hadron_plating_striped, hadron_plating_striped.getUnlocalizedName());
GameRegistry.registerBlock(hadron_plating_glass, hadron_plating_glass.getUnlocalizedName());
GameRegistry.registerBlock(hadron_plating_voltz, hadron_plating_voltz.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_alloy, ItemHadronCoil.class, hadron_coil_alloy.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_gold, ItemHadronCoil.class, hadron_coil_gold.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_neodymium, ItemHadronCoil.class, hadron_coil_neodymium.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_magtung, ItemHadronCoil.class, hadron_coil_magtung.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_schrabidium, ItemHadronCoil.class, hadron_coil_schrabidium.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_schrabidate, ItemHadronCoil.class, hadron_coil_schrabidate.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_starmetal, ItemHadronCoil.class, hadron_coil_starmetal.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_chlorophyte, ItemHadronCoil.class, hadron_coil_chlorophyte.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_mese, ItemHadronCoil.class, hadron_coil_mese.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_alloy, ItemBlockBase.class, hadron_coil_alloy.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_gold, ItemBlockBase.class, hadron_coil_gold.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_neodymium, ItemBlockBase.class, hadron_coil_neodymium.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_magtung, ItemBlockBase.class, hadron_coil_magtung.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_schrabidium, ItemBlockBase.class, hadron_coil_schrabidium.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_schrabidate, ItemBlockBase.class, hadron_coil_schrabidate.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_starmetal, ItemBlockBase.class, hadron_coil_starmetal.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_chlorophyte, ItemBlockBase.class, hadron_coil_chlorophyte.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_mese, ItemBlockBase.class, hadron_coil_mese.getUnlocalizedName());
GameRegistry.registerBlock(hadron_power, hadron_power.getUnlocalizedName());
GameRegistry.registerBlock(hadron_power_10m, hadron_power_10m.getUnlocalizedName());
GameRegistry.registerBlock(hadron_power_100m, hadron_power_100m.getUnlocalizedName());
@ -2872,7 +2874,8 @@ public class ModBlocks {
GameRegistry.registerBlock(red_cable, red_cable.getUnlocalizedName());
GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
GameRegistry.registerBlock(red_pylon, red_pylon.getUnlocalizedName());
GameRegistry.registerBlock(red_connector, ItemBlockBase.class, red_connector.getUnlocalizedName());
GameRegistry.registerBlock(red_pylon, ItemBlockBase.class, red_pylon.getUnlocalizedName());
GameRegistry.registerBlock(cable_switch, cable_switch.getUnlocalizedName());
GameRegistry.registerBlock(machine_detector, machine_detector.getUnlocalizedName());
GameRegistry.registerBlock(rf_cable, rf_cable.getUnlocalizedName());

View File

@ -1,9 +1,12 @@
package com.hbm.blocks.generic;
import java.util.List;
import java.util.Random;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems;
import com.hbm.util.I18nUtil;
import api.hbm.block.IDrillInteraction;
import api.hbm.block.IMiningDrill;
@ -13,10 +16,11 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer;
public class BlockCluster extends Block implements IDrillInteraction {
public class BlockCluster extends Block implements IDrillInteraction, ITooltipProvider {
public BlockCluster(Material mat) {
super(mat);
@ -80,4 +84,9 @@ public class BlockCluster extends Block implements IDrillInteraction {
public float getRelativeHardness(World world, int x, int y, int z, int meta, IMiningDrill drill) {
return this.getBlockHardness(world, x, y, z);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("trait.tile.cluster"));
}
}

View File

@ -1,12 +1,19 @@
package com.hbm.blocks.generic;
import java.util.List;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.util.I18nUtil;
import api.hbm.item.IDepthRockTool;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
public class BlockDepth extends Block {
public class BlockDepth extends Block implements ITooltipProvider {
public BlockDepth() {
super(Material.rock);
@ -25,4 +32,9 @@ public class BlockDepth extends Block {
return super.getPlayerRelativeBlockHardness(player, world, x, y, z);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("trait.tile.depth"));
}
}

View File

@ -1,12 +1,13 @@
package com.hbm.blocks.generic;
import com.hbm.blocks.BlockBase;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class BlockGeneric extends Block {
public class BlockGeneric extends BlockBase {
public BlockGeneric(Material material) {
super(material);
}
}

View File

@ -1,7 +1,10 @@
package com.hbm.blocks.generic;
import java.util.List;
import java.util.Random;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.radiation.ChunkRadiationManager;
import com.hbm.interfaces.IItemHazard;
import com.hbm.main.MainRegistry;
@ -11,12 +14,15 @@ 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.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class BlockHazard extends Block implements IItemHazard {
public class BlockHazard extends Block implements IItemHazard, ITooltipProvider {
ItemHazardModule module;
@ -160,4 +166,20 @@ public class BlockHazard extends Block implements IItemHazard {
FLAMES,
LAVAPOP
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { }
@Override
public EnumRarity getRarity(ItemStack stack) {
if(this == ModBlocks.block_schraranium
|| this == ModBlocks.block_schraranium
|| this == ModBlocks.block_schrabidate
|| this == ModBlocks.block_solinium
|| this == ModBlocks.block_schrabidium_fuel)
return EnumRarity.rare;
return EnumRarity.common;
}
}

View File

@ -1,5 +1,8 @@
package com.hbm.blocks.generic;
import java.util.List;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.client.registry.RenderingRegistry;
@ -8,10 +11,12 @@ 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.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class BlockPipe extends Block {
public class BlockPipe extends Block implements ITooltipProvider {
@SideOnly(Side.CLIENT)
private IIcon sideIcon;
@ -82,4 +87,9 @@ public class BlockPipe extends Block {
return j1 | b0;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
list.add("Purely decorative");
}
}

View File

@ -1,13 +1,21 @@
package com.hbm.blocks.generic;
import java.util.List;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.blocks.ModBlocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockRotatedPillar;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class BlockRotatablePillar extends BlockRotatedPillar {
public class BlockRotatablePillar extends BlockRotatedPillar implements ITooltipProvider {
@SideOnly(Side.CLIENT)
protected IIcon iconSide;
@ -31,4 +39,15 @@ public class BlockRotatablePillar extends BlockRotatedPillar {
return iconSide;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { }
@Override
public EnumRarity getRarity(ItemStack stack) {
if(this == ModBlocks.block_schrabidium_cluster)
return EnumRarity.rare;
return EnumRarity.common;
}
}

View File

@ -1,18 +1,24 @@
package com.hbm.blocks.machine;
import java.util.List;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.render.block.ct.CT;
import com.hbm.render.block.ct.CTStitchReceiver;
import com.hbm.render.block.ct.IBlockCT;
import com.hbm.util.I18nUtil;
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.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
public class BlockHadronCoil extends Block implements IBlockCT {
public class BlockHadronCoil extends Block implements IBlockCT, ITooltipProvider {
public int factor;
@ -44,4 +50,9 @@ public class BlockHadronCoil extends Block implements IBlockCT {
public boolean canConnect(IBlockAccess world, int x, int y, int z, IBlockCT block) {
return block instanceof BlockHadronCoil;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
list.add(I18nUtil.resolveKey("info.coil") + ": " + factor);
}
}

View File

@ -1,5 +1,8 @@
package com.hbm.blocks.machine;
import java.util.List;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.blocks.ModBlocks;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
@ -16,12 +19,13 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class NTMAnvil extends BlockFalling {
public class NTMAnvil extends BlockFalling implements ITooltipProvider {
public final int tier;
@ -130,4 +134,9 @@ public class NTMAnvil extends BlockFalling {
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
list.add(EnumChatFormatting.GOLD + "Tier " + tier + " Anvil");
}
}

View File

@ -1,15 +1,11 @@
package com.hbm.blocks.network;
import java.util.List;
import com.hbm.blocks.test.TestConductor;
import com.hbm.lib.Library;
import com.hbm.tileentity.network.TileEntityCableBaseNT;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
@ -44,12 +40,12 @@ public class BlockCable extends BlockContainer {
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
boolean posX = Library.canConnect(world, x + 1, y, z, Library.POS_X);
boolean negX = Library.canConnect(world, x - 1, y, z, Library.NEG_X);
boolean posY = Library.canConnect(world, x, y + 1, z, Library.POS_Y);
boolean negY = Library.canConnect(world, x, y - 1, z, Library.NEG_Y);
boolean posZ = Library.canConnect(world, x, y, z + 1, Library.POS_Z);
boolean negZ = Library.canConnect(world, x, y, z - 1, Library.NEG_Z);
boolean posX = Library.canConnect(world, x + 1, y, z, Library.NEG_X);
boolean negX = Library.canConnect(world, x - 1, y, z, Library.POS_X);
boolean posY = Library.canConnect(world, x, y + 1, z, Library.NEG_Y);
boolean negY = Library.canConnect(world, x, y - 1, z, Library.POS_Y);
boolean posZ = Library.canConnect(world, x, y, z + 1, Library.NEG_Z);
boolean negZ = Library.canConnect(world, x, y, z - 1, Library.POS_Z);
setBlockBounds(posX, negX, posY, negY, posZ, negZ);
@ -59,12 +55,12 @@ public class BlockCable extends BlockContainer {
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
boolean posX = Library.canConnect(world, x + 1, y, z, Library.POS_X);
boolean negX = Library.canConnect(world, x - 1, y, z, Library.NEG_X);
boolean posY = Library.canConnect(world, x, y + 1, z, Library.POS_Y);
boolean negY = Library.canConnect(world, x, y - 1, z, Library.NEG_Y);
boolean posZ = Library.canConnect(world, x, y, z + 1, Library.POS_Z);
boolean negZ = Library.canConnect(world, x, y, z - 1, Library.NEG_Z);
boolean posX = Library.canConnect(world, x + 1, y, z, Library.NEG_X);
boolean negX = Library.canConnect(world, x - 1, y, z, Library.POS_X);
boolean posY = Library.canConnect(world, x, y + 1, z, Library.NEG_Y);
boolean negY = Library.canConnect(world, x, y - 1, z, Library.POS_Y);
boolean posZ = Library.canConnect(world, x, y, z + 1, Library.NEG_Z);
boolean negZ = Library.canConnect(world, x, y, z - 1, Library.POS_Z);
setBlockBounds(posX, negX, posY, negY, posZ, negZ);
}

View File

@ -0,0 +1,68 @@
package com.hbm.blocks.network;
import java.util.List;
import com.hbm.lib.Library;
import com.hbm.tileentity.network.TileEntityConnector;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class ConnectorRedWire extends PylonBase {
public ConnectorRedWire(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityConnector();
}
@Override
public int onBlockPlaced(World world, int x, int y, int z, int side, float fX, float fY, float fZ, int meta) {
return side;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
setBlockBounds(world.getBlockMetadata(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) {
setBlockBounds(world.getBlockMetadata(x, y, z));
}
private void setBlockBounds(int meta) {
float pixel = 0.0625F;
float min = pixel * 5F;
float max = pixel * 11F;
ForgeDirection dir = ForgeDirection.getOrientation(meta).getOpposite();
float minX = dir == Library.NEG_X ? 0F : min;
float maxX = dir == Library.POS_X ? 1F : max;
float minY = dir == Library.NEG_Y ? 0F : min;
float maxY = dir == Library.POS_Y ? 1F : max;
float minZ = dir == Library.NEG_Z ? 0F : min;
float maxZ = dir == Library.POS_Z ? 1F : max;
this.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
list.add(EnumChatFormatting.GOLD + "Connection Type: " + EnumChatFormatting.YELLOW + "Single");
list.add(EnumChatFormatting.GOLD + "Connection Range: " + EnumChatFormatting.YELLOW + "10m");
}
}

View File

@ -1,5 +1,6 @@
package com.hbm.blocks.network;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.tileentity.network.TileEntityPylonBase;
import net.minecraft.block.Block;
@ -8,7 +9,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public abstract class PylonBase extends BlockContainer {
public abstract class PylonBase extends BlockContainer implements ITooltipProvider {
protected PylonBase(Material p_i45386_1_) {
super(p_i45386_1_);

View File

@ -1,20 +1,31 @@
package com.hbm.blocks.network;
import java.util.List;
import com.hbm.tileentity.network.TileEntityPylon;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
public class PylonRedWire extends PylonBase {
public PylonRedWire(Material p_i45386_1_) {
super(p_i45386_1_);
public PylonRedWire(Material material) {
super(material);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityPylon();
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
list.add(EnumChatFormatting.GOLD + "Connection Type: " + EnumChatFormatting.YELLOW + "Single");
list.add(EnumChatFormatting.GOLD + "Connection Range: " + EnumChatFormatting.YELLOW + "25m");
}
}

View File

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.List;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.explosion.ExplosionNT;
import com.hbm.explosion.ExplosionNT.ExAttrib;
import com.hbm.items.ModItems;
import api.hbm.entity.IRadarDetectable.RadarTargetType;
@ -24,11 +26,13 @@ public class EntityMissileDrill extends EntityMissileBaseAdvanced {
public void onImpact() {
for(int i = 0; i < 30; i++)
{
this.worldObj.createExplosion(this, this.posX, this.posY - i, this.posZ, 10F, true);
ExplosionNT explosion = new ExplosionNT(worldObj, this, this.posX, this.posY - i, this.posZ, 10F);
explosion.addAllAttrib(ExAttrib.ERRODE);
explosion.explode(); //an explosion exploded!
}
ExplosionLarge.spawnParticles(worldObj, this.posX, this.posY, this.posZ, 25);
ExplosionLarge.spawnShrapnels(worldObj, this.posX, this.posY, this.posZ, 12);
ExplosionLarge.spawnRubble(worldObj, this.posX, this.posY, this.posZ, 12);
ExplosionLarge.jolt(worldObj, this.posX, this.posY, this.posZ, 10, 50, 1);
}
@Override

View File

@ -202,8 +202,7 @@ public class EntityBulletBase extends Entity implements IProjectile {
return;
}
if(this.config.blackPowder) {
this.setDead();
if(this.config.blackPowder && this.ticksExisted == 1) {
for(int i = 0; i < 15; i++) {
double mod = rand.nextDouble();
@ -215,7 +214,6 @@ public class EntityBulletBase extends Entity implements IProjectile {
double mod = 0.5;
this.worldObj.spawnParticle("flame", this.posX + this.motionX * mod, this.posY + this.motionY * mod, this.posZ + this.motionZ * mod, 0, 0, 0);
return;
}
if(config.maxAge == 0) {

View File

@ -33,7 +33,7 @@ public class ExplosionNT extends Explosion {
private Random explosionRNG = new Random();
private World worldObj;
protected int field_77289_h = 16;
protected int resolution = 16;
protected Map affectedEntities = new HashMap();
public static final List<ExAttrib> nukeAttribs = Arrays.asList(new ExAttrib[] { ExAttrib.FIRE, ExAttrib.NOPARTICLE, ExAttrib.NOSOUND, ExAttrib.NODROP, ExAttrib.NOHURT });
@ -53,8 +53,13 @@ public class ExplosionNT extends Explosion {
return this;
}
public ExplosionNT addAllAttrib(ExAttrib... attrib) {
for(ExAttrib a : attrib) atttributes.add(a);
return this;
}
public ExplosionNT overrideResolution(int res) {
field_77289_h = res;
resolution = res;
return this;
}
@ -69,44 +74,51 @@ public class ExplosionNT extends Explosion {
int i;
int j;
int k;
double d5;
double d6;
double d7;
double currentX;
double currentY;
double currentZ;
for(i = 0; i < this.field_77289_h; ++i) {
for(j = 0; j < this.field_77289_h; ++j) {
for(k = 0; k < this.field_77289_h; ++k) {
if(i == 0 || i == this.field_77289_h - 1 || j == 0 || j == this.field_77289_h - 1 || k == 0 || k == this.field_77289_h - 1) {
double d0 = (double) ((float) i / ((float) this.field_77289_h - 1.0F) * 2.0F - 1.0F);
double d1 = (double) ((float) j / ((float) this.field_77289_h - 1.0F) * 2.0F - 1.0F);
double d2 = (double) ((float) k / ((float) this.field_77289_h - 1.0F) * 2.0F - 1.0F);
double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
d0 /= d3;
d1 /= d3;
d2 /= d3;
float f1 = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F);
d5 = this.explosionX;
d6 = this.explosionY;
d7 = this.explosionZ;
for(i = 0; i < this.resolution; ++i) {
for(j = 0; j < this.resolution; ++j) {
for(k = 0; k < this.resolution; ++k) {
if(i == 0 || i == this.resolution - 1 || j == 0 || j == this.resolution - 1 || k == 0 || k == this.resolution - 1) {
double d0 = (double) ((float) i / ((float) this.resolution - 1.0F) * 2.0F - 1.0F);
double d1 = (double) ((float) j / ((float) this.resolution - 1.0F) * 2.0F - 1.0F);
double d2 = (double) ((float) k / ((float) this.resolution - 1.0F) * 2.0F - 1.0F);
double dist = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
d0 /= dist;
d1 /= dist;
d2 /= dist;
float remainingPower = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F);
currentX = this.explosionX;
currentY = this.explosionY;
currentZ = this.explosionZ;
for(float f2 = 0.3F; f1 > 0.0F; f1 -= f2 * 0.75F) {
int j1 = MathHelper.floor_double(d5);
int k1 = MathHelper.floor_double(d6);
int l1 = MathHelper.floor_double(d7);
Block block = this.worldObj.getBlock(j1, k1, l1);
for(float step = 0.3F; remainingPower > 0.0F; remainingPower -= step * 0.75F) {
int xPos = MathHelper.floor_double(currentX);
int yPos = MathHelper.floor_double(currentY);
int zPos = MathHelper.floor_double(currentZ);
Block block = this.worldObj.getBlock(xPos, yPos, zPos);
if(block.getMaterial() != Material.air) {
float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) : block.getExplosionResistance(this.exploder, worldObj, j1, k1, l1, explosionX, explosionY, explosionZ);
f1 -= (f3 + 0.3F) * f2;
float resistance = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, xPos, yPos, zPos, block) : block.getExplosionResistance(this.exploder, worldObj, xPos, yPos, zPos, explosionX, explosionY, explosionZ);
remainingPower -= (resistance + 0.3F) * step;
}
if(block != Blocks.air && f1 > 0.0F && (this.exploder == null || this.exploder.func_145774_a(this, this.worldObj, j1, k1, l1, block, f1))) {
hashset.add(new ChunkPosition(j1, k1, l1));
if(block != Blocks.air && remainingPower > 0.0F && (this.exploder == null || this.exploder.func_145774_a(this, this.worldObj, xPos, yPos, zPos, block, remainingPower))) {
hashset.add(new ChunkPosition(xPos, yPos, zPos));
} else if(this.has(ExAttrib.ERRODE) && errosion.containsKey(block)) {
hashset.add(new ChunkPosition(xPos, yPos, zPos));
}
d5 += d0 * (double) f2;
d6 += d1 * (double) f2;
d7 += d2 * (double) f2;
currentX += d0 * (double) step;
currentY += d1 * (double) step;
currentZ += d2 * (double) step;
}
}
}
@ -133,25 +145,25 @@ public class ExplosionNT extends Explosion {
double d4 = entity.getDistance(this.explosionX, this.explosionY, this.explosionZ) / (double) this.explosionSize;
if(d4 <= 1.0D) {
d5 = entity.posX - this.explosionX;
d6 = entity.posY + (double) entity.getEyeHeight() - this.explosionY;
d7 = entity.posZ - this.explosionZ;
double d9 = (double) MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7);
currentX = entity.posX - this.explosionX;
currentY = entity.posY + (double) entity.getEyeHeight() - this.explosionY;
currentZ = entity.posZ - this.explosionZ;
double d9 = (double) MathHelper.sqrt_double(currentX * currentX + currentY * currentY + currentZ * currentZ);
if(d9 != 0.0D) {
d5 /= d9;
d6 /= d9;
d7 /= d9;
currentX /= d9;
currentY /= d9;
currentZ /= d9;
double d10 = (double) this.worldObj.getBlockDensity(vec3, entity.boundingBox);
double d11 = (1.0D - d4) * d10;
entity.attackEntityFrom(DamageSource.setExplosionSource(this), (float) ((int) ((d11 * d11 + d11) / 2.0D * 8.0D * (double) this.explosionSize + 1.0D)));
double d8 = EnchantmentProtection.func_92092_a(entity, d11);
entity.motionX += d5 * d8;
entity.motionY += d6 * d8;
entity.motionZ += d7 * d8;
entity.motionX += currentX * d8;
entity.motionY += currentY * d8;
entity.motionZ += currentZ * d8;
if(entity instanceof EntityPlayer) {
this.affectedEntities.put((EntityPlayer) entity, Vec3.createVectorHelper(d5 * d11, d6 * d11, d7 * d11));
this.affectedEntities.put((EntityPlayer) entity, Vec3.createVectorHelper(currentX * d11, currentY * d11, currentZ * d11));
}
}
}
@ -212,7 +224,19 @@ public class ExplosionNT extends Explosion {
}
if(block.getMaterial() != Material.air) {
if(block.canDropFromExplosion(this) && !has(ExAttrib.NODROP)) {
boolean doesErrode = false;
Block errodesInto = Blocks.air;
if(this.has(ExAttrib.ERRODE) && this.explosionRNG.nextFloat() < 0.6F) { //errosion has a 60% chance to occour
if(errosion.containsKey(block)) {
doesErrode = true;
errodesInto = errosion.get(block);
}
}
if(block.canDropFromExplosion(this) && !has(ExAttrib.NODROP) && !doesErrode) {
float chance = 1.0F;
if(!has(ExAttrib.ALLDROP))
@ -225,6 +249,10 @@ public class ExplosionNT extends Explosion {
if(block.isNormalCube()) {
if(doesErrode) {
this.worldObj.setBlock(i, j, k, errodesInto);
}
if(has(ExAttrib.DIGAMMA)) {
this.worldObj.setBlock(i, j, k, ModBlocks.ash_digamma);
@ -300,6 +328,7 @@ public class ExplosionNT extends Explosion {
DIGAMMA_CIRCUIT,
LAVA, //again the same thing but lava
LAVA_V, //again the same thing but volcaniclava
ERRODE, //will turn select blocks into gravel or sand
ALLMOD, //block placer attributes like fire are applied for all destroyed blocks
ALLDROP, //miner TNT!
NODROP, //the opposite
@ -307,5 +336,14 @@ public class ExplosionNT extends Explosion {
NOSOUND,
NOHURT
}
public static final HashMap<Block, Block> errosion = new HashMap();
static {
errosion.put(ModBlocks.concrete, Blocks.gravel);
errosion.put(ModBlocks.concrete_smooth, Blocks.gravel);
errosion.put(ModBlocks.brick_concrete, ModBlocks.brick_concrete_broken);
errosion.put(ModBlocks.brick_concrete_broken, Blocks.gravel);
}
}

View File

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.hbm.interfaces.Untested;
import net.minecraft.init.Blocks;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
@ -25,6 +27,8 @@ public class ExplosionNukeRay {
int startCir;
public boolean isAusf3Complete = false;
private double overrideRange = 0;
public ExplosionNukeRay(World world, int x, int y, int z, int strength, int count, int speed, int length) {
this.world = world;
this.posX = x;
@ -39,6 +43,9 @@ public class ExplosionNukeRay {
//Mk 4.5, must be int32
this.startY = 0;
this.startCir = 0;
//starts at around 80, becomes 8 at length 500
this.overrideRange = Math.max((Math.log(length) * 4 - 2.5D) * 10, 0);
}
/*public void processBunch(int count) {
@ -147,6 +154,7 @@ public class ExplosionNukeRay {
processed += count;
}
@Untested //override range
public void collectTip(int count) {
for(int k = 0; k < count; k++) {
@ -177,12 +185,22 @@ public class ExplosionNukeRay {
res -= Math.pow(world.getBlock((int)x0, (int)y0, (int)z0).getExplosionResistance(null), 1.25);
else
res -= Math.pow(Blocks.air.getExplosionResistance(null), 1.25);
/*
* Blast resistance calculations are still done to preserve the general shape,
* but if the blast were to be stopped within this range we go through with it anyway.
* There is currently no blast resistance limit on this, could change in the future.
*/
boolean inOverrideRange = this.overrideRange >= length;
if(res > 0 && world.getBlock((int)x0, (int)y0, (int)z0) != Blocks.air) {
if((res > 0 || inOverrideRange) && world.getBlock((int)x0, (int)y0, (int)z0) != Blocks.air) {
lastPos = new FloatTriplet(x0, y0, z0);
}
if(res <= 0 || i + 1 >= this.length) {
/*
* Only stop if we are either out of range or if the remaining strength is 0 while being outside the override range
*/
if((res <= 0 && !inOverrideRange) || i + 1 >= this.length) {
if(affectedBlocks.size() < Integer.MAX_VALUE - 100 && lastPos != null)
affectedBlocks.add(new FloatTriplet(lastPos.xCoord, lastPos.yCoord, lastPos.zCoord));
break;

View File

@ -1,22 +1,17 @@
package com.hbm.handler;
import java.util.Collection;
import java.util.List;
import java.util.Map.Entry;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.main.ModEventHandler;
import com.hbm.saveddata.TomSaveData;
import com.hbm.world.WorldProviderNTM;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.block.BlockLeaves;
import net.minecraft.block.BlockLog;
import net.minecraft.block.BlockVine;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.EnumSkyBlock;
@ -39,8 +34,6 @@ public class ImpactWorldHandler {
WorldServer serv = (WorldServer) world;
ChunkProviderServer provider = (ChunkProviderServer) serv.getChunkProvider();
Random rand = new Random();
List<Chunk> list = serv.theChunkProviderServer.loadedChunks;
int listSize = list.size();
@ -56,9 +49,10 @@ public class ImpactWorldHandler {
int X = coord.getCenterXPos() - 8 + x;
int Z = coord.getCenterZPosition() - 8 + z;
int Y = world.getHeightValue(X, Z) - world.rand.nextInt(Math.max(1, world.getHeightValue(X, Z)));
int Y2 = world.getHeightValue(X, Z) - world.rand.nextInt(2);
die(world, X, Y, Z);
if(TomSaveData.dust > 0) {
die(world, X, Y, Z);
}
if(TomSaveData.fire > 0 || ModEventHandler.fire > 0) {
burn(world, X, Y, Z);
}
@ -73,21 +67,16 @@ public class ImpactWorldHandler {
int light = Math.max(world.getSavedLightValue(EnumSkyBlock.Block, x, y + 1, z), (int) (world.getBlockLightValue(x, y + 1, z) * (1 - ModEventHandler.dust)));
if(world.getBlock(x, y, z) == Blocks.grass) {
if(light < 4)
if(light < 4) {
if(world.getBlock(x, y, z) == Blocks.grass) {
world.setBlock(x, y, z, Blocks.dirt);
} else if(world.getBlock(x, y, z) instanceof BlockBush) {
if(light < 4)
} else if(world.getBlock(x, y, z) instanceof BlockBush) {
world.setBlock(x, y, z, Blocks.air);
} else if(world.getBlock(x, y, z) instanceof BlockLeaves) {
if(light < 4)
} else if(world.getBlock(x, y, z) instanceof BlockLeaves) {
world.setBlock(x, y, z, Blocks.air);
} else if(world.getBlock(x, y, z) instanceof BlockVine) {
if(light < 4)
} else if(world.getBlock(x, y, z) instanceof BlockVine) {
world.setBlock(x, y, z, Blocks.air);
}
}
}

View File

@ -19,7 +19,9 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityMagmaCube;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@ -287,6 +289,10 @@ public abstract class WeaponAbility {
living.entityDropItem(new ItemStack(Items.skull, 1, 2), 0.0F);
} else if(living instanceof EntityCreeper) {
living.entityDropItem(new ItemStack(Items.skull, 1, 4), 0.0F);
} else if(living instanceof EntityMagmaCube) {
living.entityDropItem(new ItemStack(Items.magma_cream, 3), 0.0F);
} else if(living instanceof EntitySlime) {
living.entityDropItem(new ItemStack(Items.slime_ball, 3), 0.0F);
} else if(living instanceof EntityPlayer) {
ItemStack head = new ItemStack(Items.skull, 1, 3);

View File

@ -1,15 +1,23 @@
package com.hbm.inventory.gui;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map.Entry;
import org.lwjgl.opengl.GL11;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.container.ContainerMachineDiesel;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.TileEntityMachineDiesel;
import com.hbm.util.I18nUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
public class GUIMachineDiesel extends GuiInfoContainer {
@ -32,20 +40,17 @@ public class GUIMachineDiesel extends GuiInfoContainer {
diFurnace.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 69 - 52, 16, 52);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 69 - 52, 16, 52, diFurnace.power, diFurnace.powerCap);
String[] text = new String[] { "Accepted Fuels:",
" Diesel (500 HE/t)",
" Petroil (300 HE/t)",
" Biofuel (400 HE/t)",
" Ethanol (200 HE/t)",
" LPG (450 HE/t)",
" Hydrogen (10 HE/t)",
" Leaded Gasoline (1500 HE/t)",
" NITAN Superfuel (5000 HE/t)" };
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, text);
List<String> text = new ArrayList();
text.add(EnumChatFormatting.YELLOW + "Accepted Fuels:");
for(Entry<FluidType, Integer> entry : TileEntityMachineDiesel.fuels.entrySet()) {
text.add(" " + I18nUtil.resolveKey(entry.getKey().getUnlocalizedName()) + " (" + entry.getValue() + " HE/t)");
}
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, text.toArray(new String[0]));
String[] text1 = new String[] { "Fuel consumption rate:",
" 10 mB/t",
" 200 mB/s",
" 1 mB/t",
" 20 mB/s",
"(Consumption rate is constant)" };
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36 + 16, 16, 16, guiLeft - 8, guiTop + 36 + 16, text1);

View File

@ -1,15 +1,23 @@
package com.hbm.inventory.gui;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import org.lwjgl.opengl.GL11;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.container.ContainerMachineSelenium;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.TileEntityMachineDiesel;
import com.hbm.tileentity.machine.TileEntityMachineSeleniumEngine;
import com.hbm.util.I18nUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
public class GUIMachineSelenium extends GuiInfoContainer {
@ -31,26 +39,23 @@ public class GUIMachineSelenium extends GuiInfoContainer {
diFurnace.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 116, guiTop + 18, 16, 52);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 108, 160, 16, diFurnace.power, diFurnace.powerCap);
List<String> text = new ArrayList();
text.add(EnumChatFormatting.YELLOW + "Accepted Fuels:");
String[] text = new String[] { "Accepted Fuels:",
" Industrial Oil (50 HE/t)",
" Heating Oil (75 HE/t)",
" Hydrogen (500 HE/t)",
" Diesel (225 HE/t)",
" Kerosene (300 HE/t)",
" Reclaimed Oil (100 HE/t)",
" Petroil (125 HE/t)",
" Biofuel (200 HE/t)",
" Leaded Gasoline (700 HE/t)",
" NITAN Superfuel (2500 HE/t)",
"(These numbers are base values,",
"actual output is based",
"on piston count)" };
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, text);
for(Entry<FluidType, Integer> entry : TileEntityMachineDiesel.fuels.entrySet()) {
text.add(" " + I18nUtil.resolveKey(entry.getKey().getUnlocalizedName()) + " (" + entry.getValue() + " HE/t)");
}
text.add(EnumChatFormatting.ITALIC + "(These numbers are base values,");
text.add(EnumChatFormatting.ITALIC + "actual output is based");
text.add(EnumChatFormatting.ITALIC + "on piston count)");
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, text.toArray(new String[0]));
String[] text1 = new String[] { "Fuel consumption rate:",
" 5 mB/t",
" 100 mB/s",
" 1 mB/t",
" 20 mB/s",
"(Consumption rate per piston)" };
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36 + 16, 16, 16, guiLeft - 8, guiTop + 36 + 16, text1);

View File

@ -1475,7 +1475,7 @@ public class MachineRecipes {
list.add(new ItemStack(ModItems.nugget_bismuth, 4));
break;
case ETHANOL:
list.add(new ItemStack(ModItems.biomass, 6));
list.add(new ItemStack(Items.sugar, 6));
break;
case METH:
list.add(new ItemStack(Items.wheat, 1));

View File

@ -1,29 +0,0 @@
package com.hbm.items.block;
import java.util.List;
import com.hbm.blocks.machine.NTMAnvil;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class ItemBlockAnvil extends ItemBlock {
public ItemBlockAnvil(Block block) {
super(block);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
super.addInformation(stack, player, list, bool);
if(this.field_150939_a instanceof NTMAnvil) {
list.add(EnumChatFormatting.GOLD + "Tier " + ((NTMAnvil)this.field_150939_a).tier + " Anvil");
} else {
list.add("can someone wake bob up and tell him he used ItemBlockAnvil.class on a non-anvil block? thanks.");
}
}
}

View File

@ -0,0 +1,36 @@
package com.hbm.items.block;
import java.util.List;
import com.hbm.blocks.ITooltipProvider;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBlockBase extends ItemBlock {
public ItemBlockBase(Block block) {
super(block);
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
if(field_150939_a instanceof ITooltipProvider) {
((ITooltipProvider) field_150939_a).addInformation(itemstack, player, list, bool);
}
}
@Override
public EnumRarity getRarity(ItemStack stack) {
if(field_150939_a instanceof ITooltipProvider) {
return ((ITooltipProvider) field_150939_a).getRarity(stack);
}
return EnumRarity.common;
}
}

View File

@ -9,7 +9,7 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class ItemBlockBlastInfo extends ItemBlock {
public class ItemBlockBlastInfo extends ItemBlockBase {
public ItemBlockBlastInfo(Block block) {
super(block);
@ -18,6 +18,8 @@ public class ItemBlockBlastInfo extends ItemBlock {
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
super.addInformation(stack, player, list, bool);
Item item = stack.getItem();
Block block = Block.getBlockFromItem(item);

View File

@ -1,25 +0,0 @@
package com.hbm.items.block;
import java.util.List;
import com.hbm.util.I18nUtil;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class ItemBlockCluster extends ItemBlock {
public ItemBlockCluster(Block block) {
super(block);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
super.addInformation(stack, player, list, bool);
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("trait.tile.cluster"));
}
}

View File

@ -6,9 +6,9 @@ import net.minecraft.block.Block;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemStack;
public class ItemBlockColored extends ItemBlockBlastInfo {
public class ItemBlockColoredConcrete extends ItemBlockBlastInfo {
public ItemBlockColored(Block block) {
public ItemBlockColoredConcrete(Block block) {
super(block);
this.setMaxDamage(0);
this.setHasSubtypes(true);

View File

@ -1,22 +0,0 @@
package com.hbm.items.block;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBlockDecoPipe extends ItemBlock {
public ItemBlockDecoPipe(Block block) {
super(block);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
super.addInformation(stack, player, list, bool);
list.add("Purely decorative");
}
}

View File

@ -1,25 +0,0 @@
package com.hbm.items.block;
import java.util.List;
import com.hbm.util.I18nUtil;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class ItemBlockDepth extends ItemBlock {
public ItemBlockDepth(Block block) {
super(block);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
super.addInformation(stack, player, list, bool);
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("trait.tile.depth"));
}
}

View File

@ -1,17 +0,0 @@
package com.hbm.items.block;
import net.minecraft.block.Block;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
public class ItemBlockSchrabidium extends ItemBlockHazard {
public ItemBlockSchrabidium(Block block) {
super(block);
}
@Override
public EnumRarity getRarity(ItemStack stack) {
return EnumRarity.rare;
}
}

View File

@ -1,23 +0,0 @@
package com.hbm.items.block;
import java.util.List;
import com.hbm.blocks.machine.BlockHadronCoil;
import com.hbm.util.I18nUtil;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemHadronCoil extends ItemBlock {
public ItemHadronCoil(Block block) {
super(block);
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
list.add(I18nUtil.resolveKey("info.coil") + ": " + ((BlockHadronCoil)field_150939_a).factor);
}
}

View File

@ -9,9 +9,12 @@ import com.hbm.world.dungeon.Bunker;
import com.hbm.world.dungeon.Relay;
import com.hbm.world.generator.CellularDungeonFactory;
import api.hbm.energy.IEnergyConductor;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
@ -32,11 +35,17 @@ public class ItemWandD extends Item {
//int y = world.getHeightValue(x, z);
int y = pos.blockY;
TileEntity te = world.getTileEntity(x, y, z);
if(te instanceof IEnergyConductor) {
IEnergyConductor con = (IEnergyConductor) te;
player.addChatComponentMessage(new ChatComponentText("" + con.getPowerNet()));
}
//CellularDungeonFactory.meteor.generate(world, x, y, z, world.rand);
int r = 5;
/*int r = 5;
/*for(int i = x - r; i <= x + r; i++) {
for(int i = x - r; i <= x + r; i++) {
for(int j = y - r; j <= y + r; j++) {
for(int k = z - r; k <= z + r; k++) {
@ -46,7 +55,7 @@ public class ItemWandD extends Item {
}
}*/
new Bunker().generate(world, world.rand, x, y, z);
//new Bunker().generate(world, world.rand, x, y, z);
/*EntityBlockSpider spider = new EntityBlockSpider(world);
spider.setPosition(x + 0.5, y, z + 0.5);

View File

@ -86,6 +86,7 @@ import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack;
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
import com.hbm.tileentity.machine.oil.TileEntitySpacer;
import com.hbm.tileentity.machine.rbmk.*;
import com.hbm.tileentity.network.TileEntityConnector;
import com.hbm.tileentity.network.TileEntityPylon;
import com.hbm.tileentity.turret.*;
@ -236,6 +237,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFluidDuct.class, new RenderFluidDuct());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRFDuct.class, new RenderRFCable());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPylon.class, new RenderPylon());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConnector.class, new RenderConnector());
//multiblocks
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStructureMarker.class, new RenderStructureMaker());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMultiblock.class, new RenderMultiblock());

View File

@ -231,7 +231,8 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.cable_switch, 1), new Object[] { "S", "W", 'S', Blocks.lever, 'W', ModBlocks.red_wire_coated });
addRecipeAuto(new ItemStack(ModBlocks.machine_detector, 1), new Object[] { "IRI", "CTC", "IRI", 'I', ModItems.plate_polymer, 'R', REDSTONE.dust(), 'C', ModItems.wire_red_copper, 'T', ModItems.coil_tungsten });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.red_cable), 16), new Object[] { " W ", "RRR", " W ", 'W', ModItems.plate_polymer, 'R', ModItems.wire_red_copper });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.red_pylon), 4), new Object[] { "CWC", "PWP", " T ", 'C', ModItems.coil_copper_torus, 'W', KEY_PLANKS, 'P', ModItems.plate_polymer, 'T', ModBlocks.red_wire_coated });
addRecipeAuto(new ItemStack(ModBlocks.red_connector, 4), new Object[] { "C", "I", "S", 'C', ModItems.coil_copper, 'I', ModItems.plate_polymer, 'S', STEEL.ingot() });
addRecipeAuto(new ItemStack(ModBlocks.red_pylon, 4), new Object[] { "CWC", "PWP", " T ", 'C', ModItems.coil_copper, 'W', KEY_PLANKS, 'P', ModItems.plate_polymer, 'T', ModBlocks.red_wire_coated });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.oil_duct_solid), 16), new Object[] { "SPS", "P P", "SPS", 'S', STEEL.ingot(), 'P', IRON.plate() });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.oil_duct), 16), new Object[] { "SIS", " ", "SIS", 'S', STEEL.plate(), 'I', IRON.plate() });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.gas_duct_solid), 16), new Object[] { "SPS", "P P", "SPS", 'S', STEEL.ingot(), 'P', CU.plate() });

View File

@ -271,6 +271,9 @@ public class ResourceManager {
//Belt
public static final IModelCustom arrow = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/arrow.obj"));
//Network
public static final IModelCustom connector = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/network/connector.obj"));
////Textures TEs
public static final ResourceLocation universal = new ResourceLocation(RefStrings.MODID, "textures/models/TheGadget3_.png");
@ -561,6 +564,9 @@ public class ResourceManager {
//ZIRNOX
public static final ResourceLocation zirnox_tex = new ResourceLocation(RefStrings.MODID, "textures/models/zirnox.png");
public static final ResourceLocation zirnox_destroyed_tex = new ResourceLocation(RefStrings.MODID, "textures/models/zirnox_destroyed.png");
//Electricity
public static final ResourceLocation connector_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/connector.png");

View File

@ -60,12 +60,12 @@ public class RenderTestCable implements ISimpleBlockRenderingHandler {
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
tessellator.setColorOpaque_F(1, 1, 1);
boolean pX = Library.canConnect(world, x + 1, y, z, Library.POS_X);
boolean nX = Library.canConnect(world, x - 1, y, z, Library.NEG_X);
boolean pY = Library.canConnect(world, x, y + 1, z, Library.POS_Y);
boolean nY = Library.canConnect(world, x, y - 1, z, Library.NEG_Y);
boolean pZ = Library.canConnect(world, x, y, z + 1, Library.POS_Z);
boolean nZ = Library.canConnect(world, x, y, z - 1, Library.NEG_Z);
boolean pX = Library.canConnect(world, x + 1, y, z, Library.NEG_X);
boolean nX = Library.canConnect(world, x - 1, y, z, Library.POS_X);
boolean pY = Library.canConnect(world, x, y + 1, z, Library.NEG_Y);
boolean nY = Library.canConnect(world, x, y - 1, z, Library.POS_Y);
boolean pZ = Library.canConnect(world, x, y, z + 1, Library.NEG_Z);
boolean nZ = Library.canConnect(world, x, y, z - 1, Library.POS_Z);
tessellator.addTranslation(x + 0.5F, y + 0.5F, z + 0.5F);

View File

@ -0,0 +1,39 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.network.TileEntityConnector;
import net.minecraft.tileentity.TileEntity;
public class RenderConnector extends RenderPylonBase {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
TileEntityConnector con = (TileEntityConnector) te;
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 0.5D, z + 0.5D);
switch(te.getBlockMetadata()) {
case 0: GL11.glRotated(180, 1, 0, 0); break;
case 1: break;
case 2: GL11.glRotated(90, 1, 0, 0); GL11.glRotated(180, 0, 0, 1); break;
case 3: GL11.glRotated(90, 1, 0, 0); break;
case 4: GL11.glRotated(90, 1, 0, 0); GL11.glRotated(90, 0, 0, 1); break;
case 5: GL11.glRotated(90, 1, 0, 0); GL11.glRotated(270, 0, 0, 1); break;
}
GL11.glTranslated(0, -0.5F, 0);
bindTexture(ResourceManager.connector_tex);
ResourceManager.connector.renderAll();
GL11.glPopMatrix();
GL11.glPushMatrix();
this.renderSingleLine(con, x, y, z);
GL11.glPopMatrix();
}
}

View File

@ -69,7 +69,7 @@ public class RenderDemonLamp extends TileEntitySpecialRenderer {
tess.setColorRGBA_F(0F, 0.75F, 1F, 0F);
tess.addVertex(vec.xCoord * far, 0.5D + j * 0.125D + height, vec.zCoord * far);
vec.rotateAroundY((float)Math.PI * 2F / 16F);
vec.rotateAroundY((float)(Math.PI * 2D / 16D));
tess.addVertex(vec.xCoord * far, 0.5D + j * 0.125D + height, vec.zCoord * far);
tess.setColorRGBA_F(0F, 0.75F, 1F, 0.25F);

View File

@ -16,7 +16,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
public class RenderPylon extends TileEntitySpecialRenderer {
public class RenderPylon extends RenderPylonBase {
private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":" + "textures/models/ModelPylon.png");
@ -29,83 +29,16 @@ public class RenderPylon extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
TileEntityPylon pyl = (TileEntityPylon)te;
GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F - ((1F / 16F) * 14F), (float) z + 0.5F);
GL11.glRotatef(180, 0F, 0F, 1F);
bindTexture(texture);
this.pylon.renderAll(0.0625F);
GL11.glPopMatrix();
GL11.glPushMatrix();
for(int i = 0; i < pyl.connected.size(); i++) {
int[] wire = pyl.connected.get(i);
float wX = (wire[0] - pyl.xCoord) / 2F;
float wY = (wire[1] - pyl.yCoord) / 2F;
float wZ = (wire[2] - pyl.zCoord) / 2F;
float count = 10;
Vec3 delta = Vec3.createVectorHelper((wire[0] - te.xCoord), (wire[1] - te.yCoord), (wire[2] - te.zCoord));
for(float j = 0; j < count; j++) {
float k = j + 1;
double ja = j + 0.5D;
double ix = te.xCoord + 0.5 + delta.xCoord / (double)(count * 2) * ja;
double iy = te.yCoord + 0.5 + delta.yCoord / (double)(count * 2) * ja + 5 - Math.sin(j / count * Math.PI * 0.5);
double iz = te.zCoord + 0.5 + delta.zCoord / (double)(count * 2) * ja;
//te.getWorldObj().spawnParticle("reddust", ix, iy, iz, 0.01 + j * 0.1, 0, 0);
int brightness = te.getWorldObj().getLightBrightnessForSkyBlocks(MathHelper.floor_double(ix), MathHelper.floor_double(iy), MathHelper.floor_double(iz), 0);
int lX = brightness % 65536;
int lY = brightness / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)lX / 1.0F, (float)lY / 1.0F);
drawPowerLine(
x + 0.5 + (wX * j / count),
y + 5.4 + (wY * j / count) - Math.sin(j / count * Math.PI * 0.5),
z + 0.5 + (wZ * j / count),
x + 0.5 + (wX * k / count),
y + 5.4 + (wY * k / count) - Math.sin(k / count * Math.PI * 0.5),
z + 0.5 + (wZ * k / count));
}
}
GL11.glPushMatrix();
this.renderSingleLine(pyl, x, y, z);
GL11.glPopMatrix();
}
public void drawPowerLine(double x, double y, double z, double a, double b, double c) {
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawing(5);
tessellator.setColorOpaque_I(0xBB3311);
tessellator.addVertex(x, y + 0.05F, z);
tessellator.addVertex(x, y - 0.05F, z);
tessellator.addVertex(a, b + 0.05F, c);
tessellator.addVertex(a, b - 0.05F, c);
tessellator.draw();
tessellator.startDrawing(5);
tessellator.setColorOpaque_I(0xBB3311);
tessellator.addVertex(x + 0.05F, y, z);
tessellator.addVertex(x - 0.05F, y, z);
tessellator.addVertex(a + 0.05F, b, c);
tessellator.addVertex(a - 0.05F, b, c);
tessellator.draw();
tessellator.startDrawing(5);
tessellator.setColorOpaque_I(0xBB3311);
tessellator.addVertex(x, y, z + 0.05F);
tessellator.addVertex(x, y, z - 0.05F);
tessellator.addVertex(a, b, c + 0.05F);
tessellator.addVertex(a, b, c - 0.05F);
tessellator.draw();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_CULL_FACE);
}
}

View File

@ -0,0 +1,137 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.tileentity.network.TileEntityPylonBase;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
//TODO: adapt this into a more generic form for multi wire pylons
public void renderSingleLine(TileEntityPylonBase pyl, double x, double y, double z) {
for(int i = 0; i < pyl.connected.size(); i++) {
int[] wire = pyl.connected.get(i);
TileEntity tile = pyl.getWorldObj().getTileEntity(wire[0], wire[1], wire[2]);
if(tile instanceof TileEntityPylonBase) {
TileEntityPylonBase pylon = (TileEntityPylonBase) tile;
Vec3 myOffset = pyl.getMountPos();
Vec3 theirOffset = pylon.getMountPos();
double conX0 = pyl.xCoord + myOffset.xCoord;
double conY0 = pyl.yCoord + myOffset.yCoord;
double conZ0 = pyl.zCoord + myOffset.zCoord;
double conX1 = pylon.xCoord + theirOffset.xCoord;
double conY1 = pylon.yCoord + theirOffset.yCoord;
double conZ1 = pylon.zCoord + theirOffset.zCoord;
double wX = (conX1 - conX0) / 2D;
double wY = (conY1 - conY0) / 2D;
double wZ = (conZ1 - conZ0) / 2D;
float count = 10;
Vec3 delta = Vec3.createVectorHelper(conX1 - conX0, conY1 - conY0, conZ1 - conZ0);
double hang = delta.lengthVector() / 15D;
for(float j = 0; j < count; j++) {
float k = j + 1;
double ja = j + 0.5D;
double ix = conX0 + delta.xCoord / (double)(count * 2) * ja;
double iy = conY0 + delta.yCoord / (double)(count * 2) * ja - Math.sin(j / count * Math.PI * 0.5) * hang;
double iz = conZ0 + delta.zCoord / (double)(count * 2) * ja;
//pylon.getWorldObj().spawnParticle("reddust", ix, iy, iz, 0.01 + j * 0.1, 0, 0);
int brightness = pyl.getWorldObj().getLightBrightnessForSkyBlocks(MathHelper.floor_double(ix), MathHelper.floor_double(iy), MathHelper.floor_double(iz), 0);
int lX = brightness % 65536;
int lY = brightness / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)lX / 1.0F, (float)lY / 1.0F);
drawPowerLine(
x + myOffset.xCoord + (wX * j / count),
y + myOffset.yCoord + (wY * j / count) - Math.sin(j / count * Math.PI * 0.5) * hang,
z + myOffset.zCoord + (wZ * j / count),
x + myOffset.xCoord + (wX * k / count),
y + myOffset.yCoord + (wY * k / count) - Math.sin(k / count * Math.PI * 0.5) * hang,
z + myOffset.zCoord + (wZ * k / count));
}
}
}
}
public void renderLine(World world, TileEntityPylonBase pyl, double x, double y, double z, double x0, double y0, double z0, double x1, double y1, double z1) {
GL11.glTranslated(x, y, z);
float count = 10;
for(float j = 0; j < count; j++) {
float k = j + 1;
double deltaX = x1 - x0;
double deltaY = y1 - y0;
double deltaZ = z1 - z0;
double ja = j + 0.5D;
double ix = pyl.xCoord + x0 + deltaX / (double)(count * 2) * ja;
double iy = pyl.yCoord + y0 + deltaY / (double)(count * 2) * ja - Math.sin(j / count * Math.PI * 0.5);
double iz = pyl.zCoord + z0 + deltaZ / (double)(count * 2) * ja;
int brightness = world.getLightBrightnessForSkyBlocks(MathHelper.floor_double(ix), MathHelper.floor_double(iy), MathHelper.floor_double(iz), 0);
int lX = brightness % 65536;
int lY = brightness / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)lX / 1.0F, (float)lY / 1.0F);
drawPowerLine(
x0 + (deltaX * j / count),
y0 + (deltaY * j / count) - Math.sin(j / count * Math.PI * 0.5),
z0 + (deltaZ * j / count),
x0 + (deltaX * k / count),
y0 + (deltaY * k / count) - Math.sin(k / count * Math.PI * 0.5),
z0 + (deltaZ * k / count));
}
}
public void drawPowerLine(double x, double y, double z, double a, double b, double c) {
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawing(5);
tessellator.setColorOpaque_I(0xBB3311);
tessellator.addVertex(x, y + 0.05F, z);
tessellator.addVertex(x, y - 0.05F, z);
tessellator.addVertex(a, b + 0.05F, c);
tessellator.addVertex(a, b - 0.05F, c);
tessellator.draw();
tessellator.startDrawing(5);
tessellator.setColorOpaque_I(0xBB3311);
tessellator.addVertex(x + 0.05F, y, z);
tessellator.addVertex(x - 0.05F, y, z);
tessellator.addVertex(a + 0.05F, b, c);
tessellator.addVertex(a - 0.05F, b, c);
tessellator.draw();
tessellator.startDrawing(5);
tessellator.setColorOpaque_I(0xBB3311);
tessellator.addVertex(x, y, z + 0.05F);
tessellator.addVertex(x, y, z - 0.05F);
tessellator.addVertex(a, b, c + 0.05F);
tessellator.addVertex(a, b, c - 0.05F);
tessellator.draw();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_CULL_FACE);
}
}

View File

@ -73,6 +73,7 @@ public class TileMappings {
put(TileEntityGasDuct.class, "tileentity_gas_duct");
put(TileEntityGasDuctSolid.class, "tileentity_gas_duct_solid");
put(TileEntityMachineRTG.class, "tileentity_machine_rtg");
put(TileEntityConnector.class, "tileentity_connector_redwire");
put(TileEntityPylon.class, "tileentity_pylon_redwire");
put(TileEntityStructureMarker.class, "tileentity_structure_marker");
put(TileEntityMachineMiningDrill.class, "tileentity_mining_drill");

View File

@ -226,18 +226,18 @@ public class TileEntityCompactLauncher extends TileEntity implements ISidedInven
}
private void updateConnections() {
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord + 1);
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord - 1);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord + 1);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord - 1);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord + 2);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord + 2);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord - 2);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord - 2);
this.trySubscribe(worldObj, xCoord + 1, yCoord - 1, zCoord + 1);
this.trySubscribe(worldObj, xCoord + 1, yCoord - 1, zCoord - 1);
this.trySubscribe(worldObj, xCoord - 1, yCoord - 1, zCoord + 1);
this.trySubscribe(worldObj, xCoord - 1, yCoord - 1, zCoord - 1);
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord + 1, Library.POS_X);
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord - 1, Library.POS_X);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord + 1, Library.NEG_X);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord - 1, Library.NEG_X);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord + 2, Library.POS_Z);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord + 2, Library.POS_Z);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord - 2, Library.NEG_Z);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord - 2, Library.NEG_Z);
this.trySubscribe(worldObj, xCoord + 1, yCoord - 1, zCoord + 1, Library.NEG_Y);
this.trySubscribe(worldObj, xCoord + 1, yCoord - 1, zCoord - 1, Library.NEG_Y);
this.trySubscribe(worldObj, xCoord - 1, yCoord - 1, zCoord + 1, Library.NEG_Y);
this.trySubscribe(worldObj, xCoord - 1, yCoord - 1, zCoord - 1, Library.NEG_Y);
}
public boolean canLaunch() {

View File

@ -200,11 +200,11 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory,
}
private void updateConnections() {
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 1);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 1);
this.trySubscribe(worldObj, xCoord, yCoord - 1, zCoord);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord, Library.POS_X);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord, Library.NEG_X);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 1, Library.POS_Z);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 1, Library.NEG_Z);
this.trySubscribe(worldObj, xCoord, yCoord - 1, zCoord, Library.NEG_Y);
}
@Override

View File

@ -225,10 +225,10 @@ public class TileEntityLaunchTable extends TileEntity implements ISidedInventory
private void updateConnections() {
for(int i = -4; i <= 4; i++) {
this.trySubscribe(worldObj, xCoord + i, yCoord, zCoord + 5);
this.trySubscribe(worldObj, xCoord + i, yCoord, zCoord - 5);
this.trySubscribe(worldObj, xCoord + 5, yCoord, zCoord + i);
this.trySubscribe(worldObj, xCoord - 5, yCoord, zCoord + i);
this.trySubscribe(worldObj, xCoord + i, yCoord, zCoord + 5, Library.POS_Z);
this.trySubscribe(worldObj, xCoord + i, yCoord, zCoord - 5, Library.NEG_Z);
this.trySubscribe(worldObj, xCoord + 5, yCoord, zCoord + i, Library.POS_X);
this.trySubscribe(worldObj, xCoord - 5, yCoord, zCoord + i, Library.NEG_X);
}
}

View File

@ -35,7 +35,7 @@ public class TileEntityConverterHeRf extends TileEntityMachineBase implements IE
if (!worldObj.isRemote) {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
storage.setCapacity((int)power * 4);
storage.setEnergyStored((int)power * 4);

View File

@ -15,6 +15,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityCoreAdvanced extends TileEntity implements ISidedInventory, IFactory, IEnergyUser {
@ -236,12 +237,12 @@ public class TileEntityCoreAdvanced extends TileEntity implements ISidedInventor
if(!worldObj.isRemote) {
if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) == ModBlocks.factory_advanced_conductor)
this.trySubscribe(worldObj, xCoord, yCoord + 2, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord + 2, zCoord, ForgeDirection.UP);
else
this.tryUnsubscribe(worldObj, xCoord, yCoord + 2, zCoord);
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.factory_advanced_conductor)
this.trySubscribe(worldObj, xCoord, yCoord - 2, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord - 2, zCoord, ForgeDirection.DOWN);
else
this.tryUnsubscribe(worldObj, xCoord, yCoord - 2, zCoord);
}

View File

@ -89,7 +89,7 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
private void updateConnections() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
public void networkUnpack(NBTTagCompound data) {

View File

@ -16,6 +16,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityCoreTitanium extends TileEntity implements ISidedInventory, IFactory, IEnergyUser {
@ -238,12 +239,12 @@ public class TileEntityCoreTitanium extends TileEntity implements ISidedInventor
if(!worldObj.isRemote) {
if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) == ModBlocks.factory_titanium_conductor)
this.trySubscribe(worldObj, xCoord, yCoord + 2, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord + 2, zCoord, ForgeDirection.UP);
else
this.tryUnsubscribe(worldObj, xCoord, yCoord + 2, zCoord);
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.factory_titanium_conductor)
this.trySubscribe(worldObj, xCoord, yCoord - 2, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord - 2, zCoord, ForgeDirection.DOWN);
else
this.tryUnsubscribe(worldObj, xCoord, yCoord - 2, zCoord);
}

View File

@ -74,7 +74,7 @@ public class TileEntityDeuteriumExtractor extends TileEntityMachineBase implemen
protected void updateConnections() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
public void networkUnpack(NBTTagCompound data) {

View File

@ -84,14 +84,14 @@ public class TileEntityDeuteriumTower extends TileEntityDeuteriumExtractor {
offsetZ = dir.offsetZ;
}
this.trySubscribe(worldObj, this.xCoord + offsetX * 2, this.yCoord, this.zCoord - offsetZ * 1);
this.trySubscribe(worldObj, this.xCoord + offsetX * 2, this.yCoord, this.zCoord - offsetZ * 0);
this.trySubscribe(worldObj, this.xCoord + offsetX * 1, this.yCoord, this.zCoord - offsetZ * 2);
this.trySubscribe(worldObj, this.xCoord + offsetX * 0, this.yCoord, this.zCoord - offsetZ * 2);
this.trySubscribe(worldObj, this.xCoord + offsetX * 1, this.yCoord, this.zCoord + offsetZ * 1);
this.trySubscribe(worldObj, this.xCoord + offsetX * 0, this.yCoord, this.zCoord + offsetZ * 1);
this.trySubscribe(worldObj, this.xCoord - offsetX * 1, this.yCoord, this.zCoord + offsetZ * 0);
this.trySubscribe(worldObj, this.xCoord - offsetX * 1, this.yCoord, this.zCoord - offsetZ * 1);
this.trySubscribe(worldObj, this.xCoord + offsetX * 2, this.yCoord, this.zCoord - offsetZ * 1, ForgeDirection.UNKNOWN); //TODO: figure this one out without dying
this.trySubscribe(worldObj, this.xCoord + offsetX * 2, this.yCoord, this.zCoord - offsetZ * 0, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, this.xCoord + offsetX * 1, this.yCoord, this.zCoord - offsetZ * 2, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, this.xCoord + offsetX * 0, this.yCoord, this.zCoord - offsetZ * 2, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, this.xCoord + offsetX * 1, this.yCoord, this.zCoord + offsetZ * 1, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, this.xCoord + offsetX * 0, this.yCoord, this.zCoord + offsetZ * 1, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, this.xCoord - offsetX * 1, this.yCoord, this.zCoord + offsetZ * 0, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, this.xCoord - offsetX * 1, this.yCoord, this.zCoord - offsetZ * 1, ForgeDirection.UNKNOWN);
}
AxisAlignedBB bb = null;

View File

@ -456,11 +456,11 @@ public class TileEntityForceField extends TileEntity implements ISidedInventory,
}
private void updateConnections() {
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 1);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 1);
this.trySubscribe(worldObj, xCoord, yCoord - 1, zCoord);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord, Library.POS_X);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord, Library.NEG_X);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 1, Library.POS_Z);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 1, Library.NEG_Z);
this.trySubscribe(worldObj, xCoord, yCoord - 1, zCoord, Library.NEG_Y);
}
@Override

View File

@ -21,7 +21,7 @@ public class TileEntityHadronPower extends TileEntity implements IEnergyUser {
public void updateEntity() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
}

View File

@ -26,6 +26,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser, IFluidAcceptor, IFluidSource {
@ -161,8 +162,8 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
this.networkPack(data, 250);
/// END Notif packets ///
this.trySubscribe(worldObj, xCoord, yCoord + 3, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord - 3, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord + 3, zCoord, ForgeDirection.UP);
this.trySubscribe(worldObj, xCoord, yCoord - 3, zCoord, ForgeDirection.DOWN);
} else {

View File

@ -28,52 +28,12 @@ public class TileEntityMachineAmgen extends TileEntity implements IEnergyGenerat
if(block == ModBlocks.machine_amgen) {
float rad = ChunkRadiationManager.proxy.getRadiation(worldObj, xCoord, yCoord, zCoord);
power += rad;
ChunkRadiationManager.proxy.decrementRad(worldObj, xCoord, yCoord, zCoord, 5F);
} else if(block == ModBlocks.machine_geo) {
Block b = worldObj.getBlock(xCoord, yCoord - 1, zCoord);
if(b == ModBlocks.geysir_water) {
power += 75;
} else if(b == ModBlocks.geysir_chlorine) {
power += 100;
} else if(b == ModBlocks.geysir_vapor) {
power += 50;
} else if(b == ModBlocks.geysir_nether) {
power += 500;
} else if(b == Blocks.lava) {
power += 100;
if(worldObj.rand.nextInt(1200) == 0) {
worldObj.setBlock(xCoord, yCoord - 1, zCoord, Blocks.obsidian);
}
} else if(b == Blocks.flowing_lava) {
power += 25;
if(worldObj.rand.nextInt(600) == 0) {
worldObj.setBlock(xCoord, yCoord - 1, zCoord, Blocks.cobblestone);
}
}
b = worldObj.getBlock(xCoord, yCoord + 1, zCoord);
if(b == Blocks.lava) {
power += 100;
if(worldObj.rand.nextInt(1200) == 0) {
worldObj.setBlock(xCoord, yCoord + 1, zCoord, Blocks.obsidian);
}
} else if(b == Blocks.flowing_lava) {
power += 25;
if(worldObj.rand.nextInt(600) == 0) {
worldObj.setBlock(xCoord, yCoord + 1, zCoord, Blocks.cobblestone);
}
}
this.checkGeoInteraction(xCoord, yCoord + 1, zCoord);
this.checkGeoInteraction(xCoord, yCoord - 1, zCoord);
}
if(power > maxPower)
@ -83,6 +43,33 @@ public class TileEntityMachineAmgen extends TileEntity implements IEnergyGenerat
this.sendPower(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
}
private void checkGeoInteraction(int x, int y, int z) {
Block b = worldObj.getBlock(x, y, z);
if(b == ModBlocks.geysir_water) {
power += 75;
} else if(b == ModBlocks.geysir_chlorine) {
power += 100;
} else if(b == ModBlocks.geysir_vapor) {
power += 50;
} else if(b == ModBlocks.geysir_nether) {
power += 500;
} else if(b == Blocks.lava) {
power += 100;
if(worldObj.rand.nextInt(6000) == 0) {
worldObj.setBlock(xCoord, yCoord - 1, zCoord, Blocks.obsidian);
}
} else if(b == Blocks.flowing_lava) {
power += 25;
if(worldObj.rand.nextInt(3000) == 0) {
worldObj.setBlock(xCoord, yCoord - 1, zCoord, Blocks.cobblestone);
}
}
}
@Override
public long getPower() {

View File

@ -247,28 +247,28 @@ public class TileEntityMachineAssembler extends TileEntityMachineBase implements
this.getBlockMetadata();
if(this.blockMetadata == 5) {
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord + 1);
this.trySubscribe(worldObj, xCoord + 3, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord + 3, yCoord, zCoord + 1);
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);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord - 2);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 3);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord + 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);
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord - 1);
this.trySubscribe(worldObj, xCoord - 3, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord - 3, yCoord, zCoord - 2);
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);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord + 2);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 3);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord - 3);
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);
}
}

View File

@ -311,7 +311,7 @@ public class TileEntityMachineBoilerElectric extends TileEntity implements ISide
private void updateConnections() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
public boolean isItemValid() {

View File

@ -313,7 +313,7 @@ public class TileEntityMachineCMBFactory extends TileEntity implements ISidedInv
private void updateConnections() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
@Override

View File

@ -444,28 +444,28 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
this.getBlockMetadata();
if(this.blockMetadata == 5) {
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord + 1);
this.trySubscribe(worldObj, xCoord + 3, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord + 3, yCoord, zCoord + 1);
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);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord - 2);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 3);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord + 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);
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord - 1);
this.trySubscribe(worldObj, xCoord - 3, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord - 3, yCoord, zCoord - 2);
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);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord + 2);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 3);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord - 3);
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);
}
}

View File

@ -103,13 +103,13 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
if(dir == ForgeDirection.NORTH || dir == ForgeDirection.SOUTH) {
this.trySubscribe(worldObj, xCoord + 2, yCoord + 5, zCoord);
this.trySubscribe(worldObj, xCoord - 2, yCoord + 5, zCoord);
this.trySubscribe(worldObj, xCoord + 2, yCoord + 5, zCoord, Library.POS_X);
this.trySubscribe(worldObj, xCoord - 2, yCoord + 5, zCoord, Library.NEG_X);
}
if(dir == ForgeDirection.EAST || dir == ForgeDirection.WEST) {
this.trySubscribe(worldObj, xCoord, yCoord + 5, zCoord + 2);
this.trySubscribe(worldObj, xCoord, yCoord + 5, zCoord - 2);
this.trySubscribe(worldObj, xCoord, yCoord + 5, zCoord + 2, Library.POS_Z);
this.trySubscribe(worldObj, xCoord, yCoord + 5, zCoord - 2, Library.NEG_Z);
}
}

View File

@ -156,14 +156,14 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements
private void updateConnections() {
this.trySubscribe(worldObj, xCoord + 3, yCoord, zCoord + 1);
this.trySubscribe(worldObj, xCoord + 3, yCoord, zCoord - 1);
this.trySubscribe(worldObj, xCoord - 3, yCoord, zCoord + 1);
this.trySubscribe(worldObj, xCoord - 3, yCoord, zCoord - 1);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord + 3);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord + 3);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord - 3);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord - 3);
this.trySubscribe(worldObj, xCoord + 3, yCoord, zCoord + 1, Library.POS_X);
this.trySubscribe(worldObj, xCoord + 3, yCoord, zCoord - 1, Library.POS_X);
this.trySubscribe(worldObj, xCoord - 3, yCoord, zCoord + 1, Library.NEG_X);
this.trySubscribe(worldObj, xCoord - 3, yCoord, zCoord - 1, Library.NEG_X);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord + 3, Library.POS_Z);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord + 3, Library.POS_Z);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord - 3, Library.NEG_Z);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord - 3, Library.NEG_Z);
}
public void networkUnpack(NBTTagCompound data) {

View File

@ -33,7 +33,7 @@ public class TileEntityMachineDetector extends TileEntity implements IEnergyUser
private void updateConnections() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
@Override
@ -48,7 +48,7 @@ public class TileEntityMachineDetector extends TileEntity implements IEnergyUser
@Override
public long getMaxPower() {
return 20;
return 5;
}
}

View File

@ -1,6 +1,7 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.hbm.handler.FluidTypeHandler.FluidType;
@ -132,25 +133,23 @@ public class TileEntityMachineDiesel extends TileEntityMachineBase implements IE
return getHEFromFuel() > 0;
}
public static final HashMap<FluidType, Integer> fuels = new HashMap();
static {
fuels.put(FluidType.HYDROGEN, 10);
fuels.put(FluidType.DIESEL, 500);
fuels.put(FluidType.PETROIL, 300);
fuels.put(FluidType.BIOFUEL, 400);
fuels.put(FluidType.GASOLINE, 1500);
fuels.put(FluidType.NITAN, 5000);
fuels.put(FluidType.LPG, 450);
fuels.put(FluidType.ETHANOL, 200);
}
public int getHEFromFuel() {
FluidType type = tank.getTankType();
if(type.name().equals(FluidType.HYDROGEN.name()))
return 10;
if(type.name().equals(FluidType.DIESEL.name()))
return 500;
if(type.name().equals(FluidType.PETROIL.name()))
return 300;
if(type.name().equals(FluidType.BIOFUEL.name()))
return 400;
if(type.name().equals(FluidType.GASOLINE.name()))
return 1500;
if(type.name().equals(FluidType.NITAN.name()))
return 5000;
if(type.name().equals(FluidType.LPG.name()))
return 450;
if(type.name().equals(FluidType.ETHANOL.name()))
return 200;
return 0;
Integer value = fuels.get(type);
return value != null ? value : null;
}
public void generate() {
@ -166,7 +165,7 @@ public class TileEntityMachineDiesel extends TileEntityMachineBase implements IE
if (soundCycle >= 3)
soundCycle = 0;
tank.setFill(tank.getFill() - 10);
tank.setFill(tank.getFill() - 1);
if (tank.getFill() < 0)
tank.setFill(0);

View File

@ -273,7 +273,7 @@ public class TileEntityMachineEPress extends TileEntity implements ISidedInvento
private void updateConnections() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
public long getPowerScaled(int i) {

View File

@ -324,7 +324,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
private void updateConnections() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
@Override

View File

@ -213,12 +213,12 @@ public class TileEntityMachineMiningDrill extends TileEntityMachineBase implemen
this.getBlockMetadata();
if(this.blockMetadata == 5 || this.blockMetadata == 4) {
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord, Library.POS_X);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord, Library.NEG_X);
} else if(this.blockMetadata == 3 || this.blockMetadata == 2) {
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 2);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 2);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 2, Library.POS_Z);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 2, Library.NEG_Z);
}
}

View File

@ -38,6 +38,7 @@ import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityMachineMiningLaser extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IMiningDrill {
@ -178,7 +179,7 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
}
private void updateConnections() {
this.trySubscribe(worldObj, xCoord, yCoord + 2, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord + 2, zCoord, ForgeDirection.UP);
}
public void networkUnpack(NBTTagCompound data) {

View File

@ -133,7 +133,7 @@ public class TileEntityMachinePlasmaHeater extends TileEntityMachineBase impleme
for(int i = 1; i < 4; i++) {
for(int j = -1; j < 2; j++) {
this.trySubscribe(worldObj, xCoord + side.offsetX * j + dir.offsetX * 2, yCoord + i, zCoord + side.offsetZ * j + dir.offsetZ * 2);
this.trySubscribe(worldObj, xCoord + side.offsetX * j + dir.offsetX * 2, yCoord + i, zCoord + side.offsetZ * j + dir.offsetZ * 2, j < 0 ? ForgeDirection.DOWN : ForgeDirection.UP);
}
}
}

View File

@ -186,7 +186,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntityMachineB
private void updateConnections() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
public void onChunkUnload() {

View File

@ -1,6 +1,7 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.hbm.handler.FluidTypeHandler.FluidType;
@ -255,29 +256,27 @@ public class TileEntityMachineSeleniumEngine extends TileEntity implements ISide
return getHEFromFuel() > 0;
}
public static final HashMap<FluidType, Integer> fuels = new HashMap();
static {
fuels.put(FluidType.SMEAR, 50);
fuels.put(FluidType.HEATINGOIL, 75);
fuels.put(FluidType.HYDROGEN, 5);
fuels.put(FluidType.DIESEL, 225);
fuels.put(FluidType.KEROSENE, 300);
fuels.put(FluidType.RECLAIMED, 100);
fuels.put(FluidType.PETROIL, 125);
fuels.put(FluidType.BIOFUEL, 200);
fuels.put(FluidType.GASOLINE, 700);
fuels.put(FluidType.NITAN, 2500);
fuels.put(FluidType.LPG, 200);
fuels.put(FluidType.ETHANOL, 75);
}
public int getHEFromFuel() {
FluidType type = tank.getTankType();
if(type.name().equals(FluidType.SMEAR.name()))
return 50;
if(type.name().equals(FluidType.HEATINGOIL.name()))
return 75;
if(type.name().equals(FluidType.HYDROGEN.name()))
return 5;
if(type.name().equals(FluidType.DIESEL.name()))
return 225;
if(type.name().equals(FluidType.KEROSENE.name()))
return 300;
if(type.name().equals(FluidType.RECLAIMED.name()))
return 100;
if(type.name().equals(FluidType.PETROIL.name()))
return 125;
if(type.name().equals(FluidType.BIOFUEL.name()))
return 200;
if(type.name().equals(FluidType.GASOLINE.name()))
return 700;
if(type.name().equals(FluidType.NITAN.name()))
return 2500;
return 0;
Integer value = fuels.get(type);
return value != null ? value : null;
}
public void generate() {
@ -294,8 +293,8 @@ public class TileEntityMachineSeleniumEngine extends TileEntity implements ISide
if (soundCycle >= 3)
soundCycle = 0;
tank.setFill(tank.getFill() - this.pistonCount * 5);
if (tank.getFill() < 0)
tank.setFill(tank.getFill() - this.pistonCount);
if(tank.getFill() < 0)
tank.setFill(0);
power += getHEFromFuel() * Math.pow(this.pistonCount, 1.15D);
@ -354,4 +353,9 @@ public class TileEntityMachineSeleniumEngine extends TileEntity implements ISide
return list;
}
@Override
public boolean canConnect(ForgeDirection dir) {
return dir == ForgeDirection.DOWN;
}
}

View File

@ -294,7 +294,7 @@ public class TileEntityMachineShredder extends TileEntity implements ISidedInven
private void updateConnections() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
public void processItem() {

View File

@ -45,7 +45,7 @@ public class TileEntityRadiobox extends TileEntity implements IEnergyUser {
private void updateConnections() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
@Override

View File

@ -286,7 +286,7 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
ItemZirnoxRod.setLifeTime(slots[id], ItemZirnoxRod.getLifeTime(slots[id]) + 1);
if(ItemZirnoxRod.getLifeTime(slots[id]) > ((ItemZirnoxRod) slots[id].getItem()).lifeTime) {
slots[id] = fuelMap.get(new ComparableStack(getStackInSlot(id)));
slots[id] = fuelMap.get(new ComparableStack(getStackInSlot(id)).copy());
break;
}
}

View File

@ -26,6 +26,7 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor {
@ -60,7 +61,7 @@ public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements IS
if (!worldObj.isRemote) {
this.trySubscribe(worldObj, xCoord, yCoord - 1, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord - 1, zCoord, ForgeDirection.DOWN);
tanks[0].loadTank(4, 5, slots);
tanks[1].loadTank(6, 7, slots);

View File

@ -87,7 +87,7 @@ public class TileEntityTesla extends TileEntityMachineBase implements IEnergyUse
private void updateConnections() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
}
public static List<double[]> zap(World worldObj, double x, double y, double z, double radius, Entity source) {

View File

@ -14,6 +14,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityWasteDrum extends TileEntity implements ISidedInventory {
@ -196,18 +197,11 @@ public class TileEntityWasteDrum extends TileEntity implements ISidedInventory {
int water = 0;
if(worldObj.getBlock(xCoord + 1, yCoord, zCoord) == Blocks.water || worldObj.getBlock(xCoord + 1, yCoord, zCoord) == Blocks.flowing_water)
water++;
if(worldObj.getBlock(xCoord - 1, yCoord, zCoord) == Blocks.water || worldObj.getBlock(xCoord - 1, yCoord, zCoord) == Blocks.flowing_water)
water++;
if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) == Blocks.water || worldObj.getBlock(xCoord, yCoord + 1, zCoord) == Blocks.flowing_water)
water++;
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) == Blocks.water || worldObj.getBlock(xCoord, yCoord - 1, zCoord) == Blocks.flowing_water)
water++;
if(worldObj.getBlock(xCoord, yCoord, zCoord + 1) == Blocks.water || worldObj.getBlock(xCoord, yCoord, zCoord + 1) == Blocks.flowing_water)
water++;
if(worldObj.getBlock(xCoord, yCoord, zCoord - 1) == Blocks.water || worldObj.getBlock(xCoord, yCoord, zCoord - 1) == Blocks.flowing_water)
water++;
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
if(worldObj.getBlock(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ) == Blocks.water || worldObj.getBlock(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ) == Blocks.flowing_water) {
water++;
}
}
if(water > 0) {
@ -225,8 +219,9 @@ public class TileEntityWasteDrum extends TileEntity implements ISidedInventory {
} else if(worldObj.rand.nextInt(r) == 0) {
if(wasteMap.keySet().contains(new ComparableStack(getStackInSlot(i)))) {
slots[i] = wasteMap.get(new ComparableStack(getStackInSlot(i)));
ComparableStack comp = new ComparableStack(getStackInSlot(i));
if(wasteMap.keySet().contains(comp)) {
slots[i] = wasteMap.get(comp).copy();
}
}
}

View File

@ -3,6 +3,7 @@ package com.hbm.tileentity.machine.oil;
import com.hbm.blocks.ModBlocks;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.lib.Library;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
@ -18,10 +19,10 @@ public class TileEntityMachineOilWell extends TileEntityOilDrillBase {
@Override
protected void updateConnections() {
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 2);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 2);
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord, Library.POS_X);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord, Library.NEG_X);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 2, Library.POS_Z);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 2, Library.NEG_Z);
}
@Override

View File

@ -28,10 +28,10 @@ public class TileEntityMachinePumpjack extends TileEntityOilDrillBase {
ForgeDirection dir = ForgeDirection.getOrientation(this.blockMetadata - BlockDummyable.offset);
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
this.trySubscribe(worldObj, xCoord + rot.offsetX * 2 + dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 2 + dir.offsetZ * 2);
this.trySubscribe(worldObj, xCoord + rot.offsetX * 2 + dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 4 - dir.offsetZ * 2);
this.trySubscribe(worldObj, xCoord + rot.offsetX * 4 - dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 4 + dir.offsetZ * 2);
this.trySubscribe(worldObj, xCoord + rot.offsetX * 4 - dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 2 - dir.offsetZ * 2);
this.trySubscribe(worldObj, xCoord + rot.offsetX * 2 + dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 2 + dir.offsetZ * 2, ForgeDirection.UNKNOWN); //brain overheating, do this shit somewhen else
this.trySubscribe(worldObj, xCoord + rot.offsetX * 2 + dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 4 - dir.offsetZ * 2, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, xCoord + rot.offsetX * 4 - dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 4 + dir.offsetZ * 2, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, xCoord + rot.offsetX * 4 - dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 2 - dir.offsetZ * 2, ForgeDirection.UNKNOWN);
}
@Override

View File

@ -316,14 +316,14 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
}
private void updateConnections() {
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord + 1);
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord - 1);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord + 1);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord - 1);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord + 2);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord + 2);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord - 2);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord - 2);
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord + 1, Library.POS_X);
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord - 1, Library.POS_X);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord + 1, Library.NEG_X);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord - 1, Library.NEG_X);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord + 2, Library.POS_Z);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord + 2, Library.POS_Z);
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord - 2, Library.NEG_Z);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord - 2, Library.NEG_Z);
}
public long getPowerScaled(long i) {

View File

@ -36,6 +36,9 @@ public class TileEntityCableBaseNT extends TileEntity implements IEnergyConducto
IEnergyConductor conductor = (IEnergyConductor) te;
if(!conductor.canConnect(dir.getOpposite()))
break;
if(this.getPowerNet() == null && conductor.getPowerNet() != null) {
conductor.getPowerNet().joinLink(this);
}

View File

@ -0,0 +1,56 @@
package com.hbm.tileentity.network;
import api.hbm.energy.IEnergyConductor;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityConnector extends TileEntityPylonBase {
@Override
public ConnectionType getConnectionType() {
return ConnectionType.SINGLE;
}
@Override
public Vec3 getMountPos() {
return Vec3.createVectorHelper(0.5, 0.5, 0.5);
}
@Override
public double getMaxWireLength() {
return 10;
}
@Override
protected void connect() {
super.connect();
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata()).getOpposite();
TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
if(te instanceof IEnergyConductor) {
IEnergyConductor conductor = (IEnergyConductor) te;
if(!conductor.canConnect(dir.getOpposite()))
return;
if(this.getPowerNet() == null && conductor.getPowerNet() != null) {
conductor.getPowerNet().joinLink(this);
}
if(this.getPowerNet() != null && conductor.getPowerNet() != null && this.getPowerNet() != conductor.getPowerNet()) {
conductor.getPowerNet().joinNetworks(this.getPowerNet());
}
}
}
@Override
public boolean canConnect(ForgeDirection dir) {
return dir == ForgeDirection.getOrientation(this.getBlockMetadata()).getOpposite();
}
}

View File

@ -14,7 +14,7 @@ public class TileEntityPylon extends TileEntityPylonBase {
@Override
public Vec3 getMountPos() {
return Vec3.createVectorHelper(xCoord + 0.5, yCoord + 5.4, zCoord + 0.5);
return Vec3.createVectorHelper(0.5, 5.4, 0.5);
}
@Override

View File

@ -243,17 +243,18 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset).getOpposite();
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
this.trySubscribe(worldObj, xCoord + dir.offsetX * -1 + rot.offsetX * 0, yCoord, zCoord + dir.offsetZ * -1 + rot.offsetZ * 0);
this.trySubscribe(worldObj, xCoord + dir.offsetX * -1 + rot.offsetX * -1, yCoord, zCoord + dir.offsetZ * -1 + rot.offsetZ * -1);
//how did i even make this? what???
this.trySubscribe(worldObj, xCoord + dir.offsetX * -1 + rot.offsetX * 0, yCoord, zCoord + dir.offsetZ * -1 + rot.offsetZ * 0, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, xCoord + dir.offsetX * -1 + rot.offsetX * -1, yCoord, zCoord + dir.offsetZ * -1 + rot.offsetZ * -1, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 0 + rot.offsetX * -2, yCoord, zCoord + dir.offsetZ * 0 + rot.offsetZ * -2);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 1 + rot.offsetX * -2, yCoord, zCoord + dir.offsetZ * 1 + rot.offsetZ * -2);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 0 + rot.offsetX * -2, yCoord, zCoord + dir.offsetZ * 0 + rot.offsetZ * -2, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 1 + rot.offsetX * -2, yCoord, zCoord + dir.offsetZ * 1 + rot.offsetZ * -2, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 0 + rot.offsetX * 1, yCoord, zCoord + dir.offsetZ * 0 + rot.offsetZ * 1);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 1 + rot.offsetX * 1, yCoord, zCoord + dir.offsetZ * 1 + rot.offsetZ * 1);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 0 + rot.offsetX * 1, yCoord, zCoord + dir.offsetZ * 0 + rot.offsetZ * 1, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 1 + rot.offsetX * 1, yCoord, zCoord + dir.offsetZ * 1 + rot.offsetZ * 1, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 2 + rot.offsetX * 0, yCoord, zCoord + dir.offsetZ * 2 + rot.offsetZ * 0);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 2 + rot.offsetX * -1, yCoord, zCoord + dir.offsetZ * 2 + rot.offsetZ * -1);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 2 + rot.offsetX * 0, yCoord, zCoord + dir.offsetZ * 2 + rot.offsetZ * 0, ForgeDirection.UNKNOWN);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 2 + rot.offsetX * -1, yCoord, zCoord + dir.offsetZ * 2 + rot.offsetZ * -1, ForgeDirection.UNKNOWN);
}
@Override

View File

@ -0,0 +1,250 @@
# Blender v2.79 (sub 0) OBJ File: 'connector.blend'
# www.blender.org
o Cube_Cube.001
v -0.062500 0.437500 0.062500
v -0.062500 0.562500 0.062500
v -0.062500 0.437500 -0.062500
v -0.062500 0.562500 -0.062500
v 0.062500 0.437500 0.062500
v 0.062500 0.562500 0.062500
v 0.062500 0.437500 -0.062500
v 0.062500 0.562500 -0.062500
v -0.125000 0.437500 0.125000
v -0.125000 0.437500 -0.125000
v 0.125000 0.437500 0.125000
v 0.125000 0.437500 -0.125000
v -0.125000 0.375000 0.125000
v -0.125000 0.375000 -0.125000
v 0.125000 0.375000 0.125000
v 0.125000 0.375000 -0.125000
v -0.187500 0.375000 0.187500
v -0.187500 0.375000 -0.187500
v 0.187500 0.375000 0.187500
v 0.187500 0.375000 -0.187500
v -0.187500 0.250000 0.187500
v -0.187500 0.250000 -0.187500
v 0.187500 0.250000 0.187500
v 0.187500 0.250000 -0.187500
v -0.125000 0.250000 0.125000
v -0.125000 0.250000 -0.125000
v 0.125000 0.250000 0.125000
v 0.125000 0.250000 -0.125000
v -0.125000 0.187500 0.125000
v -0.125000 0.187500 -0.125000
v 0.125000 0.187500 0.125000
v 0.125000 0.187500 -0.125000
v -0.187500 0.187500 0.187500
v -0.187500 0.187500 -0.187500
v 0.187500 0.187500 0.187500
v 0.187500 0.187500 -0.187500
v -0.187500 0.062500 0.187500
v -0.187500 0.062500 -0.187500
v 0.187500 0.062500 0.187500
v 0.187500 0.062500 -0.187500
v -0.125000 0.062500 0.125000
v -0.125000 0.062500 -0.125000
v 0.125000 0.062500 0.125000
v 0.125000 0.062500 -0.125000
v -0.125000 0.000000 0.125000
v -0.125000 0.000000 -0.125000
v 0.125000 0.000000 0.125000
v 0.125000 0.000000 -0.125000
vt 0.666667 0.900000
vt 0.333333 0.800000
vt 0.666667 0.800000
vt 0.666667 0.900000
vt 0.333333 0.800000
vt 0.666667 0.800000
vt 0.666667 0.900000
vt 0.333333 0.800000
vt 0.666667 0.800000
vt 0.666667 0.900000
vt 0.333333 0.800000
vt 0.666667 0.800000
vt 0.833333 0.750000
vt 0.666667 1.000000
vt 0.333333 0.900000
vt 0.833333 0.750000
vt 0.833333 0.750000
vt 0.833333 0.750000
vt 0.166667 0.750000
vt 0.833333 0.700000
vt 0.166667 0.750000
vt 0.833333 0.700000
vt 0.166667 0.750000
vt 0.833333 0.700000
vt 0.166667 0.750000
vt 0.833333 0.700000
vt 0.166667 0.700000
vt 1.000000 0.650000
vt 0.166667 0.700000
vt 1.000000 0.650000
vt 0.166667 0.700000
vt 1.000000 0.650000
vt 0.166667 0.700000
vt 1.000000 0.650000
vt -0.000000 0.650000
vt 1.000000 0.550000
vt 0.000000 0.650000
vt 1.000000 0.550000
vt 0.000000 0.650000
vt 1.000000 0.550000
vt 0.000000 0.650000
vt 1.000000 0.550000
vt 0.166667 0.500000
vt 0.833333 0.450000
vt 0.833333 0.500000
vt 0.166667 0.500000
vt 0.833333 0.450000
vt 0.833333 0.500000
vt 0.166667 0.500000
vt 0.833333 0.450000
vt 0.833333 0.500000
vt 0.166667 0.500000
vt 0.833333 0.450000
vt 0.833333 0.500000
vt 0.166667 0.450000
vt 1.000000 0.400000
vt 0.166667 0.450000
vt 1.000000 0.400000
vt 0.166667 0.450000
vt 1.000000 0.400000
vt 0.166667 0.450000
vt 1.000000 0.400000
vt -0.000000 0.400000
vt 1.000000 0.300000
vt 0.000000 0.400000
vt 1.000000 0.300000
vt 0.000000 0.400000
vt 1.000000 0.300000
vt 0.000000 0.400000
vt 1.000000 0.300000
vt 0.166667 0.250000
vt 0.833333 0.200000
vt 0.833333 0.250000
vt 0.166667 0.250000
vt 0.833333 0.200000
vt 0.833333 0.250000
vt 0.166667 0.250000
vt 0.833333 0.200000
vt 0.833333 0.250000
vt 0.166667 0.250000
vt 0.833333 0.200000
vt 0.833333 0.250000
vt 0.166667 0.000000
vt 0.833333 0.000000
vt -0.000000 0.300000
vt 0.000000 0.300000
vt 0.000000 0.300000
vt 0.000000 0.300000
vt -0.000000 0.550000
vt 0.000000 0.550000
vt 0.000000 0.550000
vt 0.000000 0.550000
vt 0.333333 0.900000
vt 0.333333 0.900000
vt 0.333333 0.900000
vt 0.333333 1.000000
vt 0.166667 0.200000
vt 0.166667 0.200000
vt 0.166667 0.200000
vt 0.166667 0.200000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
s off
f 2/1/1 3/2/1 1/3/1
f 4/4/2 7/5/2 3/6/2
f 8/7/3 5/8/3 7/9/3
f 6/10/4 1/11/4 5/12/4
f 7/5/5 10/13/5 3/6/5
f 4/14/5 6/15/5 8/7/5
f 3/2/5 9/16/5 1/3/5
f 5/8/5 12/17/5 7/9/5
f 1/11/5 11/18/5 5/12/5
f 9/19/4 15/20/4 11/18/4
f 12/21/2 14/22/2 10/13/2
f 11/23/3 16/24/3 12/17/3
f 10/25/1 13/26/1 9/16/1
f 15/27/5 20/28/5 16/24/5
f 14/29/5 17/30/5 13/26/5
f 13/31/5 19/32/5 15/20/5
f 16/33/5 18/34/5 14/22/5
f 17/35/4 23/36/4 19/32/4
f 20/37/2 22/38/2 18/34/2
f 19/39/3 24/40/3 20/28/3
f 18/41/1 21/42/1 17/30/1
f 25/43/4 31/44/4 27/45/4
f 28/46/2 30/47/2 26/48/2
f 27/49/3 32/50/3 28/51/3
f 26/52/1 29/53/1 25/54/1
f 31/55/5 36/56/5 32/50/5
f 30/57/5 33/58/5 29/53/5
f 29/59/5 35/60/5 31/44/5
f 32/61/5 34/62/5 30/47/5
f 33/63/4 39/64/4 35/60/4
f 36/65/2 38/66/2 34/62/2
f 35/67/3 40/68/3 36/56/3
f 34/69/1 37/70/1 33/58/1
f 41/71/4 47/72/4 43/73/4
f 44/74/2 46/75/2 42/76/2
f 43/77/3 48/78/3 44/79/3
f 42/80/1 45/81/1 41/82/1
f 48/78/6 45/83/6 46/84/6
f 37/85/6 43/73/6 39/64/6
f 39/86/6 44/79/6 40/68/6
f 40/87/6 42/76/6 38/66/6
f 38/88/6 41/82/6 37/70/6
f 21/89/6 27/45/6 23/36/6
f 23/90/6 28/51/6 24/40/6
f 24/91/6 26/48/6 22/38/6
f 22/92/6 25/54/6 21/42/6
f 2/1/1 4/93/1 3/2/1
f 4/4/2 8/94/2 7/5/2
f 8/7/3 6/15/3 5/8/3
f 6/10/4 2/95/4 1/11/4
f 7/5/5 12/21/5 10/13/5
f 4/14/5 2/96/5 6/15/5
f 3/2/5 10/25/5 9/16/5
f 5/8/5 11/23/5 12/17/5
f 1/11/5 9/19/5 11/18/5
f 9/19/4 13/31/4 15/20/4
f 12/21/2 16/33/2 14/22/2
f 11/23/3 15/27/3 16/24/3
f 10/25/1 14/29/1 13/26/1
f 15/27/5 19/39/5 20/28/5
f 14/29/5 18/41/5 17/30/5
f 13/31/5 17/35/5 19/32/5
f 16/33/5 20/37/5 18/34/5
f 17/35/4 21/89/4 23/36/4
f 20/37/2 24/91/2 22/38/2
f 19/39/3 23/90/3 24/40/3
f 18/41/1 22/92/1 21/42/1
f 25/43/4 29/59/4 31/44/4
f 28/46/2 32/61/2 30/47/2
f 27/49/3 31/55/3 32/50/3
f 26/52/1 30/57/1 29/53/1
f 31/55/5 35/67/5 36/56/5
f 30/57/5 34/69/5 33/58/5
f 29/59/5 33/63/5 35/60/5
f 32/61/5 36/65/5 34/62/5
f 33/63/4 37/85/4 39/64/4
f 36/65/2 40/87/2 38/66/2
f 35/67/3 39/86/3 40/68/3
f 34/69/1 38/88/1 37/70/1
f 41/71/4 45/97/4 47/72/4
f 44/74/2 48/98/2 46/75/2
f 43/77/3 47/99/3 48/78/3
f 42/80/1 46/100/1 45/81/1
f 48/78/6 47/99/6 45/83/6
f 37/85/6 41/71/6 43/73/6
f 39/86/6 43/77/6 44/79/6
f 40/87/6 44/74/6 42/76/6
f 38/88/6 42/80/6 41/82/6
f 21/89/6 25/43/6 27/45/6
f 23/90/6 27/49/6 28/51/6
f 24/91/6 28/46/6 26/48/6
f 22/92/6 26/52/6 25/54/6

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B