Merge remote-tracking branch 'origin/master'
@ -94,4 +94,24 @@ public interface IEnergyConductor extends IEnergyConnector {
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Since isLoaded is only currently used for weeding out unwanted subscribers, and cables shouldn't (although technically can) be
|
||||
* subscribers, we just default to true because I don't feel like wasting time implementing things that we don't actually need.
|
||||
* Perhaps this indicates a minor flaw in the new API, but I physically lack the ability to worry about it.
|
||||
*/
|
||||
@Override
|
||||
public default boolean isLoaded() {
|
||||
return true;
|
||||
}
|
||||
|
||||
//TODO: check if this standard implementation doesn't break anything (it shouldn't but right now it's a bit redundant) also: remove duplicate implementations
|
||||
@Override
|
||||
public default long transferPower(long power) {
|
||||
|
||||
if(this.getPowerNet() == null)
|
||||
return power;
|
||||
|
||||
return this.getPowerNet().transferPower(power);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
* This is mean for TILE ENTITIES
|
||||
* @author hbm
|
||||
*/
|
||||
public interface IEnergyConnector {
|
||||
public interface IEnergyConnector extends ILoadedTile {
|
||||
|
||||
/**
|
||||
* Returns the amount of power that remains in the source after transfer
|
||||
|
||||
6
src/main/java/api/hbm/energy/ILoadedTile.java
Normal file
@ -0,0 +1,6 @@
|
||||
package api.hbm.energy;
|
||||
|
||||
public interface ILoadedTile {
|
||||
|
||||
public boolean isLoaded();
|
||||
}
|
||||
@ -96,12 +96,18 @@ public class PowerNet implements IPowerNet {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public long lastCleanup = System.currentTimeMillis();
|
||||
|
||||
@Override
|
||||
public long transferPower(long power) {
|
||||
|
||||
this.subscribers.removeIf(x ->
|
||||
x == null || !(x instanceof TileEntity) || ((TileEntity)x).isInvalid()
|
||||
);
|
||||
if(lastCleanup + 45 < System.currentTimeMillis()) {
|
||||
this.subscribers.removeIf(x ->
|
||||
x == null || !(x instanceof TileEntity) || ((TileEntity)x).isInvalid() || !x.isLoaded()
|
||||
);
|
||||
|
||||
lastCleanup = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
if(this.subscribers.isEmpty())
|
||||
return power;
|
||||
|
||||
@ -7,4 +7,13 @@ public interface IFluidConductor extends IFluidConnector {
|
||||
public IPipeNet getPipeNet(FluidType type);
|
||||
|
||||
public void setPipeNet(FluidType type, IPipeNet network);
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, long amount) {
|
||||
|
||||
if(this.getPipeNet(type) == null)
|
||||
return amount;
|
||||
|
||||
return this.getPipeNet(type).transferFluid(amount);
|
||||
}
|
||||
}
|
||||
|
||||
11
src/main/java/api/hbm/fluid/IFluidConnectorBlock.java
Normal file
@ -0,0 +1,11 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidConnectorBlock {
|
||||
|
||||
public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir);
|
||||
}
|
||||
49
src/main/java/api/hbm/fluid/IFluidStandardReceiver.java
Normal file
@ -0,0 +1,49 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
/**
|
||||
* Uses default implementation to make the underlying interfaces easier to use for the most common fluid users.
|
||||
* Only handles a single input tank of the same type.
|
||||
* Uses standard FluidTanks which use int32.
|
||||
* Don't use this as part of the API!
|
||||
* @author hbm
|
||||
*
|
||||
*/
|
||||
public interface IFluidStandardReceiver extends IFluidUser {
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, long amount) {
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
tank.setFill(tank.getFill() + (int) amount);
|
||||
|
||||
if(tank.getFill() > tank.getMaxFill()) {
|
||||
long overshoot = tank.getFill() - tank.getMaxFill();
|
||||
tank.setFill(tank.getMaxFill());
|
||||
return overshoot;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
public FluidTank[] getReceivingTanks();
|
||||
|
||||
@Override
|
||||
public default long getDemand(FluidType type) {
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
return tank.getMaxFill() - tank.getFill();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
40
src/main/java/api/hbm/fluid/IFluidStandardSender.java
Normal file
@ -0,0 +1,40 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
/**
|
||||
* Uses default implementation to make the underlying interfaces easier to use for the most common fluid users.
|
||||
* Only handles a single output tank of the same type.
|
||||
* Uses standard FluidTanks which use int32.
|
||||
* Don't use this as part of the API!
|
||||
* @author hbm
|
||||
*
|
||||
*/
|
||||
public interface IFluidStandardSender extends IFluidUser {
|
||||
|
||||
public FluidTank[] getSendingTanks();
|
||||
|
||||
@Override
|
||||
public default long getTotalFluidForSend(FluidType type) {
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
return tank.getFill();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public default void removeFluidForTransfer(FluidType type, long amount) {
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
tank.setFill(tank.getFill() - (int) amount);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,65 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidUser extends IFluidConnector {
|
||||
|
||||
/*public default void updateStandardPipes(World world, int x, int y, int z) {
|
||||
public default void sendFluid(FluidType type, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
boolean wasSubscribed = false;
|
||||
boolean red = false;
|
||||
|
||||
if(te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(con.getPipeNet(type) != null && con.getPipeNet(type).isSubscribed(this)) {
|
||||
con.getPipeNet(type).unsubscribe(this);
|
||||
wasSubscribed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(te instanceof IFluidConnector) {
|
||||
IFluidConnector con = (IFluidConnector) te;
|
||||
|
||||
if(con.canConnect(type, dir.getOpposite())) {
|
||||
long toSend = this.getTotalFluidForSend(type);
|
||||
long transfer = toSend - con.transferFluid(type, toSend);
|
||||
this.removeFluidForTransfer(type, transfer);
|
||||
red = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(wasSubscribed && te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(con.getPipeNet(type) != null && !con.getPipeNet(type).isSubscribed(this)) {
|
||||
con.getPipeNet(type).subscribe(this);
|
||||
}
|
||||
}
|
||||
|
||||
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 long getTotalFluidForSend(FluidType type) { return 0; }
|
||||
public default void removeFluidForTransfer(FluidType type, long amount) { }
|
||||
|
||||
public default void updateStandardPipes(FluidType type, 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, dir);
|
||||
}*/
|
||||
this.trySubscribe(type, world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.blocks;
|
||||
public class BlockEnums {
|
||||
|
||||
public static enum EnumStoneType {
|
||||
SULFUR
|
||||
SULFUR,
|
||||
ASBESTOS
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,6 +49,7 @@ public interface ILookOverlay {
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
|
||||
@ -21,9 +21,12 @@ import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.DoorDecl;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.material.*;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
@ -80,6 +83,8 @@ public class ModBlocks {
|
||||
public static Block ore_cinnebar;
|
||||
public static Block ore_coltan;
|
||||
public static Block ore_alexandrite;
|
||||
|
||||
public static Block ore_random;
|
||||
|
||||
public static Block ore_bedrock_coltan;
|
||||
|
||||
@ -717,6 +722,7 @@ public class ModBlocks {
|
||||
|
||||
public static Block red_wire_coated;
|
||||
public static Block red_cable;
|
||||
public static Block red_cable_classic;
|
||||
public static Block red_connector;
|
||||
public static Block red_pylon;
|
||||
public static Block red_pylon_large;
|
||||
@ -1183,6 +1189,9 @@ public class ModBlocks {
|
||||
public static Fluid volcanic_lava_fluid;
|
||||
public static final Material fluidvolcanic = (new MaterialLiquid(MapColor.redColor));
|
||||
|
||||
public static Block sulfuric_acid_block;
|
||||
public static Fluid sulfuric_acid_fluid;
|
||||
|
||||
public static Block volcano_core;
|
||||
|
||||
public static Block dummy_block_flare;
|
||||
@ -1335,6 +1344,8 @@ public class ModBlocks {
|
||||
cluster_depth_titanium = new BlockDepthOre().setBlockName("cluster_depth_titanium").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":cluster_depth_titanium");
|
||||
cluster_depth_tungsten = new BlockDepthOre().setBlockName("cluster_depth_tungsten").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":cluster_depth_tungsten");
|
||||
ore_alexandrite = new BlockDepthOre().setBlockName("ore_alexandrite").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ore_alexandrite");
|
||||
|
||||
ore_random = new BlockMotherOfAllOres().setBlockName("ore_random").setCreativeTab(MainRegistry.blockTab);
|
||||
|
||||
depth_brick = new BlockDepth().setBlockName("depth_brick").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":depth_brick");
|
||||
depth_tiles = new BlockDepth().setBlockName("depth_tiles").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":depth_tiles");
|
||||
@ -1346,7 +1357,7 @@ public class ModBlocks {
|
||||
ore_depth_nether_neodymium = new BlockDepthOre().setBlockName("ore_depth_nether_neodymium").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ore_depth_nether_neodymium");
|
||||
|
||||
stone_porous = new BlockPorous().setBlockName("stone_porous").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":stone_porous");
|
||||
stone_resource = new BlockEnumMulti(Material.rock, BlockEnums.EnumStoneType.class, true, true).setBlockName("stone_resource").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
|
||||
stone_resource = new BlockResourceStone().setBlockName("stone_resource").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
|
||||
stalagmite = new BlockStalagmite().setBlockName("stalagmite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
|
||||
stalactite = new BlockStalagmite().setBlockName("stalactite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
|
||||
|
||||
@ -1841,6 +1852,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");
|
||||
red_cable_classic = new BlockCable(Material.iron).setBlockName("red_cable_classic").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_cable_classic");
|
||||
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");
|
||||
@ -2212,6 +2224,10 @@ public class ModBlocks {
|
||||
FluidRegistry.registerFluid(volcanic_lava_fluid);
|
||||
volcanic_lava_block = new VolcanicBlock(volcanic_lava_fluid, Material.lava).setBlockName("volcanic_lava_block").setResistance(500F);
|
||||
|
||||
sulfuric_acid_fluid = new GenericFluid("sulfuric_acid_fluid").setDensity(1840).setViscosity(1000).setTemperature(273);
|
||||
FluidRegistry.registerFluid(sulfuric_acid_fluid);
|
||||
sulfuric_acid_block = new GenericFluidBlock(sulfuric_acid_fluid, Material.water, "sulfuric_acid_still", "sulfuric_acid_flowing").setDamage(ModDamageSource.acid, 5F).setBlockName("sulfuric_acid_block").setResistance(500F);
|
||||
|
||||
dummy_block_flare = new DummyBlockFlare(Material.iron, false).setBlockName("dummy_block_flare").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_aluminium");
|
||||
dummy_port_flare = new DummyBlockFlare(Material.iron, true).setBlockName("dummy_port_flare").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_aluminium");
|
||||
dummy_block_drill = new DummyBlockDrill(Material.iron, false).setBlockName("dummy_block_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
|
||||
@ -2953,6 +2969,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(pribris_digamma, pribris_digamma.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(red_cable, red_cable.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_cable_classic, red_cable_classic.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_connector, ItemBlockBase.class, red_connector.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_pylon, ItemBlockBase.class, red_pylon.getUnlocalizedName());
|
||||
@ -3201,6 +3218,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(schrabidic_block, schrabidic_block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(corium_block, corium_block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(volcanic_lava_block, volcanic_lava_block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(sulfuric_acid_block, sulfuric_acid_block.getUnlocalizedName());
|
||||
|
||||
//Multiblock Dummy Blocks
|
||||
GameRegistry.registerBlock(dummy_block_flare, dummy_block_flare.getUnlocalizedName());
|
||||
|
||||
@ -11,21 +11,25 @@ public class AcidFluid extends Fluid {
|
||||
super("acid_fluid");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon() {
|
||||
return getStillIcon();
|
||||
}
|
||||
public AcidFluid(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getStillIcon() {
|
||||
return AcidBlock.stillIcon;
|
||||
}
|
||||
public IIcon getIcon() {
|
||||
return getStillIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getFlowingIcon() {
|
||||
return AcidBlock.flowingIcon;
|
||||
}
|
||||
public IIcon getStillIcon() {
|
||||
return AcidBlock.stillIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getFlowingIcon() {
|
||||
return AcidBlock.flowingIcon;
|
||||
}
|
||||
}
|
||||
|
||||
31
src/main/java/com/hbm/blocks/fluid/GenericFluid.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.hbm.blocks.fluid;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class GenericFluid extends Fluid {
|
||||
|
||||
public GenericFluid(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon() {
|
||||
return getStillIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getStillIcon() {
|
||||
return this.block.getIcon(0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getFlowingIcon() {
|
||||
return this.block.getIcon(1, 0);
|
||||
}
|
||||
}
|
||||
96
src/main/java/com/hbm/blocks/fluid/GenericFluidBlock.java
Normal file
@ -0,0 +1,96 @@
|
||||
package com.hbm.blocks.fluid;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.passive.EntitySquid;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class GenericFluidBlock extends BlockFluidClassic {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static IIcon stillIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static IIcon flowingIcon;
|
||||
public Random rand = new Random();
|
||||
|
||||
private String stillName;
|
||||
private String flowingName;
|
||||
|
||||
public float damage;
|
||||
public DamageSource damageSource;
|
||||
|
||||
public GenericFluidBlock(Fluid fluid, Material material, String still, String flowing) {
|
||||
super(fluid, material);
|
||||
setCreativeTab(null);
|
||||
stillName = still;
|
||||
flowingName = flowing;
|
||||
displacements.put(this, false);
|
||||
}
|
||||
|
||||
public GenericFluidBlock setDamage(DamageSource source, float amount) {
|
||||
damageSource = source;
|
||||
damage = amount;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return (side == 0 || side == 1) ? stillIcon : flowingIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
stillIcon = register.registerIcon(RefStrings.MODID + ":" + stillName);
|
||||
flowingIcon = register.registerIcon(RefStrings.MODID + ":" + flowingName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
|
||||
if(damageSource != null) {
|
||||
|
||||
if(entity instanceof EntityItem) {
|
||||
|
||||
entity.motionX = 0;
|
||||
entity.motionY = 0;
|
||||
entity.motionZ = 0;
|
||||
|
||||
if(entity.ticksExisted % 20 == 0 && !world.isRemote) {
|
||||
entity.attackEntityFrom(damageSource, damage * 0.1F);
|
||||
}
|
||||
if(entity.ticksExisted % 5 == 0) {
|
||||
world.spawnParticle("cloud", entity.posX, entity.posY, entity.posZ, 0.0, 0.0, 0.0);
|
||||
}
|
||||
} else {
|
||||
|
||||
if(entity.motionY < -0.2)
|
||||
entity.motionY *= 0.5;
|
||||
|
||||
if(!world.isRemote) {
|
||||
entity.attackEntityFrom(damageSource, damage);
|
||||
}
|
||||
}
|
||||
|
||||
if(entity.ticksExisted % 5 == 0) {
|
||||
world.playSoundAtEntity(entity, "random.fizz", 0.2F, 1F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -77,7 +77,9 @@ public class SchrabidicBlock extends BlockFluidClassic {
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
entity.setInWeb();
|
||||
|
||||
if(this.getMaterial() == ModBlocks.fluidschrabidic)
|
||||
entity.setInWeb();
|
||||
|
||||
if(entity instanceof EntityLivingBase)
|
||||
ContaminationUtil.contaminate((EntityLivingBase)entity, HazardType.RADIATION, ContaminationType.CREATIVE, 1.0F);
|
||||
@ -97,7 +99,7 @@ public class SchrabidicBlock extends BlockFluidClassic {
|
||||
}
|
||||
|
||||
public boolean reactToBlocks(World world, int x, int y, int z) {
|
||||
if(world.getBlock(x, y, z).getMaterial() != ModBlocks.fluidschrabidic) {
|
||||
if(world.getBlock(x, y, z).getMaterial() != this.getMaterial()) {
|
||||
if(world.getBlock(x, y, z).getMaterial().isLiquid()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
109
src/main/java/com/hbm/blocks/generic/BlockMotherOfAllOres.java
Normal file
@ -0,0 +1,109 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockMotherOfAllOres extends BlockContainer implements IBlockMultiPass {
|
||||
|
||||
public BlockMotherOfAllOres() {
|
||||
super(Material.rock);
|
||||
this.blockIcon = Blocks.stone.getIcon(0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityRandomOre();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityRandomOre) {
|
||||
return ((TileEntityRandomOre) te).getStack().copy();
|
||||
}
|
||||
|
||||
return super.getPickBlock(target, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return IBlockMultiPass.getRenderType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPasses() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
private IIcon[] overlays = new IIcon[10];
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
for(int i = 0; i < overlays.length; i++) {
|
||||
overlays[i] = reg.registerIcon(RefStrings.MODID + ":ore_random_" + (i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
|
||||
if(RenderBlockMultipass.currentPass == 0)
|
||||
return this.blockIcon;
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityRandomOre) {
|
||||
TileEntityRandomOre ore = (TileEntityRandomOre) te;
|
||||
ItemStack item = ore.getStack();
|
||||
|
||||
if(item != null) {
|
||||
ComparableStack stack = new ComparableStack(item);
|
||||
int index = stack.hashCode() % overlays.length;
|
||||
return overlays[index];
|
||||
}
|
||||
}
|
||||
|
||||
return this.getIcon(side, world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
|
||||
if(RenderBlockMultipass.currentPass == 0)
|
||||
return 0xffffff;
|
||||
|
||||
return super.colorMultiplier(world, x, y, z);
|
||||
}
|
||||
|
||||
public static class TileEntityRandomOre extends TileEntity {
|
||||
|
||||
public ItemStack getStack() {
|
||||
return new ItemStack(Blocks.dirt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
25
src/main/java/com/hbm/blocks/generic/BlockResourceStone.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.blocks.BlockEnums;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockResourceStone extends BlockEnumMulti {
|
||||
|
||||
public BlockResourceStone() {
|
||||
super(Material.rock, BlockEnums.EnumStoneType.class, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int fortune) {
|
||||
|
||||
if(meta == BlockEnums.EnumStoneType.ASBESTOS.ordinal()) {
|
||||
world.setBlock(x, y, z, ModBlocks.gas_asbestos);
|
||||
}
|
||||
|
||||
super.dropBlockAsItemWithChance(world, x, y, z, meta, chance, fortune);
|
||||
}
|
||||
}
|
||||
@ -40,6 +40,7 @@ public class BlockStalagmite extends BlockEnumMulti {
|
||||
|
||||
switch(meta) {
|
||||
case 0: return ModItems.sulfur;
|
||||
case 1: return ModItems.powder_asbestos;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
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.tileentity.TileEntity;
|
||||
@ -21,9 +23,15 @@ public class BlockCable extends BlockContainer {
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityCableBaseNT();
|
||||
}
|
||||
|
||||
public static int renderIDClassic = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
|
||||
if(this == ModBlocks.red_cable_classic)
|
||||
return renderIDClassic;
|
||||
|
||||
return TestConductor.renderID;
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
@ -119,7 +120,7 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
|
||||
return new TileEntityDiode();
|
||||
}
|
||||
|
||||
public static class TileEntityDiode extends TileEntity implements IEnergyUser {
|
||||
public static class TileEntityDiode extends TileEntityLoadedBase implements IEnergyUser {
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
@ -17,29 +17,29 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityMissileAntiBallistic extends Entity implements IRadarDetectable {
|
||||
|
||||
|
||||
int activationTimer;
|
||||
|
||||
public EntityMissileAntiBallistic(World p_i1582_1_) {
|
||||
super(p_i1582_1_);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
public void onUpdate() {
|
||||
|
||||
if(activationTimer < 40) {
|
||||
activationTimer++;
|
||||
|
||||
|
||||
motionY = 1.5D;
|
||||
|
||||
this.setLocationAndAngles(posX + this.motionX, posY + this.motionY, posZ + this.motionZ, 0, 0);
|
||||
this.rotation();
|
||||
|
||||
if(!this.worldObj.isRemote)
|
||||
this.rotation();
|
||||
|
||||
if(!this.worldObj.isRemote && this.posY < 400)
|
||||
this.worldObj.spawnEntityInWorld(new EntitySmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0));
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if(activationTimer == 40) {
|
||||
ExplosionLarge.spawnParticlesRadial(worldObj, posX, posY, posZ, 15);
|
||||
activationTimer = 100;
|
||||
@ -50,9 +50,9 @@ public class EntityMissileAntiBallistic extends Entity implements IRadarDetectab
|
||||
targetMissile();
|
||||
|
||||
this.setLocationAndAngles(posX + this.motionX, posY + this.motionY, posZ + this.motionZ, 0, 0);
|
||||
this.rotation();
|
||||
|
||||
if(!this.worldObj.isRemote)
|
||||
this.rotation();
|
||||
|
||||
if(!this.worldObj.isRemote && this.posY < 400)
|
||||
this.worldObj.spawnEntityInWorld(new EntitySmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0));
|
||||
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(posX - 5, posY - 5, posZ - 5, posX + 5, posY + 5, posZ + 5));
|
||||
@ -66,70 +66,66 @@ public class EntityMissileAntiBallistic extends Entity implements IRadarDetectab
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.posY > 2000)
|
||||
this.setDead();
|
||||
|
||||
if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.air &&
|
||||
this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.water &&
|
||||
this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.flowing_water) {
|
||||
|
||||
if(!this.worldObj.isRemote)
|
||||
{
|
||||
if(this.worldObj.getBlock((int) this.posX, (int) this.posY, (int) this.posZ) != Blocks.air && this.worldObj.getBlock((int) this.posX, (int) this.posY, (int) this.posZ) != Blocks.water && this.worldObj.getBlock((int) this.posX, (int) this.posY, (int) this.posZ) != Blocks.flowing_water) {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 10F, true, true, true);
|
||||
}
|
||||
this.setDead();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void rotation() {
|
||||
float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
|
||||
for (this.rotationPitch = (float)(Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
|
||||
{
|
||||
this.prevRotationPitch += 360.0F;
|
||||
}
|
||||
|
||||
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
|
||||
{
|
||||
this.prevRotationYaw -= 360.0F;
|
||||
}
|
||||
|
||||
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
|
||||
{
|
||||
this.prevRotationYaw += 360.0F;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void rotation() {
|
||||
float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
|
||||
for(this.rotationPitch = (float) (Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
|
||||
;
|
||||
}
|
||||
|
||||
while(this.rotationPitch - this.prevRotationPitch >= 180.0F) {
|
||||
this.prevRotationPitch += 360.0F;
|
||||
}
|
||||
|
||||
while(this.rotationYaw - this.prevRotationYaw < -180.0F) {
|
||||
this.prevRotationYaw -= 360.0F;
|
||||
}
|
||||
|
||||
while(this.rotationYaw - this.prevRotationYaw >= 180.0F) {
|
||||
this.prevRotationYaw += 360.0F;
|
||||
}
|
||||
}
|
||||
|
||||
private void targetMissile() {
|
||||
|
||||
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(posX - 500, 0, posZ - 500, posX + 500, 5000, posZ + 500));
|
||||
|
||||
|
||||
Entity target = null;
|
||||
double closest = 1000D;
|
||||
|
||||
|
||||
for(Entity e : list) {
|
||||
if(e instanceof EntityMissileBaseAdvanced || e instanceof EntityMissileCustom) {
|
||||
double dis = Math.sqrt(Math.pow(e.posX - posX, 2) + Math.pow(e.posY - posY, 2) + Math.pow(e.posZ - posZ, 2));
|
||||
|
||||
|
||||
if(dis < closest) {
|
||||
closest = dis;
|
||||
target = e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(target != null) {
|
||||
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper(target.posX - posX, target.posY - posY, target.posZ - posZ);
|
||||
|
||||
vec.normalize();
|
||||
|
||||
|
||||
this.motionX = vec.xCoord * 0.065D;
|
||||
this.motionY = vec.yCoord * 0.065D;
|
||||
this.motionZ = vec.zCoord * 0.065D;
|
||||
@ -138,25 +134,24 @@ public class EntityMissileAntiBallistic extends Entity implements IRadarDetectab
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isInRangeToRenderDist(double distance)
|
||||
{
|
||||
return distance < 500000;
|
||||
}
|
||||
public boolean isInRangeToRenderDist(double distance) {
|
||||
return distance < 500000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadarTargetType getTargetType() {
|
||||
|
||||
@ -344,7 +344,7 @@ public class OreDictManager {
|
||||
EUPH .nugget(nugget_euphemium) .ingot(ingot_euphemium) .dust(powder_euphemium) .block(block_euphemium);
|
||||
DNT .nugget(nugget_dineutronium) .ingot(ingot_dineutronium) .dust(powder_dineutronium) .block(block_dineutronium);
|
||||
FIBER .ingot(ingot_fiberglass) .block(block_fiberglass);
|
||||
ASBESTOS .asbestos(1F) .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, basalt_asbestos);
|
||||
ASBESTOS .asbestos(1F) .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, basalt_asbestos, DictFrame.fromOne(stone_resource, EnumStoneType.ASBESTOS));
|
||||
OSMIRIDIUM .nugget(nugget_osmiridium) .ingot(ingot_osmiridium);
|
||||
|
||||
/*
|
||||
|
||||
@ -938,6 +938,7 @@ public class ModItems {
|
||||
public static Item can_luna;
|
||||
public static Item can_bepis;
|
||||
public static Item can_breen;
|
||||
public static Item can_mug;
|
||||
public static Item mucho_mango;
|
||||
public static Item bottle_empty;
|
||||
public static Item bottle_nuka;
|
||||
@ -3458,8 +3459,9 @@ public class ModItems {
|
||||
can_mrsugar = new ItemEnergy().setUnlocalizedName("can_mrsugar").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_mrsugar");
|
||||
can_overcharge = new ItemEnergy().setUnlocalizedName("can_overcharge").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_overcharge");
|
||||
can_luna = new ItemEnergy().setUnlocalizedName("can_luna").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_luna");
|
||||
can_bepis = new ItemEnergy().setUnlocalizedName("can_bepis").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_bepis");;
|
||||
can_bepis = new ItemEnergy().setUnlocalizedName("can_bepis").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_bepis");
|
||||
can_breen = new ItemEnergy().setUnlocalizedName("can_breen").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_breen");
|
||||
can_mug = new ItemEnergy().setUnlocalizedName("can_mug").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_mug");
|
||||
bottle_empty = new Item().setUnlocalizedName("bottle_empty").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":bottle_empty");
|
||||
bottle_nuka = new ItemEnergy().setUnlocalizedName("bottle_nuka").setContainerItem(ModItems.bottle_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":bottle_nuka");
|
||||
bottle_cherry = new ItemEnergy().setUnlocalizedName("bottle_cherry").setContainerItem(ModItems.bottle_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":bottle_cherry");
|
||||
@ -7602,6 +7604,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(can_luna, can_luna.getUnlocalizedName());
|
||||
GameRegistry.registerItem(can_bepis, can_bepis.getUnlocalizedName());
|
||||
GameRegistry.registerItem(can_breen, can_breen.getUnlocalizedName());
|
||||
GameRegistry.registerItem(can_mug, can_mug.getUnlocalizedName());
|
||||
|
||||
//Coffee
|
||||
GameRegistry.registerItem(coffee, coffee.getUnlocalizedName());
|
||||
|
||||
@ -13,7 +13,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class ItemChemistryIcon extends Item {
|
||||
@ -59,6 +58,12 @@ public class ItemChemistryIcon extends Item {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int i) {
|
||||
return this.icons[ChemplantRecipes.indexMapping.get(i).listing % this.icons.length];
|
||||
ChemRecipe rec = ChemplantRecipes.indexMapping.get(i);
|
||||
|
||||
if(rec != null) {
|
||||
return this.icons[rec.listing % this.icons.length];
|
||||
} else {
|
||||
return ModItems.nothing.getIconFromDamage(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -29,7 +28,7 @@ public class ItemStamp extends Item {
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
if(this.type == StampType.PLATE || this.type == StampType.WIRE || this.type == StampType.CIRCUIT)
|
||||
if((this.type == StampType.PLATE || this.type == StampType.WIRE || this.type == StampType.CIRCUIT) && this.getMaxDamage() > 0)
|
||||
list.add("[CREATED USING TEMPLATE FOLDER]");
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ public class ItemCraftingDegradation extends Item {
|
||||
public ItemCraftingDegradation(int durability) {
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(durability);
|
||||
this.setNoRepair();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -679,6 +679,7 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderAnvil());
|
||||
RenderingRegistry.registerBlockHandler(new RenderCrystal());
|
||||
RenderingRegistry.registerBlockHandler(new RenderTestCable());
|
||||
RenderingRegistry.registerBlockHandler(new RenderCableClassic());
|
||||
RenderingRegistry.registerBlockHandler(new RenderTestPipe());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockCT());
|
||||
RenderingRegistry.registerBlockHandler(new RenderDetCord());
|
||||
|
||||
@ -974,8 +974,9 @@ public class MainRegistry {
|
||||
|
||||
//expand for the largest entity we have (currently Quackos who is 17.5m in diameter, that's one fat duck)
|
||||
World.MAX_ENTITY_RADIUS = Math.max(World.MAX_ENTITY_RADIUS, 8.75);
|
||||
|
||||
new OreCave(ModBlocks.stone_resource, 0).setThreshold(1.5D).setRangeMult(20).setYLevel(30).setMaxRange(20);
|
||||
|
||||
new OreCave(ModBlocks.stone_resource, 0).setThreshold(1.5D).setRangeMult(20).setYLevel(30).setMaxRange(20).withFluid(ModBlocks.sulfuric_acid_block); //sulfur
|
||||
new OreCave(ModBlocks.stone_resource, 1).setThreshold(1.75D).setRangeMult(20).setYLevel(25).setMaxRange(20); //asbestos
|
||||
//new OreLayer(Blocks.coal_ore, 0.2F).setThreshold(4).setRangeMult(3).setYLevel(70);
|
||||
}
|
||||
|
||||
|
||||
@ -366,7 +366,7 @@ public class ResourceManager {
|
||||
|
||||
//Tank
|
||||
public static final ResourceLocation tank_tex = new ResourceLocation(RefStrings.MODID, "textures/models/tank.png");
|
||||
public static final ResourceLocation tank_label_tex = new ResourceLocation(RefStrings.MODID, "textures/models/tank_NONE.png");
|
||||
public static final ResourceLocation tank_label_tex = new ResourceLocation(RefStrings.MODID, "textures/models/tank_label/tank_NONE.png");
|
||||
public static final ResourceLocation bat9000_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/bat9000.png");
|
||||
public static final ResourceLocation orbus_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/orbus.png");
|
||||
|
||||
|
||||
@ -66,7 +66,6 @@ public class RenderBlockMultipass implements ISimpleBlockRenderingHandler {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
//int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
|
||||
@ -82,8 +81,6 @@ public class RenderBlockMultipass implements ISimpleBlockRenderingHandler {
|
||||
|
||||
for(int i = 0; i < passes; i++) {
|
||||
currentPass = i;
|
||||
//System.out.println(multi.getColorFromPass(world, x, y, z, false));
|
||||
//tessellator.setColorOpaque_I(multi.getColorFromPass(world, x, y, z, false));
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
|
||||
66
src/main/java/com/hbm/render/block/RenderCableClassic.java
Normal file
@ -0,0 +1,66 @@
|
||||
package com.hbm.render.block;
|
||||
|
||||
import com.hbm.blocks.network.BlockCable;
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class RenderCableClassic implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { }
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
IIcon iicon = block.getIcon(0, 0);
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
if(renderer.hasOverrideBlockTexture()) {
|
||||
iicon = renderer.overrideBlockTexture;
|
||||
}
|
||||
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
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);
|
||||
|
||||
double spanU = iicon.getMaxU() - iicon.getMinU();
|
||||
double spanV = iicon.getMaxV() - iicon.getMinV();
|
||||
double px = 0.0625D;
|
||||
|
||||
double uv_cL = iicon.getMinU();
|
||||
double uv_cR = iicon.getMinU() + spanU * 5 / px;
|
||||
double uv_cT = iicon.getMaxV();
|
||||
double uv_cB = iicon.getMaxV() - spanV * 5 / px;
|
||||
|
||||
double pos_min = px * 5.5D;
|
||||
double pos_max = px * 10.5D;
|
||||
|
||||
//TODO: all that manual tessellator crap
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BlockCable.renderIDClassic;
|
||||
}
|
||||
|
||||
}
|
||||
@ -100,10 +100,20 @@ public class ModelGasMask extends ModelBiped {
|
||||
@Override
|
||||
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1.15F, 1.15F, 1.15F);
|
||||
this.mask.render(par7);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if(this.isChild) {
|
||||
float f6 = 2.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1.5F / f6, 1.5F / f6, 1.5F / f6);
|
||||
GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F);
|
||||
this.mask.render(par7);
|
||||
GL11.glPopMatrix();
|
||||
} else {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1.15F, 1.15F, 1.15F);
|
||||
this.mask.render(par7);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
protected void convertToChild(ModelRenderer parParent, ModelRenderer parChild) {
|
||||
|
||||
@ -14,68 +14,52 @@ import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
public class RenderFluidTank extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
switch(tileEntity.getBlockMetadata())
|
||||
{
|
||||
case 2:
|
||||
GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4:
|
||||
GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3:
|
||||
GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5:
|
||||
GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
switch(tileEntity.getBlockMetadata()) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
bindTexture(ResourceManager.tank_tex);
|
||||
bindTexture(ResourceManager.tank_tex);
|
||||
ResourceManager.fluidtank.renderPart("Tank");
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
renderTileEntityAt2(tileEntity, x, y, z, f);
|
||||
}
|
||||
|
||||
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
renderTileEntityAt2(tileEntity, x, y, z, f);
|
||||
}
|
||||
|
||||
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
switch(tileEntity.getBlockMetadata())
|
||||
{
|
||||
case 2:
|
||||
GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
//GL11.glTranslated(0.5D, 0.0D, 0.0D);
|
||||
case 4:
|
||||
GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
//GL11.glTranslated(0.5D, 0.0D, 0.0D);
|
||||
case 3:
|
||||
GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
//GL11.glTranslated(0.5D, 0.0D, 0.0D);
|
||||
case 5:
|
||||
GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
//GL11.glTranslated(0.5D, 0.0D, 0.0D);
|
||||
switch(tileEntity.getBlockMetadata()) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
String s = "NONE";
|
||||
if(tileEntity instanceof TileEntityMachineFluidTank)
|
||||
s = ((TileEntityMachineFluidTank)tileEntity).tank.getTankType().name();
|
||||
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID, "textures/models/tank_" + s + ".png"));
|
||||
ResourceManager.fluidtank.renderPart("Label");
|
||||
s = ((TileEntityMachineFluidTank) tileEntity).tank.getTankType().name();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID, "textures/models/tank_label/tank_" + s + ".png"));
|
||||
ResourceManager.fluidtank.renderPart("Label");
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
20
src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java
Normal file
@ -0,0 +1,20 @@
|
||||
package com.hbm.tileentity;
|
||||
|
||||
import api.hbm.energy.ILoadedTile;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityLoadedBase extends TileEntity implements ILoadedTile {
|
||||
|
||||
public boolean isLoaded = true;
|
||||
|
||||
@Override
|
||||
public boolean isLoaded() {
|
||||
return isLoaded;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
this.isLoaded = false;
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,7 @@ import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.NBTPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.ILoadedTile;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -15,7 +16,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
||||
public abstract class TileEntityMachineBase extends TileEntity implements ISidedInventory, INBTPacketReceiver {
|
||||
public abstract class TileEntityMachineBase extends TileEntityLoadedBase implements ISidedInventory, INBTPacketReceiver {
|
||||
|
||||
public ItemStack slots[];
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import com.hbm.tileentity.machine.TileEntityHadron;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityProxyBase extends TileEntity {
|
||||
public class TileEntityProxyBase extends TileEntityLoadedBase {
|
||||
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
|
||||
@ -8,7 +8,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
||||
public abstract class TileEntityTickingBase extends TileEntity implements INBTPacketReceiver {
|
||||
public abstract class TileEntityTickingBase extends TileEntityLoadedBase implements INBTPacketReceiver {
|
||||
|
||||
public TileEntityTickingBase() { }
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@ import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEMissileMultipartPacket;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.item.IDesignatorItem;
|
||||
@ -39,7 +40,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCompactLauncher extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor, IEnergyUser {
|
||||
public class TileEntityCompactLauncher extends TileEntityLoadedBase implements ISidedInventory, IFluidContainer, IFluidAcceptor, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEMissilePacket;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -18,7 +19,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityLaunchPad extends TileEntity implements ISidedInventory, IEnergyUser {
|
||||
public class TileEntityLaunchPad extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser {
|
||||
|
||||
public ItemStack slots[];
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@ import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEMissileMultipartPacket;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.item.IDesignatorItem;
|
||||
@ -36,7 +37,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityLaunchTable extends TileEntity implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor {
|
||||
public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.NBTPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -25,7 +26,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFluidSource, IEnergyGenerator, INBTPacketReceiver {
|
||||
public class TileEntityChungus extends TileEntityLoadedBase implements IFluidAcceptor, IFluidSource, IEnergyGenerator, INBTPacketReceiver {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000000000L;
|
||||
|
||||
@ -4,6 +4,7 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IFactory;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -17,7 +18,7 @@ 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 {
|
||||
public class TileEntityCoreAdvanced extends TileEntityLoadedBase implements ISidedInventory, IFactory, IEnergyUser {
|
||||
|
||||
public int progress = 0;
|
||||
public long power = 0;
|
||||
|
||||
@ -5,6 +5,7 @@ import com.hbm.interfaces.IFactory;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -18,7 +19,7 @@ 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 {
|
||||
public class TileEntityCoreTitanium extends TileEntityLoadedBase implements ISidedInventory, IFactory, IEnergyUser {
|
||||
|
||||
public int progress = 0;
|
||||
public long power = 0;
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
@ -14,6 +12,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.world.machine.FWatz;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
@ -24,10 +23,9 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, IReactor, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
public class TileEntityFWatzCore extends TileEntityLoadedBase implements ISidedInventory, IReactor, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
public long power;
|
||||
public final static long maxPower = 10000000000L;
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEFFPacket;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -24,7 +25,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityForceField extends TileEntity implements ISidedInventory, IEnergyUser {
|
||||
public class TileEntityForceField extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.List;
|
||||
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
public class TileEntityGeiger extends TileEntity {
|
||||
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.machine.BlockHadronPower;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityHadronPower extends TileEntity implements IEnergyUser {
|
||||
public class TileEntityHadronPower extends TileEntityLoadedBase implements IEnergyUser {
|
||||
|
||||
public long power;
|
||||
|
||||
|
||||
@ -1,20 +1,15 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineAmgen extends TileEntity implements IEnergyGenerator {
|
||||
public class TileEntityMachineAmgen extends TileEntityLoadedBase implements IEnergyGenerator {
|
||||
|
||||
public long power;
|
||||
public long maxPower = 500;
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -19,7 +20,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityMachineArcFurnace extends TileEntity implements ISidedInventory, IEnergyUser {
|
||||
public class TileEntityMachineArcFurnace extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -29,7 +30,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineBoilerElectric extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource, IEnergyUser {
|
||||
public class TileEntityMachineBoilerElectric extends TileEntityLoadedBase implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
@ -12,6 +9,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -22,10 +20,9 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
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 TileEntityMachineCMBFactory extends TileEntity implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor {
|
||||
public class TileEntityMachineCMBFactory extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -18,7 +18,6 @@ import com.hbm.util.InventoryUtil;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -6,13 +6,9 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.machine.MachineCoal;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
@ -25,12 +21,13 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
|
||||
public class TileEntityMachineCoal extends TileEntity implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
public class TileEntityMachineCoal extends TileEntityLoadedBase implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineDetector extends TileEntity implements IEnergyUser {
|
||||
public class TileEntityMachineDetector extends TileEntityLoadedBase implements IEnergyUser {
|
||||
|
||||
long power;
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.inventory.recipes.MachineRecipes;
|
||||
import com.hbm.inventory.recipes.PressRecipes;
|
||||
import com.hbm.items.machine.ItemStamp;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEPressPacket;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -22,7 +22,7 @@ import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineEPress extends TileEntity implements ISidedInventory, IEnergyUser {
|
||||
public class TileEntityMachineEPress extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -15,10 +16,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineElectricFurnace extends TileEntity implements ISidedInventory, IEnergyUser {
|
||||
public class TileEntityMachineElectricFurnace extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -5,12 +5,13 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineMiniRTG extends TileEntity implements IEnergyGenerator {
|
||||
public class TileEntityMachineMiniRTG extends TileEntityLoadedBase implements IEnergyGenerator {
|
||||
|
||||
public long power;
|
||||
boolean tact = false;
|
||||
|
||||
@ -4,6 +4,7 @@ import com.hbm.config.VersatileConfig;
|
||||
import com.hbm.items.machine.ItemRTGPellet;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.RTGUtil;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
@ -13,10 +14,9 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
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 TileEntityMachineRTG extends TileEntity implements ISidedInventory, IEnergyGenerator {
|
||||
public class TileEntityMachineRTG extends TileEntityLoadedBase implements ISidedInventory, IEnergyGenerator {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -1,16 +1,13 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityMachineSPP extends TileEntity implements IEnergyGenerator {
|
||||
public class TileEntityMachineSPP extends TileEntityLoadedBase implements IEnergyGenerator {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
@ -17,6 +15,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
@ -26,10 +25,9 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
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 TileEntityMachineSeleniumEngine extends TileEntity implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
public class TileEntityMachineSeleniumEngine extends TileEntityLoadedBase implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.interfaces.Untested;
|
||||
import com.hbm.inventory.recipes.ShredderRecipes;
|
||||
import com.hbm.items.machine.ItemBlades;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -15,10 +15,9 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
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 TileEntityMachineShredder extends TileEntity implements ISidedInventory, IEnergyUser {
|
||||
public class TileEntityMachineShredder extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -14,7 +15,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityMachineTeleporter extends TileEntity implements IEnergyUser {
|
||||
public class TileEntityMachineTeleporter extends TileEntityLoadedBase implements IEnergyUser {
|
||||
|
||||
public long power = 0;
|
||||
public int targetX = 0;
|
||||
|
||||
@ -13,6 +13,7 @@ import com.hbm.inventory.recipes.MachineRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
@ -22,10 +23,9 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
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 TileEntityMachineTurbine extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource, IEnergyGenerator {
|
||||
public class TileEntityMachineTurbine extends TileEntityLoadedBase implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource, IEnergyGenerator {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@ -19,6 +18,7 @@ import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.LoopedSoundPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TETurbofanPacket;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -34,7 +34,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
@Spaghetti("a")
|
||||
public class TileEntityMachineTurbofan extends TileEntity implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
public class TileEntityMachineTurbofan extends TileEntityLoadedBase implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -3,19 +3,18 @@ package com.hbm.tileentity.machine;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityRadiobox extends TileEntity implements IEnergyUser {
|
||||
public class TileEntityRadiobox extends TileEntityLoadedBase implements IEnergyUser {
|
||||
|
||||
long power;
|
||||
public static long maxPower = 500000;
|
||||
|
||||
@ -21,6 +21,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -30,12 +31,11 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityWatzCore extends TileEntity implements ISidedInventory, IReactor, IEnergyGenerator, IFluidContainer, IFluidSource {
|
||||
public class TileEntityWatzCore extends TileEntityLoadedBase implements ISidedInventory, IReactor, IEnergyGenerator, IFluidContainer, IFluidSource {
|
||||
|
||||
public long power;
|
||||
public final static long maxPower = 100000000;
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.entity.particle.EntityGasFlameFX;
|
||||
@ -14,6 +12,7 @@ import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
@ -28,7 +27,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityMachineGasFlare extends TileEntity implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
public class TileEntityMachineGasFlare extends TileEntityLoadedBase implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
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;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity.network;
|
||||
|
||||
import com.hbm.calc.Location;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyConnector;
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
@ -8,7 +9,7 @@ import cofh.api.energy.IEnergyReceiver;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityConverterHeRf extends TileEntity implements IEnergyConnector, IEnergyHandler {
|
||||
public class TileEntityConverterHeRf extends TileEntityLoadedBase implements IEnergyConnector, IEnergyHandler {
|
||||
|
||||
//Thanks to the great people of Fusion Warfare for helping me with the original implementation of the RF energy API
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
package com.hbm.tileentity.network;
|
||||
|
||||
import com.hbm.interfaces.Untested;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityConverterRfHe extends TileEntity implements IEnergyGenerator, IEnergyHandler {
|
||||
public class TileEntityConverterRfHe extends TileEntityLoadedBase implements IEnergyGenerator, IEnergyHandler {
|
||||
|
||||
@Override
|
||||
public void setPower(long power) {
|
||||
|
||||
159
src/main/java/com/hbm/util/ColorUtil.java
Normal file
@ -0,0 +1,159 @@
|
||||
package com.hbm.util;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class ColorUtil {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static BufferedImage getImageFromStack(ItemStack stack) throws IOException {
|
||||
String iconName = stack.getItem().getIconFromDamage(stack.getItemDamage()).getIconName();
|
||||
String domain = "minecraft";
|
||||
|
||||
if(iconName.contains(":")) {
|
||||
String[] parts = iconName.split(":");
|
||||
domain = parts[0];
|
||||
iconName = parts[1];
|
||||
}
|
||||
|
||||
ResourceLocation loc = new ResourceLocation(domain, "textures/items/" + iconName + ".png");
|
||||
|
||||
return ImageIO.read(Minecraft.getMinecraft().getResourceManager().getResource(loc).getInputStream());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static int getAverageColorFromStack(ItemStack stack) {
|
||||
|
||||
try {
|
||||
BufferedImage tex = getImageFromStack(stack);
|
||||
|
||||
int r = 0;
|
||||
int g = 0;
|
||||
int b = 0;
|
||||
int pixels = 0;
|
||||
|
||||
for(int i = 0; i < tex.getWidth(); i++) {
|
||||
for(int j = 0; j < tex.getHeight(); j++) {
|
||||
|
||||
Color pixel = new Color(tex.getRGB(i, j));
|
||||
|
||||
if(pixel.getAlpha() == 255) {
|
||||
r += pixel.getRed();
|
||||
g += pixel.getGreen();
|
||||
b += pixel.getBlue();
|
||||
pixels++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int avgR = r / pixels;
|
||||
int avgG = g / pixels;
|
||||
int avgB = b / pixels;
|
||||
|
||||
return (r << 16) | (g << 8) | b;
|
||||
|
||||
} catch(Exception ex) {
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static int getMedianBrightnessColorFromStack(ItemStack stack) {
|
||||
|
||||
try {
|
||||
BufferedImage tex = getImageFromStack(stack);
|
||||
|
||||
HashMap<Integer, Color> brightMap = new HashMap();
|
||||
List<Integer> brightnesses = new ArrayList();
|
||||
|
||||
for(int i = 0; i < tex.getWidth(); i++) {
|
||||
for(int j = 0; j < tex.getHeight(); j++) {
|
||||
|
||||
Color pixel = new Color(tex.getRGB(i, j));
|
||||
int brightness = pixel.getRed() * pixel.getRed() + pixel.getGreen() * pixel.getGreen() + pixel.getBlue() * pixel.getBlue();
|
||||
brightnesses.add(brightness);
|
||||
brightMap.put(brightness, pixel); //overlap possible, but we don't differentiate between colors anyway.
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(brightnesses);
|
||||
int median = brightnesses.get(brightnesses.size() / 2);
|
||||
Color medianColor = brightMap.get(median);
|
||||
|
||||
return medianColor.getRGB();
|
||||
|
||||
} catch(Exception ex) {
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decides whether a color is considered "colorful", i.e. weeds out colors that are too dark or too close to gray.
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
||||
public static boolean isColorColorful(int hex) {
|
||||
Color color = new Color(hex);
|
||||
|
||||
/*double r = color.getRed();
|
||||
double g = color.getBlue();
|
||||
double b = color.getGreen();
|
||||
|
||||
if(r < 50 && g < 50 && b < 50)
|
||||
return false;
|
||||
|
||||
if(r / g > 1.5) return true;
|
||||
if(r / b > 1.5) return true;
|
||||
if(g / r > 1.5) return true;
|
||||
if(g / b > 1.5) return true;
|
||||
if(b / r > 1.5) return true;
|
||||
if(b / g > 1.5) return true;*/
|
||||
|
||||
float[] hsb = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), new float[0]);
|
||||
|
||||
// saturation brightness
|
||||
return hsb[1] > 0.25 && hsb[2] > 0.25;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raises the highest RGB component to the specified limit, scaling the other components with it.
|
||||
* @param hex
|
||||
* @param limit
|
||||
* @return
|
||||
*/
|
||||
public static int amplifyColor(int hex, int limit) {
|
||||
Color color = new Color(hex);
|
||||
int r = color.getRed();
|
||||
int g = color.getGreen();
|
||||
int b = color.getBlue();
|
||||
int max = Math.max(r, Math.max(g, b));
|
||||
|
||||
r = r * limit / max;
|
||||
g = g * limit / max;
|
||||
b = b * limit / max;
|
||||
|
||||
return new Color(r, g, b).getRGB();
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as the regular amplifyColor but it uses 255 as the limit.
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
||||
public static int amplifyColor(int hex) {
|
||||
return amplifyColor(hex, 255);
|
||||
}
|
||||
}
|
||||
@ -28,6 +28,7 @@ public class OreCave {
|
||||
private int maxRange = 4;
|
||||
/** The y-level around which the stratum is centered. */
|
||||
private int yLevel = 30;
|
||||
private Block fluid;
|
||||
|
||||
public OreCave(Block ore) {
|
||||
this(ore, 0);
|
||||
@ -57,7 +58,13 @@ public class OreCave {
|
||||
this.yLevel = yLevel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OreCave withFluid(Block fluid) {
|
||||
this.fluid = fluid;
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
@SubscribeEvent
|
||||
public void onDecorate(DecorateBiomeEvent.Pre event) {
|
||||
|
||||
@ -95,15 +102,48 @@ public class OreCave {
|
||||
if(genTarget.isNormalCube() && (genTarget.getMaterial() == Material.rock || genTarget.getMaterial() == Material.ground)) {
|
||||
|
||||
boolean shouldGen = false;
|
||||
boolean canGenFluid = event.rand.nextBoolean();
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
Block neighbor = world.getBlock(MathHelper.clamp_int(x + dir.offsetX, cX, cX + 16), y + dir.offsetY, MathHelper.clamp_int(z + dir.offsetZ, cZ, cZ + 16));
|
||||
if(neighbor.getMaterial() == Material.air || neighbor instanceof BlockStalagmite) {
|
||||
shouldGen = true;
|
||||
}
|
||||
|
||||
if(shouldGen && (fluid == null || !canGenFluid))
|
||||
break;
|
||||
|
||||
if(fluid != null) {
|
||||
switch(dir) {
|
||||
case UP: if(neighbor.getMaterial() != Material.air && !(neighbor instanceof BlockStalagmite)) canGenFluid = false; break;
|
||||
case DOWN: if(!neighbor.isNormalCube()) canGenFluid = false; break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
case EAST:
|
||||
case WEST:
|
||||
if(!neighbor.isNormalCube() && neighbor != fluid) canGenFluid = false; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(shouldGen) world.setBlock(x, y, z, ore.block, ore.meta, 2);
|
||||
|
||||
if(fluid != null && canGenFluid) {
|
||||
world.setBlock(x, y, z, fluid, 0, 2);
|
||||
world.setBlock(x, y - 1, z, ore.block, ore.meta, 2);
|
||||
|
||||
for(int i = 2; i < 6; i++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||
int clX = MathHelper.clamp_int(x + dir.offsetX, cX, cX + 16);
|
||||
int clZ = MathHelper.clamp_int(z + dir.offsetZ, cZ, cZ + 16);
|
||||
Block neighbor = world.getBlock(clX, y, clZ);
|
||||
|
||||
if(neighbor.isNormalCube())
|
||||
world.setBlock(clX, y, clZ, ore.block, ore.meta, 2);
|
||||
}
|
||||
|
||||
} else if(shouldGen) {
|
||||
world.setBlock(x, y, z, ore.block, ore.meta, 2);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if((genTarget.getMaterial() == Material.air || !genTarget.isNormalCube()) && event.rand.nextInt(5) == 0) {
|
||||
|
||||
@ -206,6 +206,7 @@ armor.ignoreLimit=Сопротивление не зависит от преде
|
||||
armor.rocketBoots=Ракетные ботинки
|
||||
armor.sprintBoost=Ускоренный бег
|
||||
armor.projectileProtection=Модификатор урона %s от снарядов
|
||||
armor.dash=Даёт %s дешей
|
||||
|
||||
hazard.prot=Защищает от:
|
||||
hazard.noprot=НЕ защищает от:
|
||||
@ -1033,6 +1034,7 @@ chem.LUBRICANT=Смешивание машинной смазки
|
||||
chem.PETROIL_LEADED=Смешивание этилированного бензина
|
||||
chem.RUBBER=Производство резины
|
||||
chem.TNT=Синтез ТНТ
|
||||
chem.DYNAMITE=Синтез динамита
|
||||
|
||||
item.record.lc.desc=Valve - Diabolic Adrenaline Guitar/Lambda Core
|
||||
item.record.ss.desc=Valve - Sector Sweep
|
||||
@ -1894,7 +1896,7 @@ item.ingot_electronium.name=Электрониевый слиток
|
||||
item.ingot_fiberglass.name=Стекловолокно
|
||||
item.ingot_fiberglass.desc=С высоким содержанием волокна, с высоким содержанием стекла. Все, что нужно организму.
|
||||
item.ingot_asbestos.name=Асбестовый лист
|
||||
item.ingot_asbestos.desc=§o\"Наполненный жизнью, неуверенностью в себе и асбестом. Это приходит вместе с воздухом.\"§r
|
||||
item.ingot_asbestos.desc=§o"Наполненный жизнью, неуверенностью в себе и асбестом. Это приходит вместе с воздухом."§r
|
||||
|
||||
item.solid_fuel.name=Твердое топливо
|
||||
item.solid_fuel_presto.name=Топливное полено
|
||||
@ -2365,6 +2367,9 @@ tile.tile_lab.name=Лабораторная плитка
|
||||
tile.tile_lab_broken.name=Разбитая лабораторная плитка
|
||||
tile.tile_lab_cracked.name=Треснувшая лабораторная плитка
|
||||
tile.spikes.name=Шипы
|
||||
tile.stalactite.sulfur.name=Сернистый сталактит
|
||||
tile.stalagmite.sulfur.name=Сернистый сталагмит
|
||||
tile.stone_resource.sulfur.name=Сернистый камень
|
||||
tile.gas_asbestos.name=Частицы асбеста в воздухе
|
||||
tile.gas_flammable.name=Горючий газ
|
||||
tile.gas_monoxide.name=Угарный газ
|
||||
@ -3656,6 +3661,8 @@ item.rod_quad_euphemium.name=Выгоревший счетверённый шр
|
||||
item.plate_euphemium.name=Составная пластина из эвфемия
|
||||
item.plate_dineutronium.name=Составная пластина из динейтрония
|
||||
item.plate_desh.name=Составная пластина из деш
|
||||
item.plate_bismuth.name=Составная пластина из висмута
|
||||
item.plate_bismuth.desc=Ребята, клянусь, это алхимический символ Висмута.
|
||||
|
||||
item.plate_fuel_mox.name=МОКС-топливная пластина
|
||||
item.plate_fuel_pu238be.name=Плутоний-238-Бериллевая топливная пластина
|
||||
@ -4002,6 +4009,10 @@ item.hev_helmet.name=Шлем H.E.V Модели IV
|
||||
item.hev_legs.name=Поножи H.E.V Модели IV
|
||||
item.hev_battery.name=Батарея костюма
|
||||
tile.hev_battery.name=Батарея костюма
|
||||
item.bismuth_boots.name=Сандали из висмута
|
||||
item.bismuth_helmet.name=Головной убор из висмута
|
||||
item.bismuth_legs.name=Наколенники из висмута
|
||||
item.bismuth_plate.name=Наплечники, ожерелье и набедренная повязка из висмута
|
||||
|
||||
tile.mush.name=Светящийся гриб
|
||||
tile.waste_mycelium.name=Светящийся мицелий
|
||||
|
||||
|
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 210 B |
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 326 B |
|
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 229 B |
BIN
src/main/resources/assets/hbm/textures/blocks/ore_random_1.png
Normal file
|
After Width: | Height: | Size: 190 B |
BIN
src/main/resources/assets/hbm/textures/blocks/ore_random_10.png
Normal file
|
After Width: | Height: | Size: 269 B |
BIN
src/main/resources/assets/hbm/textures/blocks/ore_random_2.png
Normal file
|
After Width: | Height: | Size: 234 B |
BIN
src/main/resources/assets/hbm/textures/blocks/ore_random_3.png
Normal file
|
After Width: | Height: | Size: 153 B |
BIN
src/main/resources/assets/hbm/textures/blocks/ore_random_4.png
Normal file
|
After Width: | Height: | Size: 211 B |
BIN
src/main/resources/assets/hbm/textures/blocks/ore_random_5.png
Normal file
|
After Width: | Height: | Size: 257 B |
BIN
src/main/resources/assets/hbm/textures/blocks/ore_random_6.png
Normal file
|
After Width: | Height: | Size: 213 B |
BIN
src/main/resources/assets/hbm/textures/blocks/ore_random_7.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
src/main/resources/assets/hbm/textures/blocks/ore_random_8.png
Normal file
|
After Width: | Height: | Size: 234 B |
BIN
src/main/resources/assets/hbm/textures/blocks/ore_random_9.png
Normal file
|
After Width: | Height: | Size: 250 B |
|
After Width: | Height: | Size: 229 B |
|
After Width: | Height: | Size: 260 B |
|
After Width: | Height: | Size: 244 B |
BIN
src/main/resources/assets/hbm/textures/blocks/stone_gems.png
Normal file
|
After Width: | Height: | Size: 768 B |
|
After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 9.6 KiB |
@ -0,0 +1,3 @@
|
||||
{
|
||||
"animation": {}
|
||||
}
|
||||
|
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,5 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 2
|
||||
}
|
||||
}
|
||||
BIN
src/main/resources/assets/hbm/textures/blocks/water_flow.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,3 @@
|
||||
{
|
||||
"animation": {}
|
||||
}
|
||||
BIN
src/main/resources/assets/hbm/textures/blocks/water_still.png
Normal file
|
After Width: | Height: | Size: 14 KiB |