Merge branch 'HbmMods:master' into BallOfEnergy1-OC-Test-1

This commit is contained in:
BallOfEnergy 2023-04-19 21:42:07 -05:00 committed by GitHub
commit 242ee0d6e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
148 changed files with 7324 additions and 1857 deletions

View File

@ -102,6 +102,13 @@ processResources {
}
}
// add AT to meta-inf
jar {
manifest {
attributes 'FMLAT': 'HBM_at.cfg'
}
}
task version {
doFirst {
println project.version

View File

@ -1,6 +1,6 @@
mod_version=1.0.27
# Empty build number makes a release type
mod_build_number=4551
mod_build_number=4562
credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms),\
\ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models, porting),\

View File

@ -12,6 +12,7 @@ public interface IToolable {
HAND_DRILL,
DEFUSER,
WRENCH,
TORCH
TORCH,
BOLT
}
}

View File

@ -293,6 +293,7 @@ public class ModBlocks {
public static Block deco_rbmk_smooth;
public static Block deco_emitter;
public static Block part_emitter;
public static Block deco_loot;
public static Block bobblehead;
public static Block snowglobe;
@ -775,6 +776,7 @@ public class ModBlocks {
public static Block conveyor_lift;
public static Block crane_extractor;
public static Block crane_inserter;
public static Block crane_grabber;
public static Block crane_router;
public static Block crane_boxer;
public static Block crane_unboxer;
@ -821,6 +823,7 @@ public class ModBlocks {
public static Block struct_soyuz_core;
public static Block struct_iter_core;
public static Block struct_plasma_core;
public static Block struct_watz_core;
public static Block factory_titanium_hull;
@Deprecated public static Block factory_titanium_furnace;
@ -848,8 +851,9 @@ public class ModBlocks {
public static Block iter;
public static Block plasma_heater;
public static Block watz;
public static Block watz_pump;
public static Block watz_element;
public static Block watz_control;
@ -1463,6 +1467,7 @@ public class ModBlocks {
deco_rbmk_smooth = new BlockGeneric(Material.iron).setBlockName("deco_rbmk_smooth").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_top");
deco_emitter = new BlockEmitter().setBlockName("deco_emitter").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(20.0F).setBlockTextureName(RefStrings.MODID + ":emitter");
part_emitter = new PartEmitter().setBlockName("part_emitter").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(20.0F).setBlockTextureName(RefStrings.MODID + ":part_top");
deco_loot = new BlockLoot().setBlockName("deco_loot").setCreativeTab(null).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_steel");
bobblehead = new BlockBobble().setBlockName("bobblehead").setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_steel");
snowglobe = new BlockSnowglobe().setBlockName("snowglobe").setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":glass_boron");
@ -1900,10 +1905,11 @@ public class ModBlocks {
conveyor_lift = new BlockConveyorLift().setBlockName("conveyor_lift").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor");
crane_extractor = new CraneExtractor().setBlockName("crane_extractor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
crane_inserter = new CraneInserter().setBlockName("crane_inserter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
crane_grabber = new CraneGrabber().setBlockName("crane_grabber").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
crane_router = new CraneRouter().setBlockName("crane_router").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
crane_boxer = new CraneBoxer().setBlockName("crane_boxer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
crane_unboxer = new CraneUnboxer().setBlockName("crane_unboxer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
crane_splitter = new CraneSplitter().setBlockName("crane_splitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
crane_splitter = new CraneSplitter().setBlockName("crane_splitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":crane_side");
fan = new MachineFan().setBlockName("fan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
chain = new BlockChain(Material.iron).setBlockName("dungeon_chain").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":chain");
@ -1945,6 +1951,7 @@ public class ModBlocks {
struct_soyuz_core = new BlockSoyuzStruct(Material.iron).setBlockName("struct_soyuz_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":struct_soyuz_core");
struct_iter_core = new BlockITERStruct(Material.iron).setBlockName("struct_iter_core").setLightLevel(1F).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":struct_iter_core");
struct_plasma_core = new BlockPlasmaStruct(Material.iron).setBlockName("struct_plasma_core").setLightLevel(1F).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":struct_plasma_core");
struct_watz_core = new BlockWatzStruct(Material.iron).setBlockName("struct_watz_core").setLightLevel(1F).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":struct_watz_core");
factory_titanium_hull = new BlockGeneric(Material.iron).setBlockName("factory_titanium_hull").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":factory_titanium_hull");
factory_titanium_furnace = new FactoryHatch(Material.iron).setBlockName("factory_titanium_furnace").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":factory_titanium_furnace");
@ -1974,11 +1981,12 @@ public class ModBlocks {
watz_element = new BlockPillar(Material.iron, RefStrings.MODID + ":watz_element_top").setBlockName("watz_element").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_element_side");
watz_control = new BlockPillar(Material.iron, RefStrings.MODID + ":watz_control_top").setBlockName("watz_control").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_control_side");
watz_cooler = new BlockGeneric(Material.iron).setBlockName("watz_cooler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_cooler");
watz_end = new BlockGeneric(Material.iron).setBlockName("watz_end").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_casing");
watz_end = new BlockBoltable(Material.iron).setBlockName("watz_end").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_casing");
watz_hatch = new WatzHatch(Material.iron).setBlockName("watz_hatch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_hatch");
watz_conductor = new BlockCableConnect(Material.iron).setBlockName("watz_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_conductor_top");
watz_core = new WatzCore(Material.iron).setBlockName("watz_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_computer");
watz = new Watz().setBlockName("watz").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
watz_pump = new WatzPump().setBlockName("watz_pump").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
fwatz_conductor = new BlockPillar(Material.iron, RefStrings.MODID + ":block_combine_steel").setBlockName("fwatz_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fwatz_conductor_side");
fwatz_cooler = new BlockPillar(Material.iron, RefStrings.MODID + ":fwatz_cooler_top").setBlockName("fwatz_cooler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fwatz_cooler");
@ -2585,6 +2593,7 @@ public class ModBlocks {
GameRegistry.registerBlock(deco_beryllium, deco_beryllium.getUnlocalizedName());
GameRegistry.registerBlock(deco_asbestos, deco_asbestos.getUnlocalizedName());
GameRegistry.registerBlock(deco_emitter, ItemBlockBase.class, deco_emitter.getUnlocalizedName());
GameRegistry.registerBlock(part_emitter, ItemBlockBase.class, part_emitter.getUnlocalizedName());
GameRegistry.registerBlock(deco_loot, deco_loot.getUnlocalizedName());
GameRegistry.registerBlock(bobblehead, ItemBlockMeta.class, bobblehead.getUnlocalizedName());
GameRegistry.registerBlock(snowglobe, ItemBlockMeta.class, snowglobe.getUnlocalizedName());
@ -3095,6 +3104,7 @@ public class ModBlocks {
GameRegistry.registerBlock(crane_extractor, crane_extractor.getUnlocalizedName());
GameRegistry.registerBlock(crane_inserter, crane_inserter.getUnlocalizedName());
GameRegistry.registerBlock(crane_grabber, crane_grabber.getUnlocalizedName());
GameRegistry.registerBlock(crane_router, crane_router.getUnlocalizedName());
GameRegistry.registerBlock(crane_boxer, crane_boxer.getUnlocalizedName());
GameRegistry.registerBlock(crane_unboxer, crane_unboxer.getUnlocalizedName());
@ -3213,6 +3223,7 @@ public class ModBlocks {
GameRegistry.registerBlock(struct_soyuz_core, struct_soyuz_core.getUnlocalizedName());
GameRegistry.registerBlock(struct_iter_core, struct_iter_core.getUnlocalizedName());
GameRegistry.registerBlock(struct_plasma_core, struct_plasma_core.getUnlocalizedName());
GameRegistry.registerBlock(struct_watz_core, struct_watz_core.getUnlocalizedName());
//Absorbers
GameRegistry.registerBlock(absorber, absorber.getUnlocalizedName());
@ -3252,11 +3263,12 @@ public class ModBlocks {
GameRegistry.registerBlock(watz_element, watz_element.getUnlocalizedName());
GameRegistry.registerBlock(watz_control, watz_control.getUnlocalizedName());
GameRegistry.registerBlock(watz_cooler, watz_cooler.getUnlocalizedName());
GameRegistry.registerBlock(watz_end, watz_end.getUnlocalizedName());
register(watz_end);
GameRegistry.registerBlock(watz_hatch, watz_hatch.getUnlocalizedName());
GameRegistry.registerBlock(watz_conductor, watz_conductor.getUnlocalizedName());
GameRegistry.registerBlock(watz_core, watz_core.getUnlocalizedName());
GameRegistry.registerBlock(watz, watz.getUnlocalizedName());
GameRegistry.registerBlock(watz_pump, watz_pump.getUnlocalizedName());
GameRegistry.registerBlock(fwatz_conductor, fwatz_conductor.getUnlocalizedName());
GameRegistry.registerBlock(fwatz_scaffold, fwatz_scaffold.getUnlocalizedName());

View File

@ -6,7 +6,7 @@ import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.entity.mob.EntityTaintCrab;
import com.hbm.entity.mob.EntityTaintedCreeper;
import com.hbm.entity.mob.EntityCreeperTainted;
import com.hbm.entity.mob.EntityTeslaCrab;
import com.hbm.potion.HbmPotion;
@ -186,7 +186,7 @@ public class BlockTaint extends Block/*Container*/ {
}
if(entity instanceof EntityCreeper) {
EntityTaintedCreeper creep = new EntityTaintedCreeper(world);
EntityCreeperTainted creep = new EntityCreeperTainted(world);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
if(!world.isRemote) {

View File

@ -25,7 +25,6 @@ import net.minecraft.world.World;
public class Landmine extends BlockContainer implements IBomb {
public static boolean safeMode = false;
static Random rand = new Random();;
public Landmine(Material p_i45386_1_) {
super(p_i45386_1_);
@ -100,18 +99,23 @@ public class Landmine extends BlockContainer implements IBomb {
}
if(flag) {
this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
world.setBlockToAir(x, y, z);
if(!safeMode) {
explode(world, x, y, z);
} else {
world.setBlockToAir(x, y, z);
}
}
}
public void breakBlock(World world, int x, int y, int z, Block block, int i) {
@Override
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta) {
if(!safeMode) {
explode(world, x, y, z);
}
super.breakBlock(world, x, y, z, block, i);
super.onBlockDestroyedByPlayer(world, x, y, z, meta);
}
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float fx, float fy, float fz) {

View File

@ -0,0 +1,72 @@
package com.hbm.blocks.generic;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.BlockBase;
import com.hbm.blocks.IBlockMulti;
import com.hbm.blocks.ILookOverlay;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.items.ModItems;
import com.hbm.util.I18nUtil;
import api.hbm.block.IToolable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
public class BlockBoltable extends BlockBase implements IToolable, ILookOverlay, IBlockMulti {
public BlockBoltable(Material mat) {
super(mat);
}
@Override
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
if(tool != ToolType.BOLT) return false;
return true;
}
public List<AStack> getMaterials(int meta) {
List<AStack> list = new ArrayList();
return list;
}
@Override
@SideOnly(Side.CLIENT)
public void printHook(Pre event, World world, int x, int y, int z) {
ItemStack held = Minecraft.getMinecraft().thePlayer.getHeldItem();
if(held == null || held.getItem() != ModItems.boltgun) return;
List<String> text = new ArrayList();
text.add(EnumChatFormatting.GOLD + "Requires:");
List<AStack> materials = getMaterials(world.getBlockMetadata(x, y, z));
for(AStack stack : materials) {
try {
ItemStack display = stack.extractForCyclingDisplay(20);
text.add("- " + display.getDisplayName() + " x" + display.stackSize);
} catch(Exception ex) {
text.add(EnumChatFormatting.RED + "- ERROR");
}
}
if(!materials.isEmpty()) {
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(this.getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}
}
@Override
public int getSubCount() {
return 1;
}
}

View File

@ -45,6 +45,11 @@ public class BlockStalagmite extends BlockEnumMulti {
return null;
}
@Override
public int damageDropped(int meta) {
return 0;
}
public static int getMetaFromResource(int meta) {
return meta;

View File

@ -94,37 +94,6 @@ public class Guide extends Block implements ILookOverlay {
return null;
}
private void setDefaultDirection(World world, int x, int y, int z) {
if(!world.isRemote)
{
Block block1 = world.getBlock(x, y, z - 1);
Block block2 = world.getBlock(x, y, z + 1);
Block block3 = world.getBlock(x - 1, y, z);
Block block4 = world.getBlock(x + 1, y, z);
byte b0 = 3;
if(block1.func_149730_j() && !block2.func_149730_j())
{
b0 = 3;
}
if(block2.func_149730_j() && !block1.func_149730_j())
{
b0 = 2;
}
if(block3.func_149730_j() && !block4.func_149730_j())
{
b0 = 5;
}
if(block4.func_149730_j() && !block3.func_149730_j())
{
b0 = 4;
}
world.setBlockMetadataWithNotify(x, y, z, b0, 2);
}
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;

View File

@ -0,0 +1,124 @@
package com.hbm.blocks.generic;
import java.util.List;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.util.ParticleUtil;
import api.hbm.block.IToolable;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
public class PartEmitter extends BlockContainer implements IToolable, ITooltipProvider {
public PartEmitter() {
super(Material.iron);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityPartEmitter();
}
@Override
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
if(tool == ToolType.HAND_DRILL) {
TileEntityPartEmitter te = (TileEntityPartEmitter) world.getTileEntity(x, y, z);
te.effect = (te.effect + 1) % te.effectCount;
te.markDirty();
return true;
}
return false;
}
public static class TileEntityPartEmitter extends TileEntity {
public static final int range = 150;
public int effect = 0;
public static final int effectCount = 4;
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
double x = xCoord + 0.5;
double y = yCoord + 0.5;
double z = zCoord + 0.5;
NBTTagCompound data = new NBTTagCompound();
if(effect == 1) {
ParticleUtil.spawnGasFlame(worldObj, xCoord + worldObj.rand.nextDouble(), yCoord + 4.5 + worldObj.rand.nextDouble(), zCoord + worldObj.rand.nextDouble(), worldObj.rand.nextGaussian() * 0.2, 0.1, worldObj.rand.nextGaussian() * 0.2);
}
if(effect == 2) {
data.setString("type", "tower");
data.setFloat("lift", 5F);
data.setFloat("base", 0.25F);
data.setFloat("max", 5F);
data.setInteger("life", 560 + worldObj.rand.nextInt(20));
data.setInteger("color",0x404040);
}
if(effect == 3) {
data.setString("type", "tower");
data.setFloat("lift", 0.5F);
data.setFloat("base", 1F);
data.setFloat("max", 10F);
data.setInteger("life", 750 + worldObj.rand.nextInt(250));
x = xCoord + 0.5 + worldObj.rand.nextDouble() * 3 - 1.5;
y = yCoord + 1;
z = zCoord + 0.5 + worldObj.rand.nextDouble() * 3 - 1.5;
}
if(data.hasKey("type")) {
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x, y, z), new TargetPoint(this.worldObj.provider.dimensionId, xCoord, yCoord, zCoord, range));
}
}
}
@Override
public Packet getDescriptionPacket() {
NBTTagCompound nbt = new NBTTagCompound();
this.writeToNBT(nbt);
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
this.readFromNBT(pkt.func_148857_g());
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.effect = nbt.getInteger("effect");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setInteger("effect", this.effect);
}
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
list.add(EnumChatFormatting.GOLD + "Use hand drill to cycle special effects");
}
}

View File

@ -17,9 +17,9 @@ public class BlockITERStruct extends BlockContainer {
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityITERStruct();
}
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean isOpaqueCube() {
return false;
}
}

View File

@ -0,0 +1,25 @@
package com.hbm.blocks.machine;
import com.hbm.tileentity.machine.TileEntityWatzStruct;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class BlockWatzStruct extends BlockContainer {
public BlockWatzStruct(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityWatzStruct();
}
@Override
public boolean isOpaqueCube() {
return false;
}
}

View File

@ -3,7 +3,6 @@ package com.hbm.blocks.machine;
import java.util.List;
import api.hbm.block.IToolable;
import api.hbm.block.IToolable.ToolType;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockContainer;
@ -133,9 +132,6 @@ public class MachineFan extends BlockContainer implements IToolable {
if(meta == 4) world.setBlockMetadataWithNotify(x, y, z, 5, 3);
if(meta == 5) world.setBlockMetadataWithNotify(x, y, z, 4, 3);
//TileEntityFan fan = (TileEntityFan) world.getTileEntity(x, y, z);
//fan.blockMetadata = -1;
return true;
}
}

View File

@ -1,12 +1,15 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.BlockDummyable;
import com.hbm.handler.MultiblockHandlerXR;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.TileEntityWatz;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class Watz extends BlockDummyable {
@ -17,25 +20,55 @@ public class Watz extends BlockDummyable {
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12)
return new TileEntityWatz();
if(meta >= 12) return new TileEntityWatz();
if(meta >= 6) return new TileEntityProxyCombo().inventory().fluid();
return null;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
//return super.standardOpenBehavior(world, x, y, z, player, 0);
return false;
return super.standardOpenBehavior(world, x, y, z, player, 0);
}
@Override
public int[] getDimensions() {
return new int[] {2, 0, 3, 3, 3, 3};
return new int[] {2, 0, 3, 3, 1, 1};
}
@Override
public int getOffset() {
return 3;
}
@Override
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
return super.checkRequirement(world, x, y, z, dir, o) &&
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 2, 2, 2, -2}, x, y, z, dir) &&
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 2, 2, -2, 2}, x, y, z, dir) &&
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 1, 1, 3, -3}, x, y, z, dir) &&
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 1, 1, -3, 3}, x, y, z, dir);
}
@Override
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 2, 2, 2, -2}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 2, 2, -2, 2}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 1, 1, 3, -3}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 1, 1, -3, 3}, this, dir);
x += dir.offsetX * o;
z += dir.offsetZ * o;
this.makeExtra(world, x + 2, y, z);
this.makeExtra(world, x - 2, y, z);
this.makeExtra(world, x, y, z + 2);
this.makeExtra(world, x, y, z - 2);
this.makeExtra(world, x + 2, y + 2, z);
this.makeExtra(world, x - 2, y + 2, z);
this.makeExtra(world, x, y + 2, z + 2);
this.makeExtra(world, x, y + 2, z - 2);
this.makeExtra(world, x, y + 2, z);
}
}

View File

@ -0,0 +1,52 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.BlockDummyable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class WatzPump extends BlockDummyable {
public WatzPump() {
super(Material.iron);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityWatzPump();
return null;
}
@Override
public int[] getDimensions() {
return new int[] {1, 0, 0, 0, 0, 0};
}
@Override
public int getOffset() {
return 0;
}
@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
int meta = world.getBlockMetadata(x, y, z);
return side == ForgeDirection.UP && meta == 1;
}
public static class TileEntityWatzPump extends TileEntity {
@Override public boolean canUpdate() { return false; }
@Override @SideOnly(Side.CLIENT) public double getMaxRenderDistanceSquared() { return 65536.0D; }
AxisAlignedBB bb = null;
@Override public AxisAlignedBB getRenderBoundingBox() {
if(bb == null) bb = AxisAlignedBB.getBoundingBox(xCoord - 1, yCoord, zCoord - 1, xCoord + 2, yCoord + 2, zCoord + 2);
return bb;
}
}
}

View File

@ -48,12 +48,12 @@ public class BlockCable extends BlockContainer {
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
boolean posX = Library.canConnect(world, x + 1, y, z, Library.NEG_X);
boolean negX = Library.canConnect(world, x - 1, y, z, Library.POS_X);
boolean posY = Library.canConnect(world, x, y + 1, z, Library.NEG_Y);
boolean negY = Library.canConnect(world, x, y - 1, z, Library.POS_Y);
boolean posZ = Library.canConnect(world, x, y, z + 1, Library.NEG_Z);
boolean negZ = Library.canConnect(world, x, y, z - 1, Library.POS_Z);
boolean posX = Library.canConnect(world, x + 1, y, z, Library.POS_X);
boolean negX = Library.canConnect(world, x - 1, y, z, Library.NEG_X);
boolean posY = Library.canConnect(world, x, y + 1, z, Library.POS_Y);
boolean negY = Library.canConnect(world, x, y - 1, z, Library.NEG_Y);
boolean posZ = Library.canConnect(world, x, y, z + 1, Library.POS_Z);
boolean negZ = Library.canConnect(world, x, y, z - 1, Library.NEG_Z);
setBlockBounds(posX, negX, posY, negY, posZ, negZ);
@ -63,12 +63,12 @@ public class BlockCable extends BlockContainer {
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
boolean posX = Library.canConnect(world, x + 1, y, z, Library.NEG_X);
boolean negX = Library.canConnect(world, x - 1, y, z, Library.POS_X);
boolean posY = Library.canConnect(world, x, y + 1, z, Library.NEG_Y);
boolean negY = Library.canConnect(world, x, y - 1, z, Library.POS_Y);
boolean posZ = Library.canConnect(world, x, y, z + 1, Library.NEG_Z);
boolean negZ = Library.canConnect(world, x, y, z - 1, Library.POS_Z);
boolean posX = Library.canConnect(world, x + 1, y, z, Library.POS_X);
boolean negX = Library.canConnect(world, x - 1, y, z, Library.NEG_X);
boolean posY = Library.canConnect(world, x, y + 1, z, Library.POS_Y);
boolean negY = Library.canConnect(world, x, y - 1, z, Library.NEG_Y);
boolean posZ = Library.canConnect(world, x, y, z + 1, Library.POS_Z);
boolean negZ = Library.canConnect(world, x, y, z - 1, Library.NEG_Z);
setBlockBounds(posX, negX, posY, negY, posZ, negZ);
}

View File

@ -12,6 +12,7 @@ import com.hbm.util.I18nUtil;
import api.hbm.block.IToolable;
import api.hbm.energy.IEnergyUser;
import api.hbm.energy.IEnergyConnector.ConnectionPriority;
import api.hbm.energy.IEnergyConnectorBlock;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -32,7 +33,7 @@ import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
import net.minecraftforge.common.util.ForgeDirection;
public class CableDiode extends BlockContainer implements ILookOverlay, IToolable, ITooltipProvider {
public class CableDiode extends BlockContainer implements IEnergyConnectorBlock, ILookOverlay, IToolable, ITooltipProvider {
public CableDiode(Material mat) {
super(mat);
@ -66,6 +67,11 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
world.setBlockMetadataWithNotify(x, y, z, l, 2);
}
@Override
public boolean canConnect(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
return true;
}
@Override
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
@ -179,6 +185,11 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
}
}
}
@Override
public boolean canConnect(ForgeDirection dir) {
return dir != getDir();
}
private boolean recursionBrake = false;
private long subBuffer;

View File

@ -2,7 +2,6 @@ package com.hbm.blocks.network;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.network.TileEntityCraneBoxer;
import com.hbm.tileentity.network.TileEntityCraneInserter;
import api.hbm.conveyor.IConveyorItem;
import api.hbm.conveyor.IConveyorPackage;
@ -81,7 +80,7 @@ public class CraneBoxer extends BlockCraneBase implements IEnterableBlock {
@Override
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
return Container.calcRedstoneFromInventory((TileEntityCraneInserter)world.getTileEntity(x, y, z));
return Container.calcRedstoneFromInventory((TileEntityCraneBoxer)world.getTileEntity(x, y, z));
}
@Override

View File

@ -0,0 +1,56 @@
package com.hbm.blocks.network;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.network.TileEntityCraneGrabber;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class CraneGrabber extends BlockCraneBase {
public CraneGrabber() {
super(Material.iron);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityCraneGrabber();
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
super.registerBlockIcons(iconRegister);
this.iconDirectional = iconRegister.registerIcon(RefStrings.MODID + ":crane_grabber_top");
this.iconDirectionalUp = iconRegister.registerIcon(RefStrings.MODID + ":crane_grabber_side_up");
this.iconDirectionalDown = iconRegister.registerIcon(RefStrings.MODID + ":crane_grabber_side_down");
this.iconOut = iconRegister.registerIcon(RefStrings.MODID + ":crane_pull");
this.iconSideOut = iconRegister.registerIcon(RefStrings.MODID + ":crane_side_pull");
}
@Override
public int getRotationFromSide(IBlockAccess world, int x, int y, int z, int side) {
int meta = world.getBlockMetadata(x, y, z);
if(meta > 1 && side == 1) {
if(meta == 2) return 3;
if(meta == 3) return 0;
if(meta == 4) return 1;
if(meta == 5) return 2;
}
return 0;
}
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
this.dropContents(world, x, y, z, block, meta, 0, 11);
super.breakBlock(world, x, y, z, block, meta);
}
}

View File

@ -28,9 +28,13 @@ public class CraneSplitter extends BlockDummyable implements IConveyorBelt, IEnt
@SideOnly(Side.CLIENT) public IIcon iconTopRight;
@SideOnly(Side.CLIENT) public IIcon iconFrontLeft;
@SideOnly(Side.CLIENT) public IIcon iconFrontRight;
@SideOnly(Side.CLIENT) public IIcon iconBottom;
@SideOnly(Side.CLIENT) public IIcon iconBackLeft;
@SideOnly(Side.CLIENT) public IIcon iconBackRight;
@SideOnly(Side.CLIENT) public IIcon iconLeft;
@SideOnly(Side.CLIENT) public IIcon iconRight;
@SideOnly(Side.CLIENT) public IIcon iconBelt;
@SideOnly(Side.CLIENT) public IIcon iconInner;
@SideOnly(Side.CLIENT) public IIcon iconInnerSide;
public CraneSplitter() {
super(Material.iron);
@ -55,7 +59,17 @@ public class CraneSplitter extends BlockDummyable implements IConveyorBelt, IEnt
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
super.registerBlockIcons(iconRegister);
this.iconTopLeft = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_top_left");
this.iconTopRight = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_top_right");
this.iconFrontLeft = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_front_left");
this.iconFrontRight = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_front_right");
this.iconBackLeft = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_back_left");
this.iconBackRight = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_back_right");
this.iconLeft = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_left");
this.iconRight = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_right");
this.iconBelt = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_belt");
this.iconInner = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_inner");
this.iconInnerSide = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_inner_side");
}
public static int renderID = RenderingRegistry.getNextAvailableRenderId();

View File

@ -12,6 +12,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
@ -86,4 +87,14 @@ public class CraneUnboxer extends BlockCraneBase implements IEnterableBlock {
}
}
}
@Override
public boolean hasComparatorInputOverride() {
return true;
}
@Override
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
return Container.calcRedstoneFromInventory((TileEntityCraneUnboxer)world.getTileEntity(x, y, z));
}
}

View File

@ -181,12 +181,12 @@ public class MineralRecipes {
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_pu238be, 6), new Object[] { ModItems.billet_pu238, ModItems.billet_pu238, ModItems.billet_pu238, ModItems.billet_beryllium, ModItems.billet_beryllium, ModItems.billet_beryllium }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_ra226be, 6), new Object[] { ModItems.billet_ra226, ModItems.billet_ra226, ModItems.billet_ra226, ModItems.billet_beryllium, ModItems.billet_beryllium, ModItems.billet_beryllium }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_bismuth, 1), new Object[] { "nuggetZirconium", "nuggetZirconium", "nuggetZirconium", "nuggetUranium", "nuggetPlutonium241", ModItems.nugget_bismuth }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_pu241, 1), new Object[] { "nuggetZirconium", "nuggetZirconium", "nuggetZirconium", "nuggetUranium235", "nuggetPlutonium240", "nuggetPlutonium241" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_am_mix, 1), new Object[] { "nuggetZirconium", "nuggetZirconium", "nuggetZirconium", "nuggetPlutonium241", "nuggetPlutonium241", "nuggetAmericiumRG" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_bismuth, 6), new Object[] { ModItems.billet_zirconium, ModItems.billet_zirconium, ModItems.billet_zirconium, ModItems.billet_uranium, ModItems.billet_pu241, ModItems.billet_bismuth }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_pu241, 6), new Object[] { ModItems.billet_zirconium, ModItems.billet_zirconium, ModItems.billet_zirconium, ModItems.billet_u235, ModItems.billet_pu240, ModItems.billet_pu241 }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_am_mix, 6), new Object[] { ModItems.billet_zirconium, ModItems.billet_zirconium, ModItems.billet_zirconium, ModItems.billet_pu241, ModItems.billet_pu241, ModItems.billet_am_mix }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_bismuth, 1), new Object[] { ZR.nugget(), ZR.nugget(), ZR.nugget(), U.nugget(), PU241.nugget(), BI.nugget() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_pu241, 1), new Object[] { ZR.nugget(), ZR.nugget(), ZR.nugget(), U235.nugget(), PU240.nugget(), PU241.nugget() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_am_mix, 1), new Object[] { ZR.nugget(), ZR.nugget(), ZR.nugget(), PU241.nugget(), PU241.nugget(), AMRG.nugget() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_bismuth, 6), new Object[] { ZR.billet(), ZR.billet(), ZR.billet(), U.billet(), PU241.billet(), BI.billet() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_pu241, 6), new Object[] { ZR.billet(), ZR.billet(), ZR.billet(), U235.billet(), PU240.billet(), PU241.billet() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_am_mix, 6), new Object[] { ZR.billet(), ZR.billet(), ZR.billet(), PU241.billet(), PU241.billet(), AMRG.billet() }));
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.billet_uranium, 2), new Object[] { ModItems.billet_uranium_fuel, ModItems.billet_u238 });
@ -224,16 +224,16 @@ public class MineralRecipes {
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.billet_balefire_gold, 1), new Object[] { ModItems.billet_au198, ModItems.cell_antimatter, ModItems.pellet_charged });
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.billet_flashlead, 2), new Object[] { ModItems.billet_balefire_gold, ModItems.billet_pb209, ModItems.cell_antimatter });
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg), new Object[] { ModItems.billet_pu238, ModItems.billet_pu238, ModItems.billet_pu238, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_radium), new Object[] { ModItems.billet_ra226, ModItems.billet_ra226, ModItems.billet_ra226, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_weak), new Object[] { ModItems.billet_u238, ModItems.billet_u238, ModItems.billet_pu238, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_strontium), new Object[] { ModItems.billet_sr90, ModItems.billet_sr90, ModItems.billet_sr90, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_cobalt), new Object[] { ModItems.billet_co60, ModItems.billet_co60, ModItems.billet_co60, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_actinium), new Object[] { ModItems.billet_actinium, ModItems.billet_actinium, ModItems.billet_actinium, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_polonium), new Object[] { ModItems.billet_polonium, ModItems.billet_polonium, ModItems.billet_polonium, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_lead), new Object[] { ModItems.billet_pb209, ModItems.billet_pb209, ModItems.billet_pb209, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_gold), new Object[] { ModItems.billet_au198, ModItems.billet_au198, ModItems.billet_au198, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_americium), new Object[] { ModItems.billet_am241, ModItems.billet_am241, ModItems.billet_am241, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg), new Object[] { ModItems.billet_pu238, ModItems.billet_pu238, ModItems.billet_pu238, IRON.plate() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_radium), new Object[] { ModItems.billet_ra226, ModItems.billet_ra226, ModItems.billet_ra226, IRON.plate() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_weak), new Object[] { ModItems.billet_u238, ModItems.billet_u238, ModItems.billet_pu238, IRON.plate() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_strontium), new Object[] { ModItems.billet_sr90, ModItems.billet_sr90, ModItems.billet_sr90, IRON.plate() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_cobalt), new Object[] { ModItems.billet_co60, ModItems.billet_co60, ModItems.billet_co60, IRON.plate() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_actinium), new Object[] { ModItems.billet_actinium, ModItems.billet_actinium, ModItems.billet_actinium, IRON.plate() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_polonium), new Object[] { ModItems.billet_polonium, ModItems.billet_polonium, ModItems.billet_polonium, IRON.plate() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_lead), new Object[] { ModItems.billet_pb209, ModItems.billet_pb209, ModItems.billet_pb209, IRON.plate() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_gold), new Object[] { ModItems.billet_au198, ModItems.billet_au198, ModItems.billet_au198, IRON.plate() }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_americium), new Object[] { ModItems.billet_am241, ModItems.billet_am241, ModItems.billet_am241, IRON.plate() }));
//There's no need for anvil recycling recipes if you simply set the container item
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.billet_bismuth, 3), new Object[] { new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.BISMUTH.ordinal()) });

View File

@ -14,7 +14,6 @@ import com.hbm.entity.mob.botprime.*;
import com.hbm.entity.mob.siege.*;
import com.hbm.entity.particle.*;
import com.hbm.entity.projectile.*;
import com.hbm.entity.qic.*;
import com.hbm.main.MainRegistry;
import com.hbm.util.Tuple.Quartet;
@ -201,13 +200,14 @@ public class EntityMappings {
addEntity(EntityArtilleryShell.class, "entity_artillery_shell", 1000);
addEntity(EntityArtilleryRocket.class, "entity_himars", 1000);
addEntity(EntitySiegeTunneler.class, "entity_meme_tunneler", 1000);
addEntity(EntitySPV.class, "entity_self_propelled_vehicle_mark_1", 1000);
addEntity(EntityCog.class, "entity_stray_cog", 1000);
addEntity(EntitySawblade.class, "entity_stray_saw", 1000);
addEntity(EntityChemical.class, "entity_chemthrower_splash", 1000);
addEntity(EntityMist.class, "entity_mist", 1000);
addMob(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", 0x204131, 0x75CE00);
addMob(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", 0x813b9b, 0xd71fdd);
addMob(EntityCreeperNuclear.class, "entity_mob_nuclear_creeper", 0x204131, 0x75CE00);
addMob(EntityCreeperTainted.class, "entity_mob_tainted_creeper", 0x813b9b, 0xd71fdd);
addMob(EntityCreeperPhosgene.class, "entity_mob_phosgene_creeper", 0xE3D398, 0xB8A06B);
addMob(EntityHunterChopper.class, "entity_mob_hunter_chopper", 0x000020, 0x2D2D72);
addMob(EntityCyberCrab.class, "entity_cyber_crab", 0xAAAAAA, 0x444444);
addMob(EntityTeslaCrab.class, "entity_tesla_crab", 0xAAAAAA, 0x440000);

View File

@ -0,0 +1,219 @@
package com.hbm.entity.effect;
import java.util.List;
import com.hbm.extprop.HbmLivingProps;
import com.hbm.handler.radiation.ChunkRadiationManager;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.trait.FT_Corrosive;
import com.hbm.inventory.fluid.trait.FT_Flammable;
import com.hbm.inventory.fluid.trait.FT_Poison;
import com.hbm.inventory.fluid.trait.FT_Toxin;
import com.hbm.inventory.fluid.trait.FT_VentRadiation;
import com.hbm.inventory.fluid.trait.FluidTraitSimple.FT_Gaseous;
import com.hbm.inventory.fluid.trait.FluidTraitSimple.FT_Gaseous_ART;
import com.hbm.inventory.fluid.trait.FluidTraitSimple.FT_Liquid;
import com.hbm.inventory.fluid.trait.FluidTraitSimple.FT_Viscous;
import com.hbm.lib.ModDamageSource;
import com.hbm.util.ArmorUtil;
import com.hbm.util.ContaminationUtil;
import com.hbm.util.EntityDamageUtil;
import com.hbm.util.ContaminationUtil.ContaminationType;
import com.hbm.util.ContaminationUtil.HazardType;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityMist extends Entity {
public EntityMist(World world) {
super(world);
this.noClip = true;
}
public EntityMist setArea(float width, float height) {
this.dataWatcher.updateObject(11, width);
this.dataWatcher.updateObject(12, height);
return this;
}
@Override
protected void entityInit() {
this.dataWatcher.addObject(10, new Integer(0));
this.dataWatcher.addObject(11, new Float(0));
this.dataWatcher.addObject(12, new Float(0));
}
public EntityMist setType(FluidType fluid) {
this.dataWatcher.updateObject(10, fluid.getID());
return this;
}
public FluidType getType() {
return Fluids.fromID(this.dataWatcher.getWatchableObjectInt(10));
}
@Override
public void onEntityUpdate() {
float height = this.dataWatcher.getWatchableObjectFloat(12);
this.yOffset = -height / 2F;
this.setSize(this.dataWatcher.getWatchableObjectFloat(11), height);
if(!worldObj.isRemote) {
if(this.ticksExisted > this.getMaxAge()) {
this.setDead();
}
FluidType type = this.getType();
if(type.hasTrait(FT_VentRadiation.class)) {
FT_VentRadiation trait = type.getTrait(FT_VentRadiation.class);
ChunkRadiationManager.proxy.incrementRad(worldObj, (int) Math.floor(posX), (int) Math.floor(posY), (int) Math.floor(posZ), trait.getRadPerMB() * 2);
}
double intensity = 1D - (double) this.ticksExisted / (double) this.getMaxAge();
if(type.hasTrait(FT_Flammable.class) && this.isBurning()) {
worldObj.createExplosion(this, posX, posY + height / 2, posZ, (float) intensity * 15F, true);
this.setDead();
return;
}
List<Entity> affected = worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox);
for(Entity e : affected) {
this.affect(e, intensity);
}
}
}
/* can't reuse EntityChemical here, while similar or identical in some places, the actual effects are often different */
protected void affect(Entity e, double intensity) {
FluidType type = this.getType();
EntityLivingBase living = e instanceof EntityLivingBase ? (EntityLivingBase) e : null;
if(type.temperature >= 100) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, new DamageSource(ModDamageSource.s_boil), 5F + (type.temperature - 100) * 0.02F);
if(type.temperature >= 500) {
e.setFire(10); //afterburn for 10 seconds
}
}
if(type.temperature < -20) {
if(living != null) { //only living things are affected
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, new DamageSource(ModDamageSource.s_cryolator), 5F + (type.temperature + 20) * -0.05F); //5 damage at -20°C with one extra damage every -20°C
living.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2));
living.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 100, 4));
}
}
if(type.hasTrait(Fluids.DELICIOUS.getClass())) {
if(living != null && living.isEntityAlive()) {
living.heal(2F * (float) intensity);
}
}
if(type.hasTrait(FT_Flammable.class) && type.hasTrait(FT_Liquid.class)) {
if(living != null) {
HbmLivingProps.setOil(living, 200); //doused in oil for 10 seconds
}
}
if(this.isExtinguishing(type)) {
e.extinguish();
}
if(type.hasTrait(FT_Corrosive.class)) {
FT_Corrosive trait = type.getTrait(FT_Corrosive.class);
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, new DamageSource(ModDamageSource.s_acid), trait.getRating() / 20F);
if(living != null) {
for(int i = 0; i < 4; i++) {
ArmorUtil.damageSuit(living, i, trait.getRating() / 5);
}
}
}
if(type.hasTrait(FT_VentRadiation.class)) {
FT_VentRadiation trait = type.getTrait(FT_VentRadiation.class);
if(living != null) {
ContaminationUtil.contaminate(living, HazardType.RADIATION, ContaminationType.CREATIVE, trait.getRadPerMB() * 5);
}
}
if(type.hasTrait(FT_Poison.class)) {
FT_Poison trait = type.getTrait(FT_Poison.class);
if(living != null) {
living.addPotionEffect(new PotionEffect(trait.isWithering() ? Potion.wither.id : Potion.poison.id, (int) (5 * 20 * intensity)));
}
}
if(type.hasTrait(FT_Toxin.class)) {
FT_Toxin trait = type.getTrait(FT_Toxin.class);
if(living != null) {
trait.affect(living, intensity);
}
}
}
protected boolean isExtinguishing(FluidType type) {
return this.getStyleFromType(type) == SprayStyle.MIST && this.getType().temperature < 50 && !type.hasTrait(FT_Flammable.class);
}
public int getMaxAge() {
return getStyleFromType(this.getType()) == SprayStyle.GAS ? 600 : 150;
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbt) {
this.setType(Fluids.fromID(nbt.getInteger("type")));
}
@Override
protected void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setInteger("type", this.getType().getID());
}
@Override
@SideOnly(Side.CLIENT)
public boolean canRenderOnFire() {
return false;
}
public static SprayStyle getStyleFromType(FluidType type) {
if(type.hasTrait(FT_Viscous.class)) {
return SprayStyle.NULL;
}
if(type.hasTrait(FT_Gaseous.class) || type.hasTrait(FT_Gaseous_ART.class)) {
return SprayStyle.GAS;
}
if(type.hasTrait(FT_Liquid.class)) {
return SprayStyle.MIST;
}
return SprayStyle.NULL;
}
public static enum SprayStyle {
MIST, //liquids that have been sprayed into a mist
GAS, //things that were already gaseous
NULL
}
}

View File

@ -0,0 +1,137 @@
package com.hbm.entity.mob;
import java.util.List;
import com.hbm.entity.logic.EntityNukeExplosionMK5;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.explosion.ExplosionNukeSmall;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.util.ContaminationUtil;
import com.hbm.util.ContaminationUtil.ContaminationType;
import com.hbm.util.ContaminationUtil.HazardType;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityCreeperNuclear extends EntityCreeper {
public EntityCreeperNuclear(World world) {
super(world);
this.fuseTime = 75;
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D);
}
@Override
public boolean attackEntityFrom(DamageSource source, float amount) {
// for some reason the nuclear explosion would damage the already dead entity, reviving it and forcing it to play the death animation
if(this.isDead) return false;
if(source == ModDamageSource.radiation || source == ModDamageSource.mudPoisoning) {
if(this.isEntityAlive()) this.heal(amount);
return false;
}
return super.attackEntityFrom(source, amount);
}
@Override
protected Item getDropItem() {
return Item.getItemFromBlock(Blocks.tnt);
}
@Override
protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
super.dropFewItems(p_70628_1_, p_70628_2_);
if(rand.nextInt(3) == 0)
this.dropItem(ModItems.coin_creeper, 1);
}
@Override
public void onDeath(DamageSource p_70645_1_) {
super.onDeath(p_70645_1_);
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(50, 50, 50));
for(EntityPlayer player : players) {
player.triggerAchievement(MainRegistry.bossCreeper);
}
if(p_70645_1_.getEntity() instanceof EntitySkeleton || (p_70645_1_.isProjectile() && p_70645_1_.getEntity() instanceof EntityArrow && ((EntityArrow) (p_70645_1_.getEntity())).shootingEntity == null)) {
this.entityDropItem(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.STOCK), 1);
}
}
@Override
public void onUpdate() {
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(5, 5, 5));
for(Entity e : list) {
if(e instanceof EntityLivingBase) {
ContaminationUtil.contaminate((EntityLivingBase) e, HazardType.RADIATION, ContaminationType.CREATIVE, 0.25F);
}
}
super.onUpdate();
if(this.isEntityAlive() && this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
this.heal(1.0F);
}
}
@Override
public void func_146077_cc() {
if(!this.worldObj.isRemote) {
this.setDead();
boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
if(this.getPowered()) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "muke");
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY + 0.5, posZ), new TargetPoint(dimension, posX, posY, posZ, 250));
worldObj.playSoundEffect(posX, posY + 0.5, posZ, "hbm:weapon.mukeExplosion", 15.0F, 1.0F);
if(flag) {
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, 50, posX, posY, posZ).mute());
} else {
ExplosionNukeGeneric.dealDamage(worldObj, posX, posY + 0.5, posZ, 100);
}
} else {
if(flag) {
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_MEDIUM);
} else {
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_SAFE);
}
}
}
}
}

View File

@ -0,0 +1,42 @@
package com.hbm.entity.mob;
import com.hbm.entity.effect.EntityMist;
import com.hbm.inventory.fluid.Fluids;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityCreeperPhosgene extends EntityCreeper {
public EntityCreeperPhosgene(World world) {
super(world);
this.fuseTime = 20; //ehehehehehe
}
@Override
public boolean attackEntityFrom(DamageSource source, float amount) {
if(!source.isDamageAbsolute() && !source.isUnblockable()) {
amount -= 4F;
}
if(amount < 0) return false;
return super.attackEntityFrom(source, amount);
}
@Override
public void func_146077_cc() {
if(!this.worldObj.isRemote) {
this.setDead();
EntityMist mist = new EntityMist(worldObj);
mist.setType(Fluids.PHOSGENE);
mist.setPosition(posX, posY, posZ);
mist.setArea(10, 5);
worldObj.spawnEntityInWorld(mist);
}
}
}

View File

@ -0,0 +1,100 @@
package com.hbm.entity.mob;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.GeneralConfig;
import api.hbm.entity.IRadiationImmune;
import net.minecraft.block.Block;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.world.World;
public class EntityCreeperTainted extends EntityCreeper implements IRadiationImmune {
public EntityCreeperTainted(World world) {
super(world);
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D);
}
@Override
public void onUpdate() {
super.onUpdate();
if(this.isEntityAlive()) {
if(this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
this.heal(1.0F);
}
}
}
@Override
protected Item getDropItem() {
return Item.getItemFromBlock(Blocks.tnt);
}
@Override
public void func_146077_cc() {
if(!this.worldObj.isRemote) {
boolean griefing = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
worldObj.newExplosion(this, posX, posY, posZ, 5.0F, false, false);
if(griefing) {
if(this.getPowered()) {
for(int i = 0; i < 255; i++) {
int a = rand.nextInt(15) + (int) posX - 7;
int b = rand.nextInt(15) + (int) posY - 7;
int c = rand.nextInt(15) + (int) posZ - 7;
if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c)) {
if(!GeneralConfig.enableHardcoreTaint) {
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 5, 2);
} else {
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3), 2);
}
}
}
} else {
for(int i = 0; i < 85; i++) {
int a = rand.nextInt(7) + (int) posX - 3;
int b = rand.nextInt(7) + (int) posY - 3;
int c = rand.nextInt(7) + (int) posZ - 3;
if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c)) {
if(!GeneralConfig.enableHardcoreTaint) {
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(6) + 10, 2);
} else {
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 4, 2);
}
}
}
}
}
this.setDead();
}
}
public static boolean hasPosNeightbour(World world, int x, int y, int z) {
Block b0 = world.getBlock(x + 1, y, z);
Block b1 = world.getBlock(x, y + 1, z);
Block b2 = world.getBlock(x, y, z + 1);
Block b3 = world.getBlock(x - 1, y, z);
Block b4 = world.getBlock(x, y - 1, z);
Block b5 = world.getBlock(x, y, z - 1);
boolean b = (b0.renderAsNormalBlock() && b0.getMaterial().isOpaque()) || (b1.renderAsNormalBlock() && b1.getMaterial().isOpaque()) || (b2.renderAsNormalBlock() && b2.getMaterial().isOpaque()) || (b3.renderAsNormalBlock() && b3.getMaterial().isOpaque()) || (b4.renderAsNormalBlock() && b4.getMaterial().isOpaque()) || (b5.renderAsNormalBlock() && b5.getMaterial().isOpaque());
return b;
}
}

View File

@ -27,7 +27,7 @@ public class EntityCyberCrab extends EntityMob implements IRangedAttackMob, IRad
private static final IEntitySelector selector = new IEntitySelector() {
public boolean isEntityApplicable(Entity p_82704_1_) {
return !(p_82704_1_ instanceof EntityCyberCrab || p_82704_1_ instanceof EntityCreeper || p_82704_1_ instanceof EntityNuclearCreeper);
return !(p_82704_1_ instanceof EntityCyberCrab || p_82704_1_ instanceof EntityCreeper);
}
};

View File

@ -1,349 +0,0 @@
package com.hbm.entity.mob;
import java.util.List;
import com.hbm.entity.logic.EntityNukeExplosionMK5;
import com.hbm.entity.mob.ai.EntityAINuclearCreeperSwell;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.explosion.ExplosionNukeSmall;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.util.ContaminationUtil;
import com.hbm.util.ContaminationUtil.ContaminationType;
import com.hbm.util.ContaminationUtil.HazardType;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityNuclearCreeper extends EntityMob {
private int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 75;
public EntityNuclearCreeper(World p_i1733_1_) {
super(p_i1733_1_);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAINuclearCreeperSwell(this));
this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, false));
this.tasks.addTask(4, new EntityAIWander(this, 0.8D));
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityOcelot.class, 0, true));
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D);
}
@Override
public boolean attackEntityFrom(DamageSource source, float amount) {
if(source == ModDamageSource.radiation || source == ModDamageSource.mudPoisoning) {
this.heal(amount);
return false;
}
return super.attackEntityFrom(source, amount);
}
@Override
public boolean isAIEnabled() {
return true;
}
@Override
public int getMaxSafePointTries() {
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
@Override
protected void fall(float p_70069_1_) {
super.fall(p_70069_1_);
this.timeSinceIgnited = (int) (this.timeSinceIgnited + p_70069_1_ * 1.5F);
if(this.timeSinceIgnited > this.fuseTime - 5) {
this.timeSinceIgnited = this.fuseTime - 5;
}
}
@Override
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(16, Byte.valueOf((byte) -1));
this.dataWatcher.addObject(17, Byte.valueOf((byte) 0));
this.dataWatcher.addObject(18, Byte.valueOf((byte) 0));
}
@Override
public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
super.writeEntityToNBT(p_70014_1_);
if(this.dataWatcher.getWatchableObjectByte(17) == 1) {
p_70014_1_.setBoolean("powered", true);
}
p_70014_1_.setShort("Fuse", (short) this.fuseTime);
p_70014_1_.setBoolean("ignited", this.func_146078_ca());
}
@Override
public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
super.readEntityFromNBT(p_70037_1_);
this.dataWatcher.updateObject(17, Byte.valueOf((byte) (p_70037_1_.getBoolean("powered") ? 1 : 0)));
if(p_70037_1_.hasKey("Fuse", 99)) {
this.fuseTime = p_70037_1_.getShort("Fuse");
}
if(p_70037_1_.getBoolean("ignited")) {
this.func_146079_cb();
}
}
@Override
public void onUpdate() {
if(this.isDead) {
this.isDead = false;
this.heal(10.0F);
}
if(this.isEntityAlive()) {
this.lastActiveTime = this.timeSinceIgnited;
if(this.func_146078_ca()) {
this.setCreeperState(1);
}
int i = this.getCreeperState();
if(i > 0 && this.timeSinceIgnited == 0) {
this.playSound("creeper.primed", 1.0F * 30 / 75, 0.5F);
}
this.timeSinceIgnited += i;
if(this.timeSinceIgnited < 0) {
this.timeSinceIgnited = 0;
}
if(this.timeSinceIgnited >= this.fuseTime) {
this.timeSinceIgnited = this.fuseTime;
this.func_146077_cc();
}
}
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(posX - 5, posY - 5, posZ - 5, posX + 5, posY + 5, posZ + 5));
for(Entity e : list)
if(e instanceof EntityLivingBase) {
ContaminationUtil.contaminate((EntityLivingBase) e, HazardType.RADIATION, ContaminationType.CREATIVE, 0.25F);
}
super.onUpdate();
if(this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
this.heal(1.0F);
}
}
@Override
protected String getHurtSound() {
return "mob.creeper.say";
}
@Override
protected String getDeathSound() {
return "mob.creeper.death";
}
@Override
public void onDeath(DamageSource p_70645_1_) {
super.onDeath(p_70645_1_);
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(50, 50, 50));
for(EntityPlayer player : players) {
player.triggerAchievement(MainRegistry.bossCreeper);
}
if(p_70645_1_.getEntity() instanceof EntitySkeleton || (p_70645_1_.isProjectile() && p_70645_1_.getEntity() instanceof EntityArrow && ((EntityArrow) (p_70645_1_.getEntity())).shootingEntity == null)) {
int i = rand.nextInt(11);
int j = rand.nextInt(3);
if(i == 0)
this.dropItem(ModItems.nugget_u235, j);
if(i == 1)
this.dropItem(ModItems.nugget_pu238, j);
if(i == 2)
this.dropItem(ModItems.nugget_pu239, j);
if(i == 3)
this.dropItem(ModItems.nugget_neptunium, j);
if(i == 4)
this.dropItem(ModItems.man_core, 1);
if(i == 5) {
this.dropItem(ModItems.sulfur, j * 2);
this.dropItem(ModItems.niter, j * 2);
}
if(i == 6)
this.dropItem(ModItems.syringe_awesome, 1);
if(i == 7)
this.dropItem(ModItems.fusion_core, 1);
if(i == 8)
this.dropItem(ModItems.syringe_metal_stimpak, 1);
if(i == 9) {
switch(rand.nextInt(4)) {
case 0:
this.dropItem(ModItems.t45_helmet, 1);
break;
case 1:
this.dropItem(ModItems.t45_plate, 1);
break;
case 2:
this.dropItem(ModItems.t45_legs, 1);
break;
case 3:
this.dropItem(ModItems.t45_boots, 1);
break;
}
this.dropItem(ModItems.fusion_core, 1);
}
if(i == 10)
this.entityDropItem(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH), 1);
}
}
@Override
public boolean attackEntityAsMob(Entity p_70652_1_) {
return true;
}
public boolean getPowered() {
return this.dataWatcher.getWatchableObjectByte(17) == 1;
}
@SideOnly(Side.CLIENT)
public float getCreeperFlashIntensity(float p_70831_1_) {
return (this.lastActiveTime + (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (this.fuseTime - 2);
}
@Override
protected Item getDropItem() {
return Item.getItemFromBlock(Blocks.tnt);
}
@Override
protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
super.dropFewItems(p_70628_1_, p_70628_2_);
if(rand.nextInt(3) == 0)
this.dropItem(ModItems.coin_creeper, 1);
}
public int getCreeperState() {
return this.dataWatcher.getWatchableObjectByte(16);
}
public void setCreeperState(int p_70829_1_) {
this.dataWatcher.updateObject(16, Byte.valueOf((byte) p_70829_1_));
}
@Override
public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
super.onStruckByLightning(p_70077_1_);
this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1));
}
@Override
protected boolean interact(EntityPlayer p_70085_1_) {
ItemStack itemstack = p_70085_1_.inventory.getCurrentItem();
if(itemstack != null && itemstack.getItem() == Items.flint_and_steel) {
this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.ignite", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
p_70085_1_.swingItem();
if(!this.worldObj.isRemote) {
this.func_146079_cb();
itemstack.damageItem(1, p_70085_1_);
return true;
}
}
return super.interact(p_70085_1_);
}
private void func_146077_cc() {
if(!this.worldObj.isRemote) {
boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
if(this.getPowered()) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "muke");
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY + 0.5, posZ), new TargetPoint(dimension, posX, posY, posZ, 250));
worldObj.playSoundEffect(posX, posY + 0.5, posZ, "hbm:weapon.mukeExplosion", 15.0F, 1.0F);
if(flag) {
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, 50, posX, posY, posZ).mute());
} else {
ExplosionNukeGeneric.dealDamage(worldObj, posX, posY + 0.5, posZ, 100);
}
} else {
if(flag) {
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_MEDIUM);
} else {
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_SAFE);
}
}
this.setDead();
}
}
public boolean func_146078_ca() {
return this.dataWatcher.getWatchableObjectByte(18) != 0;
}
public void func_146079_cb() {
this.dataWatcher.updateObject(18, Byte.valueOf((byte) 1));
}
public void setPowered(int power) {
this.dataWatcher.updateObject(17, power);
}
}

View File

@ -1,286 +0,0 @@
package com.hbm.entity.mob;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.GeneralConfig;
import com.hbm.entity.mob.ai.EntityAITaintedCreeperSwell;
import api.hbm.entity.IRadiationImmune;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityTaintedCreeper extends EntityMob implements IRadiationImmune {
private int lastActiveTime;
private int timeSinceIgnited;
private int fuseTime = 30;
private int explosionRadius = 20;
public EntityTaintedCreeper(World p_i1733_1_) {
super(p_i1733_1_);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAITaintedCreeperSwell(this));
this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, false));
this.tasks.addTask(4, new EntityAIWander(this, 0.8D));
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityOcelot.class, 0, true));
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D);
}
@Override
public boolean isAIEnabled() {
return true;
}
@Override
public int getMaxSafePointTries() {
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
}
@Override
protected void fall(float p_70069_1_) {
super.fall(p_70069_1_);
this.timeSinceIgnited = (int) (this.timeSinceIgnited + p_70069_1_ * 1.5F);
if(this.timeSinceIgnited > this.fuseTime - 5) {
this.timeSinceIgnited = this.fuseTime - 5;
}
}
@Override
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(16, Byte.valueOf((byte) -1));
this.dataWatcher.addObject(17, Byte.valueOf((byte) 0));
this.dataWatcher.addObject(18, Byte.valueOf((byte) 0));
}
@Override
public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
super.writeEntityToNBT(p_70014_1_);
if(this.dataWatcher.getWatchableObjectByte(17) == 1) {
p_70014_1_.setBoolean("powered", true);
}
p_70014_1_.setShort("Fuse", (short) this.fuseTime);
p_70014_1_.setByte("ExplosionRadius", (byte) this.explosionRadius);
p_70014_1_.setBoolean("ignited", this.func_146078_ca());
}
@Override
public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
super.readEntityFromNBT(p_70037_1_);
this.dataWatcher.updateObject(17, Byte.valueOf((byte) (p_70037_1_.getBoolean("powered") ? 1 : 0)));
if(p_70037_1_.hasKey("Fuse", 99)) {
this.fuseTime = p_70037_1_.getShort("Fuse");
}
if(p_70037_1_.hasKey("ExplosionRadius", 99)) {
this.explosionRadius = p_70037_1_.getByte("ExplosionRadius");
}
if(p_70037_1_.getBoolean("ignited")) {
this.func_146079_cb();
}
}
@Override
public void onUpdate() {
if(this.isEntityAlive()) {
this.lastActiveTime = this.timeSinceIgnited;
if(this.func_146078_ca()) {
this.setCreeperState(1);
}
int i = this.getCreeperState();
if(i > 0 && this.timeSinceIgnited == 0) {
this.playSound("creeper.primed", 1.0F * 30 / 75, 0.5F);
}
this.timeSinceIgnited += i;
if(this.timeSinceIgnited < 0) {
this.timeSinceIgnited = 0;
}
if(this.timeSinceIgnited >= this.fuseTime) {
this.timeSinceIgnited = this.fuseTime;
this.func_146077_cc();
}
}
super.onUpdate();
if(this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
this.heal(1.0F);
}
}
@Override
protected String getHurtSound() {
return "mob.creeper.say";
}
@Override
protected String getDeathSound() {
return "mob.creeper.death";
}
@Override
public void onDeath(DamageSource p_70645_1_) {
super.onDeath(p_70645_1_);
}
@Override
public boolean attackEntityAsMob(Entity p_70652_1_) {
return true;
}
public boolean getPowered() {
return this.dataWatcher.getWatchableObjectByte(17) == 1;
}
@SideOnly(Side.CLIENT)
public float getCreeperFlashIntensity(float p_70831_1_) {
return (this.lastActiveTime + (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (this.fuseTime - 2);
}
@Override
protected Item getDropItem() {
return Item.getItemFromBlock(Blocks.tnt);
}
public int getCreeperState() {
return this.dataWatcher.getWatchableObjectByte(16);
}
public void setCreeperState(int p_70829_1_) {
this.dataWatcher.updateObject(16, Byte.valueOf((byte) p_70829_1_));
}
@Override
public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
super.onStruckByLightning(p_70077_1_);
this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1));
}
@Override
protected boolean interact(EntityPlayer p_70085_1_) {
ItemStack itemstack = p_70085_1_.inventory.getCurrentItem();
if(itemstack != null && itemstack.getItem() == Items.flint_and_steel) {
this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.ignite", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
p_70085_1_.swingItem();
if(!this.worldObj.isRemote) {
this.func_146079_cb();
itemstack.damageItem(1, p_70085_1_);
return true;
}
}
return super.interact(p_70085_1_);
}
private void func_146077_cc() {
if(!this.worldObj.isRemote) {
this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
if(this.getPowered()) {
this.explosionRadius *= 3;
}
worldObj.newExplosion(this, posX, posY, posZ, 5.0F, false, false);
if(this.getPowered()) {
for(int i = 0; i < 255; i++) {
int a = rand.nextInt(15) + (int) posX - 7;
int b = rand.nextInt(15) + (int) posY - 7;
int c = rand.nextInt(15) + (int) posZ - 7;
if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c)) {
if(!GeneralConfig.enableHardcoreTaint)
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 5, 2);
else
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3), 2);
}
}
} else {
for(int i = 0; i < 85; i++) {
int a = rand.nextInt(7) + (int) posX - 3;
int b = rand.nextInt(7) + (int) posY - 3;
int c = rand.nextInt(7) + (int) posZ - 3;
if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c)) {
if(!GeneralConfig.enableHardcoreTaint)
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(6) + 10, 2);
else
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 4, 2);
}
}
}
this.setDead();
}
}
public static boolean hasPosNeightbour(World world, int x, int y, int z) {
Block b0 = world.getBlock(x + 1, y, z);
Block b1 = world.getBlock(x, y + 1, z);
Block b2 = world.getBlock(x, y, z + 1);
Block b3 = world.getBlock(x - 1, y, z);
Block b4 = world.getBlock(x, y - 1, z);
Block b5 = world.getBlock(x, y, z - 1);
boolean b = (b0.renderAsNormalBlock() && b0.getMaterial().isOpaque()) || (b1.renderAsNormalBlock() && b1.getMaterial().isOpaque()) || (b2.renderAsNormalBlock() && b2.getMaterial().isOpaque()) || (b3.renderAsNormalBlock() && b3.getMaterial().isOpaque()) || (b4.renderAsNormalBlock() && b4.getMaterial().isOpaque()) || (b5.renderAsNormalBlock() && b5.getMaterial().isOpaque());
return b;
}
public boolean func_146078_ca() {
return this.dataWatcher.getWatchableObjectByte(18) != 0;
}
public void func_146079_cb() {
this.dataWatcher.updateObject(18, Byte.valueOf((byte) 1));
}
public void setPowered(int power) {
this.dataWatcher.updateObject(17, power);
}
}

View File

@ -1,71 +0,0 @@
package com.hbm.entity.mob.ai;
import com.hbm.entity.mob.EntityNuclearCreeper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
public class EntityAINuclearCreeperSwell extends EntityAIBase {
/** The creeper that is swelling. */
EntityNuclearCreeper swellingCreeper;
/** The creeper's attack target. This is used for the changing of the creeper's state. */
EntityLivingBase creeperAttackTarget;
public EntityAINuclearCreeperSwell(EntityNuclearCreeper p_i1655_1_)
{
this.swellingCreeper = p_i1655_1_;
this.setMutexBits(1);
}
/**
* Returns whether the EntityAIBase should begin execution.
*/
@Override
public boolean shouldExecute()
{
EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget();
return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSqToEntity(entitylivingbase) < 9.0D;
}
/**
* Execute a one shot task or start executing a continuous task
*/
@Override
public void startExecuting()
{
this.swellingCreeper.getNavigator().clearPathEntity();
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
}
/**
* Resets the task
*/
@Override
public void resetTask()
{
this.creeperAttackTarget = null;
}
/**
* Updates the task
*/
@Override
public void updateTask()
{
if (this.creeperAttackTarget == null)
{
this.swellingCreeper.setCreeperState(-1);
}
else if (this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D)
{
this.swellingCreeper.setCreeperState(-1);
}
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
{
this.swellingCreeper.setCreeperState(-1);
}
else
{
this.swellingCreeper.setCreeperState(1);
}
}
}

View File

@ -1,71 +0,0 @@
package com.hbm.entity.mob.ai;
import com.hbm.entity.mob.EntityTaintedCreeper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
public class EntityAITaintedCreeperSwell extends EntityAIBase {
/** The creeper that is swelling. */
EntityTaintedCreeper swellingCreeper;
/** The creeper's attack target. This is used for the changing of the creeper's state. */
EntityLivingBase creeperAttackTarget;
public EntityAITaintedCreeperSwell(EntityTaintedCreeper p_i1655_1_)
{
this.swellingCreeper = p_i1655_1_;
this.setMutexBits(1);
}
/**
* Returns whether the EntityAIBase should begin execution.
*/
@Override
public boolean shouldExecute()
{
EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget();
return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSqToEntity(entitylivingbase) < 9.0D;
}
/**
* Execute a one shot task or start executing a continuous task
*/
@Override
public void startExecuting()
{
this.swellingCreeper.getNavigator().clearPathEntity();
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
}
/**
* Resets the task
*/
@Override
public void resetTask()
{
this.creeperAttackTarget = null;
}
/**
* Updates the task
*/
@Override
public void updateTask()
{
if (this.creeperAttackTarget == null)
{
this.swellingCreeper.setCreeperState(-1);
}
else if (this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D)
{
this.swellingCreeper.setCreeperState(-1);
}
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
{
this.swellingCreeper.setCreeperState(-1);
}
else
{
this.swellingCreeper.setCreeperState(1);
}
}
}

View File

@ -32,7 +32,7 @@ import net.minecraft.world.World;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.generic.RedBarrel;
import com.hbm.entity.grenade.EntityGrenadeTau;
import com.hbm.entity.mob.EntityNuclearCreeper;
import com.hbm.entity.mob.EntityCreeperNuclear;
import com.hbm.entity.particle.EntityBSmokeFX;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
@ -494,7 +494,7 @@ public class EntityBullet extends Entity implements IProjectile {
if (entitylivingbase instanceof EntityPlayer
&& ArmorUtil.checkForHazmat((EntityPlayer) entitylivingbase)) {
} else if (entitylivingbase instanceof EntityCreeper) {
EntityNuclearCreeper creep = new EntityNuclearCreeper(this.worldObj);
EntityCreeperNuclear creep = new EntityCreeperNuclear(this.worldObj);
creep.setLocationAndAngles(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ,
entitylivingbase.rotationYaw, entitylivingbase.rotationPitch);
if (!entitylivingbase.isDead)
@ -509,7 +509,7 @@ public class EntityBullet extends Entity implements IProjectile {
if (!this.worldObj.isRemote)
this.worldObj.spawnEntityInWorld(creep);
} else if (entitylivingbase instanceof EntityLivingBase
&& !(entitylivingbase instanceof EntityNuclearCreeper)
&& !(entitylivingbase instanceof EntityCreeperNuclear)
&& !(entitylivingbase instanceof EntityMooshroom)
&& !(entitylivingbase instanceof EntityZombie)) {
entitylivingbase.addPotionEffect(new PotionEffect(Potion.poison.getId(), 2 * 60 * 20, 2));

View File

@ -12,6 +12,7 @@ import com.hbm.inventory.fluid.trait.FT_Combustible;
import com.hbm.inventory.fluid.trait.FT_Corrosive;
import com.hbm.inventory.fluid.trait.FT_Flammable;
import com.hbm.inventory.fluid.trait.FT_Poison;
import com.hbm.inventory.fluid.trait.FT_Toxin;
import com.hbm.inventory.fluid.trait.FT_VentRadiation;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
@ -58,10 +59,6 @@ public class EntityChemical extends EntityThrowableNT {
* if CORROSIVE: apply extra acid damage, poison effect as well as armor degradation
*/
public double lastClientPosX = -1;
public double lastClientPosY = -1;
public double lastClientPosZ = -1;
public EntityChemical(World world) {
super(world);
this.ignoreFrustumCheck = true;
@ -257,6 +254,14 @@ public class EntityChemical extends EntityThrowableNT {
}
}
if(type.hasTrait(FT_Toxin.class)) {
FT_Toxin trait = type.getTrait(FT_Toxin.class);
if(living != null) {
trait.affect(living, intensity);
}
}
if(type == Fluids.XPJUICE) {
if(e instanceof EntityPlayer) {

View File

@ -51,7 +51,7 @@ public class EntityMeteor extends Entity {
ExplosionLarge.spawnParticles(worldObj, posX, posY, posZ - 5, 75);
}
(new Meteorite()).generate(worldObj, rand, (int) Math.round(this.posX - 0.5D), (int) Math.round(this.posY - 0.5D), (int) Math.round(this.posZ - 0.5D), safe, true);
(new Meteorite()).generate(worldObj, rand, (int) Math.round(this.posX - 0.5D), (int) Math.round(this.posY - 0.5D), (int) Math.round(this.posZ - 0.5D), safe, true, true);
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "hbm:entity.oldExplosion", 10000.0F, 0.5F + this.rand.nextFloat() * 0.1F);
this.setDead();
}

View File

@ -1,73 +0,0 @@
package com.hbm.entity.qic;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class EntitySPV extends Entity {
public EntitySPV(World p_i1582_1_) {
super(p_i1582_1_);
this.setSize(0.5F, 0.5F);
}
@Override
protected void entityInit() { }
@Override
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { }
@Override
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { }
@Override
public void onUpdate() {
if(this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase && ((EntityLivingBase)this.riddenByEntity).moveForward != 0) {
EntityLivingBase riding = (EntityLivingBase) this.riddenByEntity;
Vec3 vec = riding.getLookVec();
this.motionX = vec.xCoord * riding.moveForward * 0.25D;
this.motionY = vec.yCoord * riding.moveForward * 0.25D;
this.motionZ = vec.zCoord * riding.moveForward * 0.25D;
} else if(this.riddenByEntity == null) {
this.motionY -= 0.01D;
if(this.onGround) {
this.motionX = 0;
this.motionY = 0;
this.motionZ = 0;
}
} else {
this.motionX = 0;
this.motionY = 0;
this.motionZ = 0;
}
this.moveEntity(this.motionX, this.motionY, this.motionZ);
//this.setPositionAndRotation(this.posX + motionX, this.posY + motionY, this.posZ + motionZ, this.rotationYaw, this.rotationPitch);
super.onUpdate();
}
@Override
public boolean canBeCollidedWith() {
return true;
}
@Override
public boolean interactFirst(EntityPlayer player) {
if(super.interactFirst(player)) {
return true;
} else if(!this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == player)) {
player.mountEntity(this);
return true;
} else {
return false;
}
}
}

View File

@ -177,7 +177,7 @@ public class HazardRegistry {
HazardSystem.register(lamp_demon, makeData(RADIATION, 100_000F));
HazardSystem.register(cell_tritium, makeData(RADIATION, 0.001F));
HazardSystem.register(cell_sas3, makeData().addEntry(RADIATION, sas3).addEntry(BLINDING, 10F));
HazardSystem.register(cell_sas3, makeData().addEntry(RADIATION, sas3).addEntry(BLINDING, 60F));
HazardSystem.register(cell_balefire, makeData(RADIATION, 50F));
HazardSystem.register(powder_balefire, makeData(RADIATION, 500F));
HazardSystem.register(egg_balefire_shard, makeData(RADIATION, bf * nugget));

View File

@ -28,6 +28,7 @@ import com.hbm.items.ItemEnums.EnumCokeType;
import com.hbm.items.ItemEnums.EnumTarType;
import com.hbm.items.special.ItemBedrockOre.EnumBedrockOre;
import com.hbm.main.MainRegistry;
import com.hbm.util.Compat;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.block.Block;
@ -110,7 +111,7 @@ public class OreDictManager {
/*
* RADIOACTIVE
*/
public static final DictFrame U = new DictFrame("Uranium");
public static final DictFrame U = new DictFrame(Compat.isModLoaded(Compat.MOD_GT6) ? "Uraninite" : "Uranium");
public static final DictFrame U233 = new DictFrame("Uranium233", "U233");
public static final DictFrame U235 = new DictFrame("Uranium235", "U235");
public static final DictFrame U238 = new DictFrame("Uranium238", "U238");
@ -862,18 +863,19 @@ public class OreDictManager {
return this;
}
public String any() { return ANY + groupName; }
public String nugget() { return NUGGET + groupName; }
public String tiny() { return TINY + groupName; }
public String ingot() { return INGOT + groupName; }
public String dustTiny() { return DUSTTINY + groupName; }
public String dust() { return DUST + groupName; }
public String gem() { return GEM + groupName; }
public String crystal() { return CRYSTAL + groupName; }
public String plate() { return PLATE + groupName; }
public String billet() { return BILLET + groupName; }
public String block() { return BLOCK + groupName; }
public String ore() { return ORE + groupName; }
public String any() { return ANY + groupName; }
public String nugget() { return NUGGET + groupName; }
public String tiny() { return TINY + groupName; }
public String ingot() { return INGOT + groupName; }
public String dustTiny() { return DUSTTINY + groupName; }
public String dust() { return DUST + groupName; }
public String gem() { return GEM + groupName; }
public String crystal() { return CRYSTAL + groupName; }
public String plate() { return PLATE + groupName; }
public String plateTriple() { return PLATECAST + groupName; }
public String billet() { return BILLET + groupName; }
public String block() { return BLOCK + groupName; }
public String ore() { return ORE + groupName; }
}
private static void addReRegistration(String original, String additional) {

View File

@ -31,7 +31,7 @@ public class SlotCraftingOutput extends Slot {
if(item == Item.getItemFromBlock(ModBlocks.machine_chemplant))
player.triggerAchievement(MainRegistry.achChemplant);
if(item == Item.getItemFromBlock(ModBlocks.concrete) || item == Item.getItemFromBlock(ModBlocks.concrete_asbestos))
if(item == Item.getItemFromBlock(ModBlocks.concrete_smooth) || item == Item.getItemFromBlock(ModBlocks.concrete_asbestos))
player.triggerAchievement(MainRegistry.achConcrete);
if(item == ModItems.ingot_polymer)
player.triggerAchievement(MainRegistry.achPolymer);

View File

@ -14,26 +14,26 @@ public class ContainerCraneExtractor extends Container {
protected TileEntityCraneExtractor extractor;
public ContainerCraneExtractor(InventoryPlayer invPlayer, TileEntityCraneExtractor inserter) {
this.extractor = inserter;
public ContainerCraneExtractor(InventoryPlayer invPlayer, TileEntityCraneExtractor extractor) {
this.extractor = extractor;
//filter
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 3; j++) {
this.addSlotToContainer(new Slot(inserter, j + i * 3, 71 + j * 18, 17 + i * 18));
this.addSlotToContainer(new Slot(extractor, j + i * 3, 71 + j * 18, 17 + i * 18));
}
}
//buffer
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 3; j++) {
this.addSlotToContainer(new Slot(inserter, 9 + j + i * 3, 8 + j * 18, 17 + i * 18));
this.addSlotToContainer(new Slot(extractor, 9 + j + i * 3, 8 + j * 18, 17 + i * 18));
}
}
//upgrades
this.addSlotToContainer(new SlotUpgrade(inserter, 18, 152, 23));
this.addSlotToContainer(new SlotUpgrade(inserter, 19, 152, 47));
this.addSlotToContainer(new SlotUpgrade(extractor, 18, 152, 23));
this.addSlotToContainer(new SlotUpgrade(extractor, 19, 152, 47));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {
@ -102,8 +102,6 @@ public class ContainerCraneExtractor extends Container {
//M3: 3
//SHIFT: 1
//DRAG: 5
//System.out.println("Mode " + mode);
//System.out.println("Slot " + index);
if(index < 0 || index > 8) {
return super.slotClick(index, button, mode, player);

View File

@ -0,0 +1,126 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotUpgrade;
import com.hbm.items.ModItems;
import com.hbm.tileentity.network.TileEntityCraneGrabber;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerCraneGrabber extends Container {
protected TileEntityCraneGrabber grabber;
public ContainerCraneGrabber(InventoryPlayer invPlayer, TileEntityCraneGrabber grabber) {
this.grabber = grabber;
//filter
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 3; j++) {
this.addSlotToContainer(new Slot(grabber, j + i * 3, 40 + j * 18, 17 + i * 18));
}
}
//upgrades
this.addSlotToContainer(new SlotUpgrade(grabber, 9, 121, 23));
this.addSlotToContainer(new SlotUpgrade(grabber, 10, 121, 47));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 103 + i * 18));
}
}
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 161));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slot) {
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(slot);
if(var4 != null && var4.getHasStack()) {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if(slot < 9) { //filters
return null;
}
if(slot <= grabber.getSizeInventory() - 1) {
if(!this.mergeItemStack(var5, grabber.getSizeInventory(), this.inventorySlots.size(), true)) {
return null;
}
} else {
if(var3.getItem() == ModItems.upgrade_stack) {
if(!this.mergeItemStack(var5, 9, 10, false))
return null;
} else if(var3.getItem() == ModItems.upgrade_ejector) {
if(!this.mergeItemStack(var5, 10, 11, false))
return null;
}
return null;
}
if(var5.stackSize == 0) {
var4.putStack((ItemStack) null);
} else {
var4.onSlotChanged();
}
var4.onPickupFromSlot(player, var5);
}
return var3;
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return grabber.isUseableByPlayer(player);
}
@Override
public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) {
//L/R: 0
//M3: 3
//SHIFT: 1
//DRAG: 5
if(index < 0 || index > 8) {
return super.slotClick(index, button, mode, player);
}
Slot slot = this.getSlot(index);
ItemStack ret = null;
ItemStack held = player.inventory.getItemStack();
if(slot.getHasStack())
ret = slot.getStack().copy();
if(button == 1 && mode == 0 && slot.getHasStack()) {
grabber.nextMode(index);
return ret;
} else {
slot.putStack(held != null ? held.copy() : null);
if(slot.getHasStack()) {
slot.getStack().stackSize = 1;
}
slot.onSlotChanged();
grabber.matcher.initPatternStandard(grabber.getWorldObj(), slot.getStack(), index);
return ret;
}
}
}

View File

@ -6,10 +6,16 @@ import java.util.List;
import com.hbm.inventory.fluid.trait.*;
import com.hbm.inventory.fluid.trait.FluidTraitSimple.*;
import com.hbm.lib.ModDamageSource;
import com.hbm.inventory.fluid.trait.FT_Combustible.FuelGrade;
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType;
import com.hbm.inventory.fluid.trait.FT_Toxin.*;
import com.hbm.render.util.EnumSymbol;
import com.hbm.util.ArmorRegistry.HazardClass;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
public class Fluids {
@ -123,6 +129,7 @@ public class Fluids {
protected static final List<FluidType> metaOrder = new ArrayList();
public static final FT_Liquid LIQUID = new FT_Liquid();
public static final FT_Viscous VISCOUS = new FT_Viscous();
public static final FT_Gaseous_ART EVAP = new FT_Gaseous_ART();
public static final FT_Gaseous GASEOUS = new FT_Gaseous();
public static final FT_Plasma PLASMA = new FT_Plasma();
@ -154,19 +161,19 @@ public class Fluids {
SUPERHOTSTEAM = new FluidType("SUPERHOTSTEAM", 0xE7B7B7, 4, 0, 0, EnumSymbol.NONE).setTemp(450).setCompression(1D).addTraits(GASEOUS);
ULTRAHOTSTEAM = new FluidType("ULTRAHOTSTEAM", 0xE39393, 4, 0, 0, EnumSymbol.NONE).setTemp(600).setCompression(10D).addTraits(GASEOUS);
COOLANT = new FluidType("COOLANT", 0xd8fcff, 1, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
LAVA = new FluidType("LAVA", 0xFF3300, 4, 0, 0, EnumSymbol.NOWATER).setTemp(1200).addTraits(LIQUID);
LAVA = new FluidType("LAVA", 0xFF3300, 4, 0, 0, EnumSymbol.NOWATER).setTemp(1200).addTraits(LIQUID, VISCOUS);
DEUTERIUM = new FluidType("DEUTERIUM", 0x0000FF, 3, 4, 0, EnumSymbol.NONE).addTraits(new FT_Flammable(5_000), new FT_Combustible(FuelGrade.HIGH, 10_000), GASEOUS);
TRITIUM = new FluidType("TRITIUM", 0x000099, 3, 4, 0, EnumSymbol.RADIATION).addTraits(new FT_Flammable(5_000), new FT_Combustible(FuelGrade.HIGH, 10_000), GASEOUS, new FT_VentRadiation(0.001F));
OIL = new FluidType("OIL", 0x020202, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x424242)).addTraits(new FT_Flammable(10_000), LIQUID);
HOTOIL = new FluidType("HOTOIL", 0x300900, 2, 3, 0, EnumSymbol.NONE).setTemp(350).addTraits(new FT_Flammable(10_000), LIQUID);
HEAVYOIL = new FluidType("HEAVYOIL", 0x141312, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x513F39)).addTraits(new FT_Flammable(50_000), new FT_Combustible(FuelGrade.LOW, 25_000), LIQUID);
BITUMEN = new FluidType("BITUMEN", 0x1f2426, 2, 0, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x5A5877)).addTraits(LIQUID);
SMEAR = new FluidType("SMEAR", 0x190f01, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x624F3B)).addTraits(new FT_Flammable(50_000), LIQUID);
HEATINGOIL = new FluidType("HEATINGOIL", 0x211806, 2, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x694235)).addTraits(new FT_Flammable(150_000), new FT_Combustible(FuelGrade.LOW, 100_000), LIQUID);
RECLAIMED = new FluidType("RECLAIMED", 0x332b22, 2, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xF65723)).addTraits(new FT_Flammable(100_000), new FT_Combustible(FuelGrade.LOW, 200_000), LIQUID);
OIL = new FluidType("OIL", 0x020202, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x424242)).addTraits(new FT_Flammable(10_000), LIQUID, VISCOUS);
HOTOIL = new FluidType("HOTOIL", 0x300900, 2, 3, 0, EnumSymbol.NONE).setTemp(350).addTraits(new FT_Flammable(10_000), LIQUID, VISCOUS);
HEAVYOIL = new FluidType("HEAVYOIL", 0x141312, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x513F39)).addTraits(new FT_Flammable(50_000), new FT_Combustible(FuelGrade.LOW, 25_000), LIQUID, VISCOUS);
BITUMEN = new FluidType("BITUMEN", 0x1f2426, 2, 0, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x5A5877)).addTraits(LIQUID, VISCOUS);
SMEAR = new FluidType("SMEAR", 0x190f01, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x624F3B)).addTraits(new FT_Flammable(50_000), LIQUID, VISCOUS);
HEATINGOIL = new FluidType("HEATINGOIL", 0x211806, 2, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x694235)).addTraits(new FT_Flammable(150_000), new FT_Combustible(FuelGrade.LOW, 100_000), LIQUID, VISCOUS);
RECLAIMED = new FluidType("RECLAIMED", 0x332b22, 2, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xF65723)).addTraits(new FT_Flammable(100_000), new FT_Combustible(FuelGrade.LOW, 200_000), LIQUID, VISCOUS);
PETROIL = new FluidType("PETROIL", 0x44413d, 1, 3, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x2369F6)).addTraits(new FT_Flammable(125_000), new FT_Combustible(FuelGrade.MEDIUM, 300_000), LIQUID);
LUBRICANT = new FluidType("LUBRICANT", 0x606060, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xF1CC05)).addTraits(LIQUID);
NAPHTHA = new FluidType("NAPHTHA", 0x595744, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x5F6D44)).addTraits(new FT_Flammable(125_000), new FT_Combustible(FuelGrade.MEDIUM, 200_000), LIQUID);
NAPHTHA = new FluidType("NAPHTHA", 0x595744, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x5F6D44)).addTraits(new FT_Flammable(125_000), new FT_Combustible(FuelGrade.MEDIUM, 200_000), LIQUID, VISCOUS);
DIESEL = new FluidType("DIESEL", 0xf2eed5, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xFF2C2C)).addTraits(new FT_Flammable(200_000), new FT_Combustible(FuelGrade.HIGH, 500_000), LIQUID);
LIGHTOIL = new FluidType("LIGHTOIL", 0x8c7451, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xB46B52)).addTraits(new FT_Flammable(200_000), new FT_Combustible(FuelGrade.MEDIUM, 500_000), LIQUID);
KEROSENE = new FluidType("KEROSENE", 0xffa5d2, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xFF377D)).addTraits(new FT_Flammable(300_000), new FT_Combustible(FuelGrade.AERO, 1_250_000), LIQUID);
@ -183,20 +190,20 @@ public class Fluids {
AMAT = new FluidType("AMAT", 0x010101, 5, 0, 5, EnumSymbol.ANTIMATTER).addTraits(ANTI, GASEOUS);
ASCHRAB = new FluidType("ASCHRAB", 0xb50000, 5, 0, 5, EnumSymbol.ANTIMATTER).addTraits(ANTI, GASEOUS);
ACID = new FluidType("ACID", 0xfff7aa, 3, 0, 3, EnumSymbol.OXIDIZER).addTraits(new FT_Corrosive(40), LIQUID);
WATZ = new FluidType("WATZ", 0x86653E, 4, 0, 3, EnumSymbol.ACID).addTraits(new FT_Corrosive(60), new FT_VentRadiation(0.1F), LIQUID);
CRYOGEL = new FluidType("CRYOGEL", 0x32ffff, 2, 0, 0, EnumSymbol.CROYGENIC).setTemp(-170).addTraits(LIQUID);
WATZ = new FluidType("WATZ", 0x86653E, 4, 0, 3, EnumSymbol.ACID).addTraits(new FT_Corrosive(60), new FT_VentRadiation(0.1F), LIQUID, VISCOUS);
CRYOGEL = new FluidType("CRYOGEL", 0x32ffff, 2, 0, 0, EnumSymbol.CROYGENIC).setTemp(-170).addTraits(LIQUID, VISCOUS);
HYDROGEN = new FluidType("HYDROGEN", 0x4286f4, 3, 4, 0, EnumSymbol.CROYGENIC).setTemp(-260).addContainers(new CD_Gastank(0x4286f4, 0xffffff)).addTraits(new FT_Flammable(5_000), new FT_Combustible(FuelGrade.HIGH, 10_000), LIQUID, EVAP);
OXYGEN = new FluidType("OXYGEN", 0x98bdf9, 3, 0, 0, EnumSymbol.CROYGENIC).setTemp(-100).addContainers(new CD_Gastank(0x98bdf9, 0xffffff)).addTraits(LIQUID, EVAP);
XENON = new FluidType("XENON", 0xba45e8, 0, 0, 0, EnumSymbol.ASPHYXIANT).addContainers(new CD_Gastank(0x8C21FF, 0x303030)).addTraits(GASEOUS);
BALEFIRE = new FluidType("BALEFIRE", 0x28e02e, 4, 4, 3, EnumSymbol.RADIATION).setTemp(1500).addTraits(new FT_Corrosive(50), new FT_Flammable(1_000_000), new FT_Combustible(FuelGrade.HIGH, 2_500_000), LIQUID);
BALEFIRE = new FluidType("BALEFIRE", 0x28e02e, 4, 4, 3, EnumSymbol.RADIATION).setTemp(1500).addTraits(new FT_Corrosive(50), new FT_Flammable(1_000_000), new FT_Combustible(FuelGrade.HIGH, 2_500_000), LIQUID, VISCOUS);
MERCURY = new FluidType("MERCURY", 0x808080, 2, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, new FT_Poison(false, 2));
PAIN = new FluidType("PAIN", 0x938541, 2, 0, 1, EnumSymbol.ACID).setTemp(300).addTraits(new FT_Corrosive(30), new FT_Poison(true, 2), LIQUID);
WASTEFLUID = new FluidType("WASTEFLUID", 0x544400, 2, 0, 1, EnumSymbol.RADIATION).addTraits(new FT_VentRadiation(0.5F), NOCON, LIQUID);
PAIN = new FluidType("PAIN", 0x938541, 2, 0, 1, EnumSymbol.ACID).setTemp(300).addTraits(new FT_Corrosive(30), new FT_Poison(true, 2), LIQUID, VISCOUS);
WASTEFLUID = new FluidType("WASTEFLUID", 0x544400, 2, 0, 1, EnumSymbol.RADIATION).addTraits(new FT_VentRadiation(0.5F), NOCON, LIQUID, VISCOUS);
WASTEGAS = new FluidType("WASTEGAS", 0xB8B8B8, 2, 0, 1, EnumSymbol.RADIATION).addTraits(new FT_VentRadiation(0.5F), NOCON, GASEOUS);
GASOLINE = new FluidType("GASOLINE", 0x445772, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x2F7747)).addTraits(new FT_Flammable(400_000), new FT_Combustible(FuelGrade.HIGH, 1_000_000), LIQUID);
COALGAS = new FluidType("COALGAS", 0x445772, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x2E155F)).addTraits(new FT_Flammable(75_000), new FT_Combustible(FuelGrade.MEDIUM, 150_000), LIQUID);
SPENTSTEAM = new FluidType("SPENTSTEAM", 0x445772, 2, 0, 0, EnumSymbol.NONE).setCompression(1D).addTraits(NOCON, GASEOUS);
FRACKSOL = new FluidType("FRACKSOL", 0x798A6B, 1, 3, 3, EnumSymbol.ACID).addContainers(new CD_Canister(0x4F887F)).addTraits(new FT_Corrosive(15), new FT_Poison(false, 0), LIQUID);
FRACKSOL = new FluidType("FRACKSOL", 0x798A6B, 1, 3, 3, EnumSymbol.ACID).addContainers(new CD_Canister(0x4F887F)).addTraits(new FT_Corrosive(15), new FT_Poison(false, 0), LIQUID, VISCOUS);
PLASMA_DT = new FluidType("PLASMA_DT", 0xF7AFDE, 0, 4, 0, EnumSymbol.RADIATION).setTemp(3250).addTraits(NOCON, NOID, PLASMA);
PLASMA_HD = new FluidType("PLASMA_HD", 0xF0ADF4, 0, 4, 0, EnumSymbol.RADIATION).setTemp(2500).addTraits(NOCON, NOID, PLASMA);
PLASMA_HT = new FluidType("PLASMA_HT", 0xD1ABF2, 0, 4, 0, EnumSymbol.RADIATION).setTemp(3000).addTraits(NOCON, NOID, PLASMA);
@ -205,20 +212,20 @@ public class Fluids {
CARBONDIOXIDE = new FluidType("CARBONDIOXIDE", 0x404040, 3, 0, 0, EnumSymbol.ASPHYXIANT).addTraits(GASEOUS);
PLASMA_DH3 = new FluidType("PLASMA_DH3", 0xFF83AA, 0, 4, 0, EnumSymbol.RADIATION).setTemp(3480).addTraits(NOCON, NOID, PLASMA);
HELIUM3 = new FluidType("HELIUM3", 0xFCF0C4, 3, 4, 0, EnumSymbol.ASPHYXIANT).addTraits(GASEOUS);
DEATH = new FluidType("DEATH", 0x717A88, 2, 0, 1, EnumSymbol.ACID).setTemp(300).addTraits(new FT_Corrosive(80), new FT_Poison(true, 4), LEADCON, LIQUID);
DEATH = new FluidType("DEATH", 0x717A88, 2, 0, 1, EnumSymbol.ACID).setTemp(300).addTraits(new FT_Corrosive(80), new FT_Poison(true, 4), LEADCON, LIQUID, VISCOUS);
ETHANOL = new FluidType("ETHANOL", 0xe0ffff, 2, 3, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xEAFFF3)).addTraits(new FT_Flammable(75_000), new FT_Combustible(FuelGrade.HIGH, 200_000), LIQUID);
HEAVYWATER = new FluidType("HEAVYWATER", 0x00a0b0, 1, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
CRACKOIL = new FluidType("CRACKOIL", 0x020202, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x424242)).addTraits(new FT_Flammable(10_000), LIQUID);
COALOIL = new FluidType("COALOIL", 0x020202, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x424242)).addTraits(new FT_Flammable(10_000), LIQUID);
HOTCRACKOIL = new FluidType("HOTCRACKOIL", 0x300900, 2, 3, 0, EnumSymbol.NONE).setTemp(350).addContainers(new CD_Canister(0x424242)).addTraits(new FT_Flammable(10_000), LIQUID);
NAPHTHA_CRACK = new FluidType("NAPHTHA_CRACK", 0x595744, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x5F6D44)).addTraits(new FT_Flammable(125_000), new FT_Combustible(FuelGrade.MEDIUM, 200_000), LIQUID);
CRACKOIL = new FluidType("CRACKOIL", 0x020202, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x424242)).addTraits(new FT_Flammable(10_000), LIQUID, VISCOUS);
COALOIL = new FluidType("COALOIL", 0x020202, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x424242)).addTraits(new FT_Flammable(10_000), LIQUID, VISCOUS);
HOTCRACKOIL = new FluidType("HOTCRACKOIL", 0x300900, 2, 3, 0, EnumSymbol.NONE).setTemp(350).addContainers(new CD_Canister(0x424242)).addTraits(new FT_Flammable(10_000), LIQUID, VISCOUS);
NAPHTHA_CRACK = new FluidType("NAPHTHA_CRACK", 0x595744, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x5F6D44)).addTraits(new FT_Flammable(125_000), new FT_Combustible(FuelGrade.MEDIUM, 200_000), LIQUID, VISCOUS);
LIGHTOIL_CRACK = new FluidType("LIGHTOIL_CRACK", 0x8c7451, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xB46B52)).addTraits(new FT_Flammable(200_000), new FT_Combustible(FuelGrade.MEDIUM, 500_000), LIQUID);
DIESEL_CRACK = new FluidType("DIESEL_CRACK", 0xf2eed5, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xFF2C2C)).addTraits(new FT_Flammable(200_000), new FT_Combustible(FuelGrade.HIGH, 450_000), LIQUID);
AROMATICS = new FluidType("AROMATICS", 0x68A09A, 1, 4, 1, EnumSymbol.NONE).addTraits(new FT_Flammable(25_000), LIQUID);
AROMATICS = new FluidType("AROMATICS", 0x68A09A, 1, 4, 1, EnumSymbol.NONE).addTraits(new FT_Flammable(25_000), LIQUID, VISCOUS);
UNSATURATEDS = new FluidType("UNSATURATEDS", 0x628FAE, 1, 4, 1, EnumSymbol.NONE).addTraits(new FT_Flammable(1_000_000), GASEOUS); //acetylene burns as hot as satan's asshole
SALIENT = new FluidType("SALIENT", 0x457F2D, 0, 0, 0, EnumSymbol.NONE).addTraits(DELICIOUS, LIQUID);
XPJUICE = new FluidType("XPJUICE", 0xBBFF09, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
ENDERJUICE = new FluidType("ENDERJUICE", 0x127766, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
SALIENT = new FluidType("SALIENT", 0x457F2D, 0, 0, 0, EnumSymbol.NONE).addTraits(DELICIOUS, LIQUID, VISCOUS);
XPJUICE = new FluidType("XPJUICE", 0xBBFF09, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
ENDERJUICE = new FluidType("ENDERJUICE", 0x127766, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
PETROIL_LEADED = new FluidType("PETROIL_LEADED", 0x44413d, 1, 3, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x2331F6)).addTraits(new FT_Flammable(125_000), new FT_Combustible(FuelGrade.MEDIUM, 450_000), LIQUID);
GASOLINE_LEADED = new FluidType("GASOLINE_LEADED", 0x445772, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x2F775A)).addTraits(new FT_Flammable(400_000), new FT_Combustible(FuelGrade.HIGH, 1_500_000), LIQUID);
COALGAS_LEADED = new FluidType("COALGAS_LEADED", 0x445772, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x1E155F)).addTraits(new FT_Flammable(75_000), new FT_Combustible(FuelGrade.MEDIUM, 250_000), LIQUID);
@ -226,32 +233,31 @@ public class Fluids {
COOLANT_HOT = new FluidType("COOLANT_HOT", 0x99525E, 1, 0, 0, EnumSymbol.NONE).setTemp(600).addTraits(LIQUID);
MUG = new FluidType("MUG", 0x4B2D28, 0, 0, 0, EnumSymbol.NONE).addTraits(DELICIOUS, LIQUID);
MUG_HOT = new FluidType("MUG_HOT", 0x6B2A20, 0, 0, 0, EnumSymbol.NONE).setTemp(500).addTraits(DELICIOUS, LIQUID);
WOODOIL = new FluidType("WOODOIL", 0x847D54, 2, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xBF7E4F)).addTraits(LIQUID);
COALCREOSOTE = new FluidType("COALCREOSOTE", 0x51694F, 3, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x285A3F)).addTraits(LIQUID);
SEEDSLURRY = new FluidType("SEEDSLURRY", 0x7CC35E, 0, 0, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x7CC35E)).addTraits(LIQUID);
WOODOIL = new FluidType("WOODOIL", 0x847D54, 2, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xBF7E4F)).addTraits(LIQUID, VISCOUS);
COALCREOSOTE = new FluidType("COALCREOSOTE", 0x51694F, 3, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x285A3F)).addTraits(LIQUID, VISCOUS);
SEEDSLURRY = new FluidType("SEEDSLURRY", 0x7CC35E, 0, 0, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x7CC35E)).addTraits(LIQUID, VISCOUS);
NITRIC_ACID = new FluidType("NITRIC_ACID", 0xBB7A1E, 3, 0, 2, EnumSymbol.OXIDIZER).addTraits(LIQUID, new FT_Corrosive(60));
SOLVENT = new FluidType("SOLVENT", 0xE4E3EF, 2, 3, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xE4E3EF)).addTraits(LIQUID, new FT_Corrosive(30));
BLOOD = new FluidType("BLOOD", 0xB22424, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
BLOOD_HOT = new FluidType("BLOOD_HOT", 0xF22419, 3, 0, 0, EnumSymbol.NONE).addTraits(LIQUID).setTemp(666); //it's funny because it's the satan number
BLOOD = new FluidType("BLOOD", 0xB22424, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
BLOOD_HOT = new FluidType("BLOOD_HOT", 0xF22419, 3, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS).setTemp(666); //it's funny because it's the satan number
SYNGAS = new FluidType("SYNGAS", 0x131313, 1, 4, 2, EnumSymbol.NONE).addContainers(new CD_Gastank(0xFFFFFF, 0x131313)).addTraits(GASEOUS);
OXYHYDROGEN = new FluidType("OXYHYDROGEN", 0x483FC1, 0, 4, 2, EnumSymbol.NONE).addTraits(GASEOUS);
RADIOSOLVENT = new FluidType("RADIOSOLVENT", 0xA4D7DD, 3, 3, 0, EnumSymbol.NONE).addTraits(LIQUID, LEADCON, new FT_Corrosive(50), new FT_VentRadiation(0.01F));
CHLORINE = new FluidType("CHLORINE", 0xBAB572, 3, 0, 0, EnumSymbol.OXIDIZER).addContainers(new CD_Gastank(0xBAB572, 0x887B34)).addTraits(GASEOUS, new FT_Corrosive(25), new FT_Poison(true, 1));
HEAVYOIL_VACUUM = new FluidType("HEAVYOIL_VACUUM", 0x131214, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID).addContainers(new CD_Canister(0x513F39));
REFORMATE = new FluidType("REFORMATE", 0x835472, 2, 2, 0, EnumSymbol.NONE).addTraits(LIQUID).addContainers(new CD_Canister(0xD180D6));
HEAVYOIL_VACUUM = new FluidType("HEAVYOIL_VACUUM", 0x131214, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS).addContainers(new CD_Canister(0x513F39));
REFORMATE = new FluidType("REFORMATE", 0x835472, 2, 2, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS).addContainers(new CD_Canister(0xD180D6));
LIGHTOIL_VACUUM = new FluidType("LIGHTOIL_VACUUM", 0x8C8851, 1, 2, 0, EnumSymbol.NONE).addTraits(LIQUID).addContainers(new CD_Canister(0xB46B52));
SOURGAS = new FluidType("SOURGAS", 0xC9BE0D, 4, 4, 0, EnumSymbol.ACID).addContainers(new CD_Gastank(0xC9BE0D, 0x303030)).addTraits(GASEOUS, new FT_Corrosive(10), new FT_Poison(false, 1));
XYLENE = new FluidType("XYLENE", 0x5C4E76, 2, 3, 0, EnumSymbol.NONE).addTraits(LIQUID).addContainers(new CD_Canister(0xA380D6));
HEATINGOIL_VACUUM = new FluidType("HEATINGOIL_VACUUM", 0x211D06, 2, 2, 0, EnumSymbol.NONE).addTraits(LIQUID).addContainers(new CD_Canister(0x694235));
XYLENE = new FluidType("XYLENE", 0x5C4E76, 2, 3, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS).addContainers(new CD_Canister(0xA380D6));
HEATINGOIL_VACUUM = new FluidType("HEATINGOIL_VACUUM", 0x211D06, 2, 2, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS).addContainers(new CD_Canister(0x694235));
DIESEL_REFORM = new FluidType("DIESEL_REFORM", 0xCDC3C6, 1, 2, 0, EnumSymbol.NONE).addTraits(LIQUID).addContainers(new CD_Canister(0xFFC500));
DIESEL_CRACK_REFORM = new FluidType("DIESEL_CRACK_REFORM",0xCDC3CC, 1, 2, 0, EnumSymbol.NONE).addTraits(LIQUID).addContainers(new CD_Canister(0xFFC500));
KEROSENE_REFORM = new FluidType("KEROSENE_REFORM", 0xFFA5F3, 1, 2, 0, EnumSymbol.NONE).addTraits(LIQUID).addContainers(new CD_Canister(0xFF377D));
REFORMGAS = new FluidType("REFORMGAS", 0x6362AE, 1, 4, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0x9392FF, 0xFFB992)).addTraits(GASEOUS);
COLLOID = new FluidType("COLLOID", 0x787878, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
COLLOID = new FluidType("COLLOID", 0x787878, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
PHOSGENE = new FluidType("PHOSGENE", 0xCFC4A4, 4, 0, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0xCFC4A4, 0x361414)).addTraits(GASEOUS);
MUSTARDGAS = new FluidType("MUSTARDGAS", 0xBAB572, 4, 1, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0xBAB572, 0x361414)).addTraits(GASEOUS);
IONGEL = new FluidType(103, "IONGEL", 0xB8FFFF, 1, 0, 4, EnumSymbol.NONE).addTraits(LIQUID);
IONGEL = new FluidType(103, "IONGEL", 0xB8FFFF, 1, 0, 4, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
// ^ ^ ^ ^ ^ ^ ^ ^
//ADD NEW FLUIDS HERE
@ -376,6 +382,11 @@ public class Fluids {
metaOrder.add(PLASMA_XM);
metaOrder.add(PLASMA_BF);
CHLORINE.addTraits(new FT_Toxin().addEntry(new ToxinDirectDamage(ModDamageSource.cloud, 2F, 20, HazardClass.GAS_CHLORINE, false)));
PHOSGENE.addTraits(new FT_Toxin().addEntry(new ToxinDirectDamage(ModDamageSource.cloud, 4F, 20, HazardClass.GAS_CHLORINE, false)));
MUSTARDGAS.addTraits(new FT_Toxin().addEntry(new ToxinDirectDamage(ModDamageSource.cloud, 4F, 10, HazardClass.GAS_CORROSIVE, false))
.addEntry(new ToxinEffects(HazardClass.GAS_CORROSIVE, true).add(new PotionEffect(Potion.wither.id, 100, 1), new PotionEffect(Potion.confusion.id, 100, 0))));
double eff_steam_boil = 1.0D;
double eff_steam_heatex = 0.25D;

View File

@ -53,6 +53,10 @@ public class FluidTank {
public void setTankType(FluidType type) {
if(type == null) {
type = Fluids.NONE;
}
if(this.type == type)
return;
@ -85,16 +89,16 @@ public class FluidTank {
}
//Called on TE update
public void updateTank(TileEntity te) {
@Deprecated public void updateTank(TileEntity te) {
updateTank(te, 100);
}
public void updateTank(TileEntity te, int range) {
@Deprecated public void updateTank(TileEntity te, int range) {
updateTank(te.xCoord, te.yCoord, te.zCoord, te.getWorldObj().provider.dimensionId, range);
}
public void updateTank(int x, int y, int z, int dim) {
@Deprecated public void updateTank(int x, int y, int z, int dim) {
updateTank(x, y, z, dim, 100);
}
public void updateTank(int x, int y, int z, int dim, int range) {
@Deprecated public void updateTank(int x, int y, int z, int dim, int range) {
PacketDispatcher.wrapper.sendToAllAround(new TEFluidPacket(x, y, z, fluid, index, type), new TargetPoint(dim, x, y, z, range));
}

View File

@ -4,6 +4,7 @@ import java.util.List;
import net.minecraft.util.EnumChatFormatting;
@Deprecated //use FT_Toxin instead
public class FT_Poison extends FluidTrait {
protected boolean withering = false;

View File

@ -0,0 +1,133 @@
package com.hbm.inventory.fluid.trait;
import java.util.ArrayList;
import java.util.List;
import com.hbm.util.ArmorRegistry;
import com.hbm.util.ArmorUtil;
import com.hbm.util.I18nUtil;
import com.hbm.util.ArmorRegistry.HazardClass;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraft.util.StringUtils;
public class FT_Toxin extends FluidTrait {
public List<ToxinEntry> entries = new ArrayList();
public FT_Toxin addEntry(ToxinEntry entry) {
entries.add(entry);
return this;
}
@Override
public void addInfoHidden(List<String> info) {
info.add(EnumChatFormatting.LIGHT_PURPLE + "[Toxin]");
for(ToxinEntry entry : entries) {
entry.addInfo(info);
}
}
public void affect(EntityLivingBase entity, double intensity) {
for(ToxinEntry entry : entries) {
entry.poison(entity, intensity);
}
}
public static abstract class ToxinEntry {
public HazardClass clazz;
public boolean fullBody = false;
public ToxinEntry(HazardClass clazz, boolean fullBody) {
this.clazz = clazz;
this.fullBody = fullBody;
}
public boolean isProtected(EntityLivingBase entity) {
boolean hasMask = clazz == null;
boolean hasSuit = !fullBody;
if(clazz != null && ArmorRegistry.hasAllProtection(entity, 3, clazz)) {
ArmorUtil.damageGasMaskFilter(entity, 1);
hasMask = true;
}
if(fullBody && ArmorUtil.checkForHazmat(entity)) {
hasSuit = true;
}
return hasMask && hasSuit;
}
public abstract void poison(EntityLivingBase entity, double intensity);
public abstract void addInfo(List<String> info);
}
public static class ToxinDirectDamage extends ToxinEntry {
public DamageSource damage;
public float amount;
public int delay;
public ToxinDirectDamage(DamageSource damage, float amount, int delay, HazardClass clazz, boolean fullBody) {
super(clazz, fullBody);
this.damage = damage;
this.amount = amount;
this.delay = delay;
}
@Override
public void poison(EntityLivingBase entity, double intensity) {
if(isProtected(entity)) return;
if(delay == 0 || entity.worldObj.getTotalWorldTime() % delay == 0) {
entity.attackEntityFrom(damage, (float) (amount * intensity));
}
}
@Override
public void addInfo(List<String> info) {
info.add(EnumChatFormatting.YELLOW + "- " + I18nUtil.resolveKey(clazz.lang) + (fullBody ? EnumChatFormatting.RED + " (requires hazmat suit)" : "") + ": " + EnumChatFormatting.YELLOW + String.format("%,.1f", amount * 20 / delay) + " DPS");
}
}
public static class ToxinEffects extends ToxinEntry {
public List<PotionEffect> effects = new ArrayList();
public ToxinEffects(HazardClass clazz, boolean fullBody) {
super(clazz, fullBody);
}
public ToxinEffects add(PotionEffect... effs) {
for(PotionEffect eff : effs) this.effects.add(eff);
return this;
}
@Override
public void poison(EntityLivingBase entity, double intensity) {
for(PotionEffect eff : effects) {
entity.addPotionEffect(new PotionEffect(eff.getPotionID(), (int) (eff.getDuration() * intensity), eff.getAmplifier()));
}
}
@Override
public void addInfo(List<String> info) {
info.add(EnumChatFormatting.YELLOW + "- " + I18nUtil.resolveKey(clazz.lang) + (fullBody ? EnumChatFormatting.RED + " (requires hazmat suit)" + EnumChatFormatting.YELLOW : "") + ":");
for(PotionEffect eff : effects) {
info.add(EnumChatFormatting.YELLOW + " - " + I18nUtil.resolveKey(eff.getEffectName()) + (eff.getAmplifier() > 0 ? " " + StatCollector.translateToLocal("potion.potency." + eff.getAmplifier()).trim() : "") + " " + StringUtils.ticksToElapsedTime(eff.getDuration()));
}
}
}
}

View File

@ -12,7 +12,8 @@ public class FluidTraitSimple {
}
}
public static class FT_Gaseous_ART extends FluidTrait { //at room temperature, for cryogenic hydrogen for example
/** gaseous at room temperature, for cryogenic hydrogen for example */
public static class FT_Gaseous_ART extends FluidTrait {
@Override public void addInfoHidden(List<String> info) {
info.add(EnumChatFormatting.BLUE + "[Gaseous at Room Temperature]");
}
@ -24,6 +25,13 @@ public class FluidTraitSimple {
}
}
/** to viscous to be sprayed/turned into a mist */
public static class FT_Viscous extends FluidTrait {
@Override public void addInfoHidden(List<String> info) {
info.add(EnumChatFormatting.BLUE + "[Viscous]");
}
}
public static class FT_Plasma extends FluidTrait {
@Override public void addInfoHidden(List<String> info) {
info.add(EnumChatFormatting.LIGHT_PURPLE + "[Plasma]");

View File

@ -22,11 +22,11 @@ import net.minecraft.util.ResourceLocation;
public class GUICraneExtractor extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_crane_ejector.png");
private TileEntityCraneExtractor inserter;
private TileEntityCraneExtractor ejector;
public GUICraneExtractor(InventoryPlayer invPlayer, TileEntityCraneExtractor tedf) {
super(new ContainerCraneExtractor(invPlayer, tedf));
inserter = tedf;
ejector = tedf;
this.xSize = 176;
this.ySize = 185;
@ -40,14 +40,14 @@ public class GUICraneExtractor extends GuiInfoContainer {
for(int i = 0; i < 9; ++i) {
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
if(this.isMouseOverSlot(slot, x, y) && inserter.matcher.modes[i] != null) {
if(this.isMouseOverSlot(slot, x, y) && ejector.matcher.modes[i] != null) {
String label = EnumChatFormatting.YELLOW + "";
switch(inserter.matcher.modes[i]) {
switch(ejector.matcher.modes[i]) {
case "exact": label += "Item and meta match"; break;
case "wildcard": label += "Item matches"; break;
default: label += "Ore dict key matches: " + inserter.matcher.modes[i]; break;
default: label += "Ore dict key matches: " + ejector.matcher.modes[i]; break;
}
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", label }), x, y - 30);
@ -65,13 +65,13 @@ public class GUICraneExtractor extends GuiInfoContainer {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
NBTTagCompound data = new NBTTagCompound();
data.setBoolean("whitelist", true);
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, inserter.xCoord, inserter.yCoord, inserter.zCoord));
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, ejector.xCoord, ejector.yCoord, ejector.zCoord));
}
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.inserter.hasCustomInventoryName() ? this.inserter.getInventoryName() : I18n.format(this.inserter.getInventoryName());
String name = this.ejector.hasCustomInventoryName() ? this.ejector.getInventoryName() : I18n.format(this.ejector.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
@ -82,7 +82,7 @@ public class GUICraneExtractor extends GuiInfoContainer {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(inserter.isWhitelist) {
if(ejector.isWhitelist) {
drawTexturedModalRect(guiLeft + 139, guiTop + 33, 176, 0, 3, 6);
} else {
drawTexturedModalRect(guiLeft + 139, guiTop + 47, 176, 0, 3, 6);

View File

@ -0,0 +1,91 @@
package com.hbm.inventory.gui;
import java.util.Arrays;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerCraneGrabber;
import com.hbm.lib.RefStrings;
import com.hbm.packet.NBTControlPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.network.TileEntityCraneGrabber;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
public class GUICraneGrabber extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_crane_grabber.png");
private TileEntityCraneGrabber grabber;
public GUICraneGrabber(InventoryPlayer invPlayer, TileEntityCraneGrabber tedf) {
super(new ContainerCraneGrabber(invPlayer, tedf));
grabber = tedf;
this.xSize = 176;
this.ySize = 185;
}
@Override
public void drawScreen(int x, int y, float interp) {
super.drawScreen(x, y, interp);
if(this.mc.thePlayer.inventory.getItemStack() == null) {
for(int i = 0; i < 9; ++i) {
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
if(this.isMouseOverSlot(slot, x, y) && grabber.matcher.modes[i] != null) {
String label = EnumChatFormatting.YELLOW + "";
switch(grabber.matcher.modes[i]) {
case "exact": label += "Item and meta match"; break;
case "wildcard": label += "Item matches"; break;
default: label += "Ore dict key matches: " + grabber.matcher.modes[i]; break;
}
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", label }), x, y - 30);
}
}
}
}
@Override
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
if(guiLeft + 97 <= x && guiLeft + 97 + 14 > x && guiTop + 30 < y && guiTop + 30 + 26 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
NBTTagCompound data = new NBTTagCompound();
data.setBoolean("whitelist", true);
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, grabber.xCoord, grabber.yCoord, grabber.zCoord));
}
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.grabber.hasCustomInventoryName() ? this.grabber.getInventoryName() : I18n.format(this.grabber.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(grabber.isWhitelist) {
drawTexturedModalRect(guiLeft + 108, guiTop + 33, 176, 0, 3, 6);
} else {
drawTexturedModalRect(guiLeft + 108, guiTop + 47, 176, 0, 3, 6);
}
}
}

View File

@ -4,11 +4,18 @@ import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerWatz;
import com.hbm.lib.RefStrings;
import com.hbm.packet.NBTControlPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.render.util.GaugeUtil;
import com.hbm.render.util.GaugeUtil.Gauge;
import com.hbm.tileentity.machine.TileEntityWatz;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
public class GUIWatz extends GuiInfoContainer {
@ -40,16 +47,31 @@ public class GUIWatz extends GuiInfoContainer {
protected void drawGuiContainerForegroundLayer(int i, int j) {
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 93, 4210752);
String flux = "" + ((int)(watz.fluxDisplay * 10)) / 10.0D;
this.fontRendererObj.drawString(flux, 159 - this.fontRendererObj.getStringWidth(flux), 105, 0x00ff00);
double scale = 1.25;
String flux = String.format("%,.1f", watz.fluxDisplay);
GL11.glScaled(1 / scale, 1 / scale, 1);
this.fontRendererObj.drawString(flux, (int) (161 * scale - this.fontRendererObj.getStringWidth(flux)), (int)(107 * scale), 0x00ff00);
GL11.glScaled(scale, scale, 1);
}
@Override
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
if(guiLeft + 142 <= x && guiLeft + 142 + 18 > x && guiTop + 70 < y && guiTop + 70 + 18 >= y) {
NBTTagCompound control = new NBTTagCompound();
control.setBoolean("lock", true);
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(control, watz.xCoord, watz.yCoord, watz.zCoord));
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1F));
}
}
@Override
protected void drawGuiContainerBackgroundLayer(float interp, int x, int y) {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
//float col = (float) (Math.sin(System.currentTimeMillis() / 500D) * 0.5 + 0.5);
//GL11.glColor4f(1.0F, col, col, 1.0F);
float col = MathHelper.clamp_float(1 - (float) Math.log(watz.heat / 100_000D + 1) * 0.4F, 0F, 1F);
GL11.glColor4f(1.0F, col, col, 1.0F);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 131, 122);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@ -59,6 +81,11 @@ public class GUIWatz extends GuiInfoContainer {
drawTexturedModalRect(guiLeft + 105, guiTop + 96, 185, 26, 30, 26);
drawTexturedModalRect(guiLeft + 9, guiTop + 96, 184, 0, 26, 26);
if(watz.isOn) drawTexturedModalRect(guiLeft + 147, guiTop + 8, 176, 0, 8, 8);
if(watz.isLocked) drawTexturedModalRect(guiLeft + 142, guiTop + 70, 210, 0, 18, 18);
GaugeUtil.renderGauge(Gauge.ROUND_SMALL, guiLeft + 13, guiTop + 100, this.zLevel, 1 - col);
watz.tanks[0].renderTank(guiLeft + 143, guiTop + 69, this.zLevel, 4, 43);
watz.tanks[1].renderTank(guiLeft + 149, guiTop + 69, this.zLevel, 4, 43);
watz.tanks[2].renderTank(guiLeft + 155, guiTop + 69, this.zLevel, 4, 43);

View File

@ -114,15 +114,15 @@ public class Mats {
public static final NTMMaterial MAT_ALLOY = makeSmeltable(_AS + 2, ALLOY, 0xFF8330, 0x700000, 0xFF7318).setShapes(WIRE, INGOT, DUST, PLATE, CASTPLATE, BLOCK);
public static final NTMMaterial MAT_DURA = makeSmeltable(_AS + 3, DURA, 0x183039, 0x030B0B, 0x376373).setShapes(INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_SATURN = makeSmeltable(_AS + 4, BIGMT, 0x4DA3AF, 0x00000C, 0x4DA3AF).setShapes(INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_DESH = makeSmeltable(_AS + 12, DESH, 0xFF6D6D, 0x720000, 0xF22929).setShapes(INGOT, DUST, CASTPLATE, BLOCK);
public static final NTMMaterial MAT_STAR = makeSmeltable(_AS + 5, STAR, 0xCCCCEA, 0x11111A, 0xA5A5D3).setShapes(INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_TCALLOY = makeSmeltable(_AS + 6, TCALLOY, 0xD4D6D6, 0x323D3D, 0x9CA6A6).setShapes(INGOT, DUST, CASTPLATE);
public static final NTMMaterial MAT_FERRO = makeSmeltable(_AS + 7, FERRO, 0xB7B7C9, 0x101022, 0x6B6B8B).setShapes(INGOT);
public static final NTMMaterial MAT_TCALLOY = makeSmeltable(_AS + 6, TCALLOY, 0xD4D6D6, 0x323D3D, 0x9CA6A6).setShapes(INGOT, DUST, CASTPLATE);
public static final NTMMaterial MAT_CDALLOY = makeSmeltable(_AS + 13, CDALLOY, 0xF7DF8F, 0x604308, 0xFBD368).setShapes(INGOT, CASTPLATE);
public static final NTMMaterial MAT_MAGTUNG = makeSmeltable(_AS + 8, MAGTUNG, 0x22A2A2, 0x0F0F0F, 0x22A2A2).setShapes(INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_CMB = makeSmeltable(_AS + 9, CMB, 0x6F6FB4, 0x000011, 0x6F6FB4).setShapes(INGOT, DUST, PLATE, CASTPLATE, BLOCK);
public static final NTMMaterial MAT_FLUX = makeAdditive(_AS + 10, df("Flux"), 0xF1E0BB, 0x6F6256, 0xDECCAD).setShapes(DUST);
public static final NTMMaterial MAT_SLAG = makeSmeltable(_AS + 11, SLAG, 0x554940, 0x34281F, 0x6C6562).setShapes(BLOCK);
public static final NTMMaterial MAT_DESH = makeSmeltable(_AS + 12, DESH, 0xFF6D6D, 0x720000, 0xF22929).setShapes(INGOT, DUST, CASTPLATE, BLOCK);
public static final NTMMaterial MAT_CDALLOY = makeSmeltable(_AS + 13, CDALLOY, 0xF7DF8F, 0x604308, 0xFBD368).setShapes(INGOT, CASTPLATE);
@Deprecated public static NTMMaterial makeSmeltable(int id, DictFrame dict, int color) { return makeSmeltable(id, dict, color, color, color); }
@Deprecated public static NTMMaterial makeAdditive(int id, DictFrame dict, int color) { return makeAdditive(id, dict, color, color, color); }

View File

@ -304,11 +304,8 @@ public class AssemblerRecipes {
makeRecipe(new ComparableStack(ModBlocks.fusion_motor, 1), new AStack[] {new OreDictStack(TI.ingot(), 4), new OreDictStack(STEEL.ingot(), 2), new ComparableStack(ModItems.motor, 4), },250);
makeRecipe(new ComparableStack(ModBlocks.fusion_heater, 1), new AStack[] {new OreDictStack(W.ingot(), 4), new OreDictStack(STEEL.plate528(), 2), new OreDictStack(OreDictManager.getReflector(), 2), new OreDictStack(CU.plate(), 4), new ComparableStack(ModItems.magnetron, 1), new ComparableStack(ModItems.wire_advanced_alloy, 4), },150);
makeRecipe(new ComparableStack(ModBlocks.watz_element, 1), new AStack[] {new OreDictStack(W.ingot(), 4), new OreDictStack(ALLOY.plate(), 4), new ComparableStack(ModItems.rod_empty, 2), new ComparableStack(ModItems.wire_magnetized_tungsten, 2), new ComparableStack(ModItems.wire_advanced_alloy, 4), },200);
makeRecipe(new ComparableStack(ModBlocks.watz_control, 1), new AStack[] {new OreDictStack(W.ingot(), 4), new OreDictStack(ALLOY.ingot(), 4), new OreDictStack(PB.ingot(), 2), new ComparableStack(ModItems.wire_magnetized_tungsten, 4), new ComparableStack(ModItems.wire_advanced_alloy, 2), },250);
makeRecipe(new ComparableStack(ModBlocks.watz_cooler, 1), new AStack[] {new OreDictStack(W.ingot(), 2), new OreDictStack(STEEL.ingot(), 2), new OreDictStack(KNO.dust(), 4), },300);
makeRecipe(new ComparableStack(ModBlocks.watz_end, 1), new AStack[] {new OreDictStack(W.ingot(), 2), new OreDictStack(PB.ingot(), 2), new OreDictStack(STEEL.ingot(), 3), },150);
makeRecipe(new ComparableStack(ModBlocks.watz_hatch, 1), new AStack[] {new ComparableStack(ModBlocks.reinforced_brick, 1), new OreDictStack(TI.plate(), 6), },200);
makeRecipe(new ComparableStack(ModBlocks.watz_conductor, 1), new AStack[] {new OreDictStack(W.ingot(), 2), new OreDictStack(PB.ingot(), 2), new OreDictStack(STEEL.ingot(), 2), new ComparableStack(ModItems.wire_red_copper, 6), new ComparableStack(ModItems.wire_magnetized_tungsten, 2), new ComparableStack(ModItems.fuse, 4), },250);
makeRecipe(new ComparableStack(ModBlocks.watz_end, 3), new AStack[] {new OreDictStack(ANY_RESISTANTALLOY.plateTriple()), new OreDictStack(B.ingot(), 3), new OreDictStack(STEEL.plate(), 9), }, 100);
makeRecipe(new ComparableStack(ModBlocks.watz_core, 1), new AStack[] {new ComparableStack(ModBlocks.block_meteor, 1), new ComparableStack(ModItems.circuit_gold, 5), new ComparableStack(ModItems.circuit_schrabidium, 2), new ComparableStack(ModItems.wire_magnetized_tungsten, 12), },350);
makeRecipe(new ComparableStack(ModBlocks.fwatz_hatch, 1), new AStack[] {new OreDictStack(W.ingot(), 6), new OreDictStack(CMB.plate(), 4), },250);
makeRecipe(new ComparableStack(ModBlocks.fwatz_conductor, 1), new AStack[] {new OreDictStack(CMB.plate(), 2), new ComparableStack(ModItems.coil_magnetized_tungsten, 5), },250);

View File

@ -12,6 +12,7 @@ import com.google.gson.stream.JsonWriter;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.GeneralConfig;
import com.hbm.handler.imc.IMCCentrifuge;
import static com.hbm.inventory.OreDictManager.*;
import com.hbm.inventory.OreDictManager.DictFrame;
import com.hbm.inventory.RecipesCommon;
import com.hbm.inventory.RecipesCommon.AStack;
@ -140,115 +141,115 @@ public class CentrifugeRecipes extends SerializableRecipe {
new ItemStack(ModItems.dust, 1),
new ItemStack(ModItems.dust, 1) });
recipes.put(new OreDictStack("oreCoal"), new ItemStack[] {
recipes.put(new OreDictStack(COAL.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_coal, 2),
new ItemStack(ModItems.powder_coal, 2),
new ItemStack(ModItems.powder_coal, 2),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreLignite"), new ItemStack[] {
recipes.put(new OreDictStack(LIGNITE.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_lignite, 2),
new ItemStack(ModItems.powder_lignite, 2),
new ItemStack(ModItems.powder_lignite, 2),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreIron"), new ItemStack[] {
recipes.put(new OreDictStack(IRON.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_iron, 1),
new ItemStack(ModItems.powder_iron, 1),
new ItemStack(ModItems.powder_iron, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreGold"), new ItemStack[] {
recipes.put(new OreDictStack(GOLD.ore()), new ItemStack[] {
lbs ? new ItemStack(ModItems.powder_gold, 2) : new ItemStack(ModItems.powder_gold, 1),
new ItemStack(ModItems.powder_gold, 1),
lbs ? new ItemStack(ModItems.nugget_bismuth, 1) : new ItemStack(ModItems.powder_gold, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreDiamond"), new ItemStack[] {
recipes.put(new OreDictStack(DIAMOND.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_diamond, 1),
new ItemStack(ModItems.powder_diamond, 1),
new ItemStack(ModItems.powder_diamond, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreEmerald"), new ItemStack[] {
recipes.put(new OreDictStack(EMERALD.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_emerald, 1),
new ItemStack(ModItems.powder_emerald, 1),
new ItemStack(ModItems.powder_emerald, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreTitanium"), new ItemStack[] {
recipes.put(new OreDictStack(TI.ore()), new ItemStack[] {
lbs ? new ItemStack(ModItems.powder_titanium, 2) : new ItemStack(ModItems.powder_titanium, 1),
lbs ? new ItemStack(ModItems.powder_titanium, 2) : new ItemStack(ModItems.powder_titanium, 1),
new ItemStack(ModItems.powder_iron, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreQuartz"), new ItemStack[] {
recipes.put(new OreDictStack(NETHERQUARTZ.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_quartz, 1),
new ItemStack(ModItems.powder_quartz, 1),
new ItemStack(ModItems.powder_lithium_tiny, 1),
new ItemStack(Blocks.netherrack, 1) });
recipes.put(new OreDictStack("oreTungsten"), new ItemStack[] {
recipes.put(new OreDictStack(W.ore()), new ItemStack[] {
lbs ? new ItemStack(ModItems.powder_tungsten, 2) : new ItemStack(ModItems.powder_tungsten, 1),
new ItemStack(ModItems.powder_tungsten, 1),
new ItemStack(ModItems.powder_iron, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreCopper"), new ItemStack[] {
recipes.put(new OreDictStack(CU.ore()), new ItemStack[] {
lbs ? new ItemStack(ModItems.powder_copper, 2) : new ItemStack(ModItems.powder_copper, 1),
new ItemStack(ModItems.powder_copper, 1),
new ItemStack(ModItems.powder_gold, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreAluminum"), new ItemStack[] {
recipes.put(new OreDictStack(AL.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_aluminium, 1),
new ItemStack(ModItems.powder_aluminium, 1),
new ItemStack(ModItems.powder_iron, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreLead"), new ItemStack[] {
recipes.put(new OreDictStack(PB.ore()), new ItemStack[] {
lbs ? new ItemStack(ModItems.powder_lead, 2) : new ItemStack(ModItems.powder_lead, 1),
lbs ? new ItemStack(ModItems.nugget_bismuth, 1) : new ItemStack(ModItems.powder_lead, 1),
new ItemStack(ModItems.powder_gold, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreSchrabidium"), new ItemStack[] {
recipes.put(new OreDictStack(SA326.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_schrabidium, 1),
new ItemStack(ModItems.powder_schrabidium, 1),
new ItemStack(ModItems.nugget_solinium, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new ComparableStack(ModBlocks.ore_rare), new ItemStack[] {
recipes.put(new OreDictStack("oreRareEarth"), new ItemStack[] {
new ItemStack(ModItems.powder_desh_mix, 1),
new ItemStack(ModItems.nugget_zirconium, 1),
new ItemStack(ModItems.nugget_zirconium, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("orePlutonium"), new ItemStack[] {
recipes.put(new OreDictStack(PU.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_plutonium, 1),
new ItemStack(ModItems.powder_plutonium, 1),
new ItemStack(ModItems.nugget_polonium, 3),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreUranium"), new ItemStack[] {
recipes.put(new OreDictStack(U.ore()), new ItemStack[] {
lbs ? new ItemStack(ModItems.powder_uranium, 2) : new ItemStack(ModItems.powder_uranium, 1),
lbs ? new ItemStack(ModItems.nugget_technetium, 2) : new ItemStack(ModItems.powder_uranium, 1),
lbs ? new ItemStack(ModItems.nugget_ra226, 2) : new ItemStack(ModItems.nugget_ra226, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreThorium"), new ItemStack[] {
recipes.put(new OreDictStack(TH232.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_thorium, 1),
new ItemStack(ModItems.powder_thorium, 1),
new ItemStack(ModItems.powder_uranium, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreBeryllium"), new ItemStack[] {
recipes.put(new OreDictStack(BE.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_beryllium, 1),
new ItemStack(ModItems.powder_beryllium, 1),
new ItemStack(ModItems.powder_emerald, 1),
new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack("oreRedstone"), new ItemStack[] {
recipes.put(new OreDictStack(REDSTONE.ore()), new ItemStack[] {
new ItemStack(Items.redstone, 3),
new ItemStack(Items.redstone, 3),
lbs ? new ItemStack(ModItems.ingot_mercury, 3) : new ItemStack(ModItems.ingot_mercury, 1),
@ -260,7 +261,7 @@ public class CentrifugeRecipes extends SerializableRecipe {
new ItemStack(ModItems.powder_niobium, 2),
new ItemStack(Blocks.end_stone, 1) });
recipes.put(new OreDictStack("oreLapis"), new ItemStack[] {
recipes.put(new OreDictStack(LAPIS.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_lapis, 3),
new ItemStack(ModItems.powder_lapis, 3),
new ItemStack(ModItems.powder_cobalt_tiny, 1),
@ -284,7 +285,7 @@ public class CentrifugeRecipes extends SerializableRecipe {
new ItemStack(ModItems.ingot_phosphorus),
new ItemStack(Blocks.netherrack) });
recipes.put(new OreDictStack("oreCobalt"), new ItemStack[] {
recipes.put(new OreDictStack(CO.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_cobalt, 2),
new ItemStack(ModItems.powder_iron, 1),
new ItemStack(ModItems.powder_copper, 1),

View File

@ -140,13 +140,19 @@ public class CrystallizerRecipes extends SerializableRecipe {
registerRecipe(KEY_SAND, new CrystallizerRecipe(Blocks.clay, 20), new FluidStack(Fluids.COLLOID, 1_000));
/// COMPAT CERTUS QUARTZ ///
List<ItemStack> quartz = OreDictionary.getOres("crystalCertusQuartz");
if(quartz != null && !quartz.isEmpty()) {
ItemStack qItem = quartz.get(0).copy();
qItem.stackSize = 12;
registerRecipe("oreCertusQuartz", new CrystallizerRecipe(qItem, baseTime));
}
/// COMPAT WHITE PHOSPHORUS DUST ///
List<ItemStack> dustWhitePhosphorus = OreDictionary.getOres(P_WHITE.dust());
if(dustWhitePhosphorus != null && !dustWhitePhosphorus.isEmpty()) {
registerRecipe(P_WHITE.dust(), new CrystallizerRecipe(new ItemStack(ModItems.ingot_phosphorus), utilityTime), new FluidStack(Fluids.AROMATICS, 50));
}
if(!IMCCrystallizer.buffer.isEmpty()) {
recipes.putAll(IMCCrystallizer.buffer);

View File

@ -10,6 +10,7 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import static com.hbm.inventory.OreDictManager.*;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack;
@ -41,8 +42,8 @@ public class CyclotronRecipes extends SerializableRecipe {
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustPolonium"), new ItemStack(ModItems.powder_astatine), liA);
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustLanthanium"), new ItemStack(ModItems.powder_cerium), liA);
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustActinium"), new ItemStack(ModItems.powder_thorium), liA);
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustUranium"), new ItemStack(ModItems.powder_neptunium), liA);
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustNeptunium"), new ItemStack(ModItems.powder_plutonium), liA);
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack(U.dust()), new ItemStack(ModItems.powder_neptunium), liA);
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack(NP237.dust()), new ItemStack(ModItems.powder_plutonium), liA);
makeRecipe(new ComparableStack(ModItems.part_lithium), new ComparableStack(ModItems.powder_reiium), new ItemStack(ModItems.powder_weidanium), liA);
/// LITHIUM END ///
@ -68,7 +69,7 @@ public class CyclotronRecipes extends SerializableRecipe {
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_caesium), new ItemStack(ModItems.powder_lanthanium), caA);
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_neodymium), new ItemStack(ModItems.powder_gold), caA);
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.ingot_mercury), new ItemStack(ModItems.powder_polonium), caA);
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_lead), new ItemStack(ModItems.powder_ra226),caA);
makeRecipe(new ComparableStack(ModItems.part_carbon), new OreDictStack(PB.dust()), new ItemStack(ModItems.powder_ra226),caA);
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_astatine), new ItemStack(ModItems.powder_actinium), caA);
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_australium), new ItemStack(ModItems.powder_verticium), caA);
/// CARBON END ///
@ -93,7 +94,7 @@ public class CyclotronRecipes extends SerializableRecipe {
int plA = 100;
makeRecipe(new ComparableStack(ModItems.part_plutonium), new OreDictStack("dustPhosphorus"), new ItemStack(ModItems.powder_tennessine), plA);
makeRecipe(new ComparableStack(ModItems.part_plutonium), new OreDictStack("dustPlutonium"), new ItemStack(ModItems.powder_tennessine), plA);
makeRecipe(new ComparableStack(ModItems.part_plutonium), new OreDictStack(PU.dust()), new ItemStack(ModItems.powder_tennessine), plA);
makeRecipe(new ComparableStack(ModItems.part_plutonium), new ComparableStack(ModItems.powder_tennessine), new ItemStack(ModItems.powder_reiium), plA);
makeRecipe(new ComparableStack(ModItems.part_plutonium), new ComparableStack(ModItems.pellet_charged), new ItemStack(ModItems.nugget_schrabidium), 1000);
makeRecipe(new ComparableStack(ModItems.part_plutonium), new ComparableStack(ModItems.powder_unobtainium), new ItemStack(ModItems.powder_daffergon), plA);

View File

@ -50,9 +50,9 @@ public class MixerRecipes extends SerializableRecipe {
recipes.put(Fluids.SYNGAS, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.COALOIL, 500)).setStack2(new FluidStack(Fluids.STEAM, 500)));
recipes.put(Fluids.OXYHYDROGEN, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.HYDROGEN, 500)).setStack2(new FluidStack(Fluids.OXYGEN, 500)));
recipes.put(Fluids.PETROIL_LEADED, new MixerRecipe(1_000, 40).setStack1(new FluidStack(Fluids.PETROIL, 800)).setSolid(new ComparableStack(ModItems.antiknock)));
recipes.put(Fluids.GASOLINE_LEADED, new MixerRecipe(1_000, 40).setStack1(new FluidStack(Fluids.GASOLINE, 800)).setSolid(new ComparableStack(ModItems.antiknock)));
recipes.put(Fluids.COALGAS_LEADED, new MixerRecipe(1_000, 40).setStack1(new FluidStack(Fluids.COALGAS, 800)).setSolid(new ComparableStack(ModItems.antiknock)));
recipes.put(Fluids.PETROIL_LEADED, new MixerRecipe(12_000, 40).setStack1(new FluidStack(Fluids.PETROIL, 10_000)).setSolid(new ComparableStack(ModItems.antiknock)));
recipes.put(Fluids.GASOLINE_LEADED, new MixerRecipe(12_000, 40).setStack1(new FluidStack(Fluids.GASOLINE, 10_000)).setSolid(new ComparableStack(ModItems.antiknock)));
recipes.put(Fluids.COALGAS_LEADED, new MixerRecipe(12_000, 40).setStack1(new FluidStack(Fluids.COALGAS, 10_000)).setSolid(new ComparableStack(ModItems.antiknock)));
recipes.put(Fluids.DIESEL_REFORM, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.DIESEL, 900)).setStack2(new FluidStack(Fluids.REFORMATE, 100)));
recipes.put(Fluids.DIESEL_CRACK_REFORM, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.DIESEL_CRACK, 900)).setStack2(new FluidStack(Fluids.REFORMATE, 100)));

View File

@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import static com.hbm.inventory.OreDictManager.*;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.fluid.Fluids;
@ -29,8 +30,8 @@ public class SILEXRecipes {
public static void register() {
itemTranslation.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.UF6.getID()), new ComparableStack(ModItems.ingot_uranium));
dictTranslation.put("dustUranium", "ingotUranium");
recipes.put("ingotUranium", new SILEXRecipe(900, 100, EnumWavelengths.UV)
dictTranslation.put(U.dust(), U.ingot());
recipes.put(U.ingot(), new SILEXRecipe(900, 100, EnumWavelengths.UV)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 11))
);
@ -46,8 +47,8 @@ public class SILEXRecipes {
);
itemTranslation.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.PUF6.getID()), new ComparableStack(ModItems.ingot_plutonium));
dictTranslation.put("dustPlutonium", "ingotPlutonium");
recipes.put("ingotPlutonium", new SILEXRecipe(900, 100, 2)
dictTranslation.put(PU.dust(), PU.ingot());
recipes.put(PU.ingot(), new SILEXRecipe(900, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 3))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 4))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 2))

View File

@ -444,7 +444,7 @@ public class AnvilRecipes {
new AStack[] {new ComparableStack(ModItems.nugget_bismuth, 2), new OreDictStack(U238.billet(), 2), new OreDictStack(NB.dust(), 1)},
new AnvilOutput(new ItemStack(ModItems.plate_bismuth, 1))).setTier(4));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack(EUPH.ingot(), 4), new OreDictStack(AT.dust(), 2), new OreDictStack(VOLCANIC.gem(), 1)},
new AStack[] {new OreDictStack(EUPH.ingot(), 4), new OreDictStack(AT.dust(), 3), new OreDictStack(BI.dust(), 1), new OreDictStack(VOLCANIC.gem(), 1), new ComparableStack(ModItems.ingot_osmiridium)},
new AnvilOutput(new ItemStack(ModItems.plate_euphemium, 4))).setTier(6));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack(DNT.ingot(), 4), new ComparableStack(ModItems.powder_spark_mix, 2), new OreDictStack(DESH.ingot(), 1)},

View File

@ -36,7 +36,7 @@ public class AnvilSmithingMold extends AnvilSmithingRecipe {
for(String otherPrefix : OreNames.prefixes) {
if(otherPrefix.length() > matchesPrefix.name.length() && name.startsWith(otherPrefix)) {
continue; //ignore if there's a longer prefix that matches (i.e. a more accurate match)
return false; //ignore if there's a longer prefix that matches (i.e. a more accurate match)
}
}

View File

@ -0,0 +1,14 @@
package com.hbm.items;
import com.hbm.render.anim.BusAnimation;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@SideOnly(Side.CLIENT)
public interface IAnimatedItem {
public BusAnimation getAnimation(NBTTagCompound data, ItemStack stack);
}

View File

@ -1802,6 +1802,7 @@ public class ModItems {
public static Item chemistry_set_boron;
public static Item blowtorch;
public static Item acetylene_torch;
public static Item boltgun;
public static Item overfuse;
public static Item arc_electrode;
public static Item arc_electrode_burnt;
@ -4408,6 +4409,7 @@ public class ModItems {
chemistry_set_boron = new ItemCraftingDegradation(0).setUnlocalizedName("chemistry_set_boron");
blowtorch = new ItemBlowtorch().setUnlocalizedName("blowtorch");
acetylene_torch = new ItemBlowtorch().setUnlocalizedName("acetylene_torch");
boltgun = new ItemBoltgun().setUnlocalizedName("boltgun");
overfuse = new ItemCustomLore().setUnlocalizedName("overfuse").setMaxStackSize(1).setFull3D().setTextureName(RefStrings.MODID + ":overfuse");
arc_electrode = new ItemCustomLore().setUnlocalizedName("arc_electrode").setMaxDamage(250).setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setFull3D().setTextureName(RefStrings.MODID + ":arc_electrode");
arc_electrode_burnt = new Item().setUnlocalizedName("arc_electrode_burnt").setMaxStackSize(1).setFull3D().setTextureName(RefStrings.MODID + ":arc_electrode_burnt");
@ -6431,15 +6433,12 @@ public class ModItems {
GameRegistry.registerItem(chemistry_set_boron, chemistry_set_boron.getUnlocalizedName());
GameRegistry.registerItem(blowtorch, blowtorch.getUnlocalizedName());
GameRegistry.registerItem(acetylene_torch, acetylene_torch.getUnlocalizedName());
GameRegistry.registerItem(boltgun, boltgun.getUnlocalizedName());
GameRegistry.registerItem(overfuse, overfuse.getUnlocalizedName());
GameRegistry.registerItem(arc_electrode, arc_electrode.getUnlocalizedName());
GameRegistry.registerItem(arc_electrode_burnt, arc_electrode_burnt.getUnlocalizedName());
GameRegistry.registerItem(arc_electrode_desh, arc_electrode_desh.getUnlocalizedName());
//Particle Collider Items
//GameRegistry.registerItem(crystal_energy, crystal_energy.getUnlocalizedName());
//GameRegistry.registerItem(pellet_coolant, pellet_coolant.getUnlocalizedName());
//Particle Collider Fuel
GameRegistry.registerItem(part_lithium, part_lithium.getUnlocalizedName());
GameRegistry.registerItem(part_beryllium, part_beryllium.getUnlocalizedName());

View File

@ -205,7 +205,7 @@ public class ItemRBMKRod extends Item {
double avg = (heat + hullHeat + coreHeat) / 3D;
this.setCoreHeat(stack, avg);
this.setHullHeat(stack, avg);
return avg;
return avg - heat;
}
if(hullHeat <= heat)

View File

@ -1,6 +1,7 @@
package com.hbm.items.machine;
import java.util.List;
import java.util.Locale;
import com.hbm.items.ItemEnumMulti;
import com.hbm.items.ModItems;
@ -35,16 +36,18 @@ public class ItemWatzPellet extends ItemEnumMulti {
public static enum EnumWatzType {
//TODO: durability
SCHRABIDIUM( 0x32FFFF, 0x005C5C, 2_000, 10D, new FunctionLogarithmic(10), null, null),
HES( 0x66DCD6, 0x023933, 1_500, 10D, null, null, null),
LES( 0xABB4A8, 0x0C1105, 500, 10D, null, null, null),
MES( 0xCBEADF, 0x28473C, 1_000, 10D, null, null, null),
NP( 0xA6B2A6, 0x030F03, 0, 10D, null, null, null),
LES( 0xABB4A8, 0x0C1105, 500, 10D, null, null, null),
HEN( 0xA6B2A6, 0x030F03, 0, 10D, null, null, null),
MEU( 0xC1C7BD, 0x2B3227, 0, 10D, null, null, null),
MEP( 0x9AA3A0, 0x111A17, 0, 10D, null, null, null),
LEAD( 0xA6A6B2, 0x03030F, 0, 0, null, null, new FunctionSqrt(10)), //standard absorber, negative coefficient
DU( 0xC1C7BD, 0x2B3227, 0, 0, null, null, new FunctionQuadratic(1D, 1D).withDiv(100)); //absorber with positive coefficient
BORON( 0xBDC8D2, 0x29343E, 0, 0, null, null, new FunctionLinear(10)), //improved absorber, linear
DU( 0xC1C7BD, 0x2B3227, 0, 0, null, null, new FunctionQuadratic(1D, 1D).withDiv(100)), //absorber with positive coefficient
NQD( 0x4B4B4B, 0x121212, 0, 0, null, null, null),
NQR( 0x2D2D2D, 0x0B0B0B, 0, 0, null, null, null);
public double yield = 1_000_000_000;
public int colorLight;
@ -121,6 +124,8 @@ public class ItemWatzPellet extends ItemEnumMulti {
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
EnumWatzType num = EnumUtil.grabEnumSafely(EnumWatzType.class, stack.getItemDamage());
list.add(EnumChatFormatting.GREEN + "Depletion: " + String.format(Locale.US, "%.1f", getDurabilityForDisplay(stack) * 100D) + "%");
String color = EnumChatFormatting.GOLD + "";
String reset = EnumChatFormatting.RESET + "";

View File

@ -28,6 +28,7 @@ import net.minecraft.world.World;
public class ItemBlowtorch extends Item implements IFillableItem {
public ItemBlowtorch() {
this.setMaxStackSize(1);
this.setFull3D();
this.setCreativeTab(MainRegistry.controlTab);
}

View File

@ -0,0 +1,78 @@
package com.hbm.items.tool;
import com.hbm.items.IAnimatedItem;
import com.hbm.lib.RefStrings;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationKeyframe;
import com.hbm.render.anim.BusAnimationSequence;
import api.hbm.block.IToolable;
import api.hbm.block.IToolable.ToolType;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class ItemBoltgun extends Item implements IAnimatedItem {
public ItemBoltgun() {
this.setMaxStackSize(1);
}
@Override
public Item setUnlocalizedName(String unlocalizedName) {
super.setUnlocalizedName(unlocalizedName);
this.setTextureName(RefStrings.MODID + ":"+ unlocalizedName);
return this;
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fX, float fY, float fZ) {
Block b = world.getBlock(x, y, z);
if(b instanceof IToolable && ((IToolable)b).onScrew(world, player, x, y, z, side, fX, fY, fZ, ToolType.BOLT)) {
if(!world.isRemote) {
player.inventoryContainer.detectAndSendChanges();
ForgeDirection dir = ForgeDirection.getOrientation(side);
double off = 0.25;
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaExt");
data.setString("mode", "largeexplode");
data.setFloat("size", 1F);
data.setByte("count", (byte)1);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x + fX + dir.offsetX * off, y + fY + dir.offsetY * off, z + fZ + dir.offsetZ * off), new TargetPoint(world.provider.dimensionId, x, y, z, 50));
NBTTagCompound d0 = new NBTTagCompound();
d0.setString("type", "anim");
d0.setString("mode", "generic");
PacketDispatcher.wrapper.sendTo(new AuxParticlePacketNT(d0, 0, 0, 0), (EntityPlayerMP) player);
}
return false;
}
return false;
}
@Override
@SideOnly(Side.CLIENT)
public BusAnimation getAnimation(NBTTagCompound data, ItemStack stack) {
return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence()
.addKeyframe(new BusAnimationKeyframe(1, 0, 1, 50))
.addKeyframe(new BusAnimationKeyframe(0, 0, 1, 100)));
}
}

View File

@ -630,7 +630,7 @@ public class HbmWorldGen implements IWorldGenerator {
int x = i + rand.nextInt(16);
int z = j + rand.nextInt(16);
int y = world.getHeightValue(x, z) - rand.nextInt(10);
(new Meteorite()).generate(world, rand, x, y, z, false, true);
(new Meteorite()).generate(world, rand, x, y, z, false, true, false);
}
if (GeneralConfig.enableNITAN) {

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings {
public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (4551)";
public static final String VERSION = "1.0.27 BETA (4562)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -48,6 +48,7 @@ import com.hbm.blocks.generic.BlockEmitter.TileEntityEmitter;
import com.hbm.blocks.generic.BlockLoot.TileEntityLoot;
import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe;
import com.hbm.blocks.machine.MachineFan.TileEntityFan;
import com.hbm.blocks.machine.WatzPump.TileEntityWatzPump;
import com.hbm.entity.cart.*;
import com.hbm.entity.effect.*;
import com.hbm.entity.grenade.*;
@ -63,7 +64,9 @@ import com.hbm.handler.CasingEjector;
import com.hbm.handler.HbmKeybinds;
import com.hbm.handler.ImpactWorldHandler;
import com.hbm.handler.HbmKeybinds.EnumKeybind;
import com.hbm.items.IAnimatedItem;
import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import com.hbm.particle.*;
import com.hbm.particle.psys.engine.EventHandlerParticleEngine;
import com.hbm.render.anim.*;
@ -313,6 +316,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySoyuzStruct.class, new RenderSoyuzMultiblock());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityITERStruct.class, new RenderITERMultiblock());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPlasmaStruct.class, new RenderPlasmaMultiblock());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatzStruct.class, new RenderWatzMultiblock());
//RBMK
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKControlManual.class, new RenderRBMKControlRod());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKControlAuto.class, new RenderRBMKControlRod());
@ -332,7 +336,9 @@ public class ClientProxy extends ServerProxy {
//ITER
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityITER.class, new RenderITER());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePlasmaHeater.class, new RenderPlasmaHeater());
//Watz
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatz.class, new RenderWatz());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatzPump.class, new RenderWatzPump());
//doors
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityVaultDoor.class, new RenderVaultDoor());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBlastDoor.class, new RenderBlastDoor());
@ -424,6 +430,7 @@ public class ClientProxy extends ServerProxy {
MinecraftForgeClient.registerItemRenderer(ModItems.mese_gavel, new ItemRenderGavel());
MinecraftForgeClient.registerItemRenderer(ModItems.crucible, new ItemRenderCrucible());
MinecraftForgeClient.registerItemRenderer(ModItems.chainsaw, new ItemRenderChainsaw());
MinecraftForgeClient.registerItemRenderer(ModItems.boltgun, new ItemRenderBoltgun());
//guns
MinecraftForgeClient.registerItemRenderer(ModItems.gun_rpg, new ItemRenderRpg());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_karl, new ItemRenderRpg());
@ -571,6 +578,7 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityCog.class, new RenderCog());
RenderingRegistry.registerEntityRenderingHandler(EntitySawblade.class, new RenderSawblade());
RenderingRegistry.registerEntityRenderingHandler(EntityChemical.class, new RenderChemical());
RenderingRegistry.registerEntityRenderingHandler(EntityMist.class, new RenderMist());
//grenades
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeGeneric.class, new RenderSnowball(ModItems.grenade_generic));
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeStrong.class, new RenderSnowball(ModItems.grenade_strong));
@ -676,27 +684,28 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityMovingPackage.class, new RenderMovingPackage());
RenderingRegistry.registerEntityRenderingHandler(EntityTNTPrimedBase.class, new RenderTNTPrimedBase());
//mobs
RenderingRegistry.registerEntityRenderingHandler(EntityNuclearCreeper.class, new RenderNuclearCreeper());
RenderingRegistry.registerEntityRenderingHandler(EntityTaintedCreeper.class, new RenderTaintedCreeper());
RenderingRegistry.registerEntityRenderingHandler(EntityHunterChopper.class, new RenderHunterChopper());
RenderingRegistry.registerEntityRenderingHandler(EntityCyberCrab.class, new RenderCyberCrab());
RenderingRegistry.registerEntityRenderingHandler(EntityTeslaCrab.class, new RenderTeslaCrab());
RenderingRegistry.registerEntityRenderingHandler(EntityTaintCrab.class, new RenderTaintCrab());
RenderingRegistry.registerEntityRenderingHandler(EntityMaskMan.class, new RenderMaskMan());
RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeHead.class, new RenderWormHead());
RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeBody.class, new RenderWormBody());
RenderingRegistry.registerEntityRenderingHandler(EntityDuck.class, new RenderDuck(new ModelChicken(), 0.3F));
RenderingRegistry.registerEntityRenderingHandler(EntityQuackos.class, new RenderQuacc(new ModelChicken(), 7.5F));
RenderingRegistry.registerEntityRenderingHandler(EntityFBI.class, new RenderFBI());
RenderingRegistry.registerEntityRenderingHandler(EntityRADBeast.class, new RenderRADBeast());
RenderingRegistry.registerEntityRenderingHandler(EntityBlockSpider.class, new RenderBlockSpider());
RenderingRegistry.registerEntityRenderingHandler(EntityUFO.class, new RenderUFO());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeZombie.class, new RenderSiegeZombie());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeUFO.class, new RenderSiegeUFO());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeCraft.class, new RenderSiegeCraft());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeSkeleton.class, new RenderSiegeSkeleton());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeTunneler.class, new RenderSiegeTunneler());
RenderingRegistry.registerEntityRenderingHandler(EntityGhost.class, new RenderGhost());
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperNuclear.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper.png", RefStrings.MODID + ":" + "textures/entity/creeper_armor.png").setSwellMod(5F));
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperTainted.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper_tainted.png", RefStrings.MODID + ":" + "textures/entity/creeper_armor_taint.png"));
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperPhosgene.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper_phosgene.png", "textures/entity/creeper/creeper_armor.png"));
RenderingRegistry.registerEntityRenderingHandler(EntityHunterChopper.class, new RenderHunterChopper());
RenderingRegistry.registerEntityRenderingHandler(EntityCyberCrab.class, new RenderCyberCrab());
RenderingRegistry.registerEntityRenderingHandler(EntityTeslaCrab.class, new RenderTeslaCrab());
RenderingRegistry.registerEntityRenderingHandler(EntityTaintCrab.class, new RenderTaintCrab());
RenderingRegistry.registerEntityRenderingHandler(EntityMaskMan.class, new RenderMaskMan());
RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeHead.class, new RenderWormHead());
RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeBody.class, new RenderWormBody());
RenderingRegistry.registerEntityRenderingHandler(EntityDuck.class, new RenderDuck(new ModelChicken(), 0.3F));
RenderingRegistry.registerEntityRenderingHandler(EntityQuackos.class, new RenderQuacc(new ModelChicken(), 7.5F));
RenderingRegistry.registerEntityRenderingHandler(EntityFBI.class, new RenderFBI());
RenderingRegistry.registerEntityRenderingHandler(EntityRADBeast.class, new RenderRADBeast());
RenderingRegistry.registerEntityRenderingHandler(EntityBlockSpider.class, new RenderBlockSpider());
RenderingRegistry.registerEntityRenderingHandler(EntityUFO.class, new RenderUFO());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeZombie.class, new RenderSiegeZombie());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeUFO.class, new RenderSiegeUFO());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeCraft.class, new RenderSiegeCraft());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeSkeleton.class, new RenderSiegeSkeleton());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeTunneler.class, new RenderSiegeTunneler());
RenderingRegistry.registerEntityRenderingHandler(EntityGhost.class, new RenderGhost());
//"particles"
RenderingRegistry.registerEntityRenderingHandler(EntitySmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.smoke1, ModItems.smoke2, ModItems.smoke3, ModItems.smoke4, ModItems.smoke5, ModItems.smoke6, ModItems.smoke7, ModItems.smoke8 }));
RenderingRegistry.registerEntityRenderingHandler(EntityBSmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.b_smoke1, ModItems.b_smoke2, ModItems.b_smoke3, ModItems.b_smoke4, ModItems.b_smoke5, ModItems.b_smoke6, ModItems.b_smoke7, ModItems.b_smoke8 }));
@ -1626,8 +1635,10 @@ public class ClientProxy extends ServerProxy {
if("anim".equals(type)) {
String mode = data.getString("mode");
/* crucible deploy */
if("crucible".equals(data.getString("mode")) && player.getHeldItem() != null) {
if("crucible".equals(mode) && player.getHeldItem() != null) {
BusAnimation animation = new BusAnimation()
.addBus("GUARD_ROT", new BusAnimationSequence()
@ -1639,7 +1650,7 @@ public class ClientProxy extends ServerProxy {
}
/* crucible swing */
if("cSwing".equals(data.getString("mode"))) {
if("cSwing".equals(mode)) {
if(HbmAnimations.getRelevantTransformation("SWING_ROT")[0] == 0) {
@ -1662,7 +1673,7 @@ public class ClientProxy extends ServerProxy {
}
/* chainsaw swing */
if("sSwing".equals(data.getString("mode")) || "lSwing".equals(data.getString("mode"))) { //temp for lance
if("sSwing".equals(mode) || "lSwing".equals(mode)) { //temp for lance
int forward = 150;
int sideways = 100;
@ -1705,6 +1716,19 @@ public class ClientProxy extends ServerProxy {
HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation);
}
}
if("generic".equals(mode)) {
ItemStack stack = player.getHeldItem();
if(stack != null && stack.getItem() instanceof IAnimatedItem) {
IAnimatedItem item = (IAnimatedItem) stack.getItem();
BusAnimation anim = item.getAnimation(data, stack);
if(anim != null) {
HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), anim);
}
}
}
}
if("tau".equals(type)) {

View File

@ -935,11 +935,13 @@ public class CraftingManager {
int amount = (int) craneCasing[i * 2 + 1];
addRecipeAuto(new ItemStack(ModBlocks.crane_inserter, amount), new Object[] { "CCC", "C C", "CBC", 'C', casing, 'B', ModBlocks.conveyor });
addRecipeAuto(new ItemStack(ModBlocks.crane_extractor, amount), new Object[] { "CCC", "CPC", "CBC", 'C', casing, 'B', ModBlocks.conveyor, 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_PNEUMATIC) });
addRecipeAuto(new ItemStack(ModBlocks.crane_grabber, amount), new Object[] { "C C", "P P", "CBC", 'C', casing, 'B', ModBlocks.conveyor, 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_PNEUMATIC) });
}
addRecipeAuto(new ItemStack(ModBlocks.crane_boxer), new Object[] { "WWW", "WPW", "CCC", 'W', KEY_PLANKS, 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_PNEUMATIC), 'C', ModBlocks.conveyor });
addRecipeAuto(new ItemStack(ModBlocks.crane_unboxer), new Object[] { "WWW", "WPW", "CCC", 'W', KEY_STICK, 'P', Items.shears, 'C', ModBlocks.conveyor });
addRecipeAuto(new ItemStack(ModBlocks.crane_router), new Object[] { "PIP", "ICI", "PIP", 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_PNEUMATIC), 'I', ModItems.plate_polymer, 'C', ModItems.circuit_copper });
addRecipeAuto(new ItemStack(ModBlocks.crane_splitter), new Object[] { "III", "PCP", "III", 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_PNEUMATIC), 'I', STEEL.ingot(), 'C', ModItems.circuit_aluminium });
addShapelessAuto(DictFrame.fromOne(ModItems.parts_legendary, EnumLegendaryType.TIER1), new Object[] { ModItems.ingot_chainsteel, ASBESTOS.ingot(), ModItems.gem_alexandrite });
addShapelessAuto(DictFrame.fromOne(ModItems.parts_legendary, EnumLegendaryType.TIER1, 3), new Object[] { DictFrame.fromOne(ModItems.parts_legendary, EnumLegendaryType.TIER2) });

View File

@ -22,9 +22,9 @@ import com.hbm.entity.missile.EntityMissileBaseAdvanced;
import com.hbm.entity.missile.EntityMissileCustom;
import com.hbm.entity.mob.EntityCyberCrab;
import com.hbm.entity.mob.EntityDuck;
import com.hbm.entity.mob.EntityNuclearCreeper;
import com.hbm.entity.mob.EntityCreeperNuclear;
import com.hbm.entity.mob.EntityQuackos;
import com.hbm.entity.mob.EntityTaintedCreeper;
import com.hbm.entity.mob.EntityCreeperTainted;
import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.entity.projectile.EntityBurningFOEQ;
import com.hbm.extprop.HbmLivingProps;
@ -38,6 +38,7 @@ import com.hbm.handler.EntityEffectHandler;
import com.hbm.hazard.HazardSystem;
import com.hbm.interfaces.IBomb;
import com.hbm.handler.HTTPHandler;
import com.hbm.handler.HbmKeybinds.EnumKeybind;
import com.hbm.handler.SiegeOrchestrator;
import com.hbm.items.IEquipReceiver;
import com.hbm.items.ModItems;
@ -72,6 +73,7 @@ import com.hbm.world.generator.TimedGenerator;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
@ -190,7 +192,7 @@ public class ModEventHandler {
}
@SubscribeEvent
public void onEntityConstructing(EntityEvent.EntityConstructing event) {
public void onEntityConstructing(EntityEvent.EntityConstructing event) {
if(event.entity instanceof EntityPlayer) {
@ -207,6 +209,14 @@ public class ModEventHandler {
HbmLivingProps.getData(living); //ditto
}
}
@SubscribeEvent
public void onPlayerChaangeDimension(PlayerChangedDimensionEvent event) {
EntityPlayer player = event.player;
HbmPlayerProps data = HbmPlayerProps.getData(player);
data.setKeyPressed(EnumKeybind.JETPACK, false);
data.setKeyPressed(EnumKeybind.DASH, false);
}
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onEntityDeathFirst(LivingDeathEvent event) {
@ -274,7 +284,7 @@ public class ModEventHandler {
event.entity.dropItem(ModItems.book_of_, 1);
}
if(event.entity instanceof EntityTaintedCreeper && event.source == ModDamageSource.boxcar) {
if(event.entity instanceof EntityCreeperTainted && event.source == ModDamageSource.boxcar) {
for(Object o : event.entity.worldObj.getEntitiesWithinAABB(EntityPlayer.class, event.entity.boundingBox.expand(50, 50, 50))) {
EntityPlayer player = (EntityPlayer)o;
@ -567,7 +577,7 @@ public class ModEventHandler {
if(entity instanceof EntityCreeper && eRad >= 200 && entity.getHealth() > 0) {
if(event.world.rand.nextInt(3) == 0 ) {
EntityNuclearCreeper creep = new EntityNuclearCreeper(event.world);
EntityCreeperNuclear creep = new EntityCreeperNuclear(event.world);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
if(!entity.isDead)

View File

@ -214,6 +214,7 @@ public class ResourceManager {
//Watz
public static final IModelCustom watz = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/watz.obj"));
public static final IModelCustom watz_pump = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/watz_pump.obj"));
//FENSU
public static final IModelCustom fensu = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/fensu.obj"));
@ -561,6 +562,7 @@ public class ResourceManager {
//Watz
public static final ResourceLocation watz_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/watz.png");
public static final ResourceLocation watz_pump_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/watz_pump.png");
//FENSU
public static final ResourceLocation fensu_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensu.png");
@ -679,6 +681,7 @@ public class ResourceManager {
public static final IModelCustom gavel = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/gavel.obj"));
public static final IModelCustom crucible = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/crucible.obj"));
public static final IModelCustom chainsaw = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/chainsaw.obj"), false);
public static final IModelCustom boltgun = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/boltgun.obj"));
public static final IModelCustom hk69 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/hk69.obj"));
public static final IModelCustom deagle = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/deagle.obj"));
@ -752,6 +755,7 @@ public class ResourceManager {
public static final ResourceLocation crucible_guard = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/crucible_guard.png");
public static final ResourceLocation crucible_blade = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/crucible_blade.png");
public static final ResourceLocation chainsaw_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/chainsaw.png");
public static final ResourceLocation boltgun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/boltgun.png");
public static final ResourceLocation hk69_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/hk69.png");
public static final ResourceLocation deagle_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/deagle.png");

View File

@ -11,6 +11,7 @@ import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.tileentity.TileEntity;
@Deprecated
public class TEFluidPacket implements IMessage {
int x;

View File

@ -2,6 +2,7 @@ package com.hbm.particle.psys.engine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
/**
@ -10,7 +11,7 @@ import net.minecraft.world.World;
* @author hbm
*/
@SideOnly(Side.CLIENT)
public class PSysFX {
public abstract class PSysFX {
public World world;
public double posX;
@ -19,14 +20,62 @@ public class PSysFX {
public double prevPosX;
public double prevPosY;
public double prevPosZ;
public double motionX;
public double motionY;
public double motionZ;
public static double interpPosX;
public static double interpPosY;
public static double interpPosZ;
public PSysFX() {
public AxisAlignedBB boundingBox;
public int particleAge;
public int particleMaxAge;
public boolean isExpired = false;
public boolean shouldExpireWhenUnloaded = true;
public boolean isUnloaded = false;
public PSysFX(World world, double x, double y, double z) {
this.world = world;
this.posX = x;
this.posY = y;
this.posZ = z;
}
public void updateParticle() {
this.prevPosX = posX;
this.prevPosY = posY;
this.prevPosZ = posZ;
this.isUnloaded = !world.getChunkProvider().chunkExists((int) Math.floor(posX) >> 4, (int) Math.floor(posZ) >> 4);
this.particleAge++;
if(this.particleAge >= this.particleMaxAge) {
this.expire();
}
if(this.shouldExpireWhenUnloaded && this.isUnloaded) {
this.expire();
}
}
public abstract void renderParticle();
public AxisAlignedBB getBoundingBox() {
return this.boundingBox;
}
public void setBoundingBox(AxisAlignedBB bb) {
this.boundingBox = bb;
}
protected void setPosToAABB() {
AxisAlignedBB aabb = this.getBoundingBox();
this.posX = (aabb.minX + aabb.maxX) / 2.0D;
this.posY = aabb.minY;
this.posZ = (aabb.minZ + aabb.maxZ) / 2.0D;
}
public void expire() {
this.isExpired = true;
}
public void setExpireOnUnload(boolean expire) {
this.shouldExpireWhenUnloaded = expire;
}
}

View File

@ -0,0 +1,87 @@
package com.hbm.particle.psys.engine;
import java.util.List;
import com.hbm.lib.Library;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
@SideOnly(Side.CLIENT)
public abstract class PSysFXMoving extends PSysFX {
public double motionX;
public double motionY;
public double motionZ;
boolean noClip = false;
/* using the forgedirection's ordinal as an index, this tells us what side of a block the particle has collided with */
public boolean collisionData[] = new boolean[6];
public PSysFXMoving(World world, double x, double y, double z, double mX, double mY, double mZ) {
super(world, x, y, z);
this.motionX = mX;
this.motionY = mY;
this.motionZ = mZ;
}
public double getParticleGravity() {
return 0.04D;
}
public double getParticleDrag() {
return 0.98D;
}
public void updateParticle() {
super.updateParticle();
if(!this.isUnloaded) {
this.motionX -= this.getParticleGravity();
this.motionX *= this.getParticleDrag();
this.motionY *= this.getParticleDrag();
this.motionZ *= this.getParticleDrag();
this.move(motionX, motionY, motionZ);
}
}
public void move(double x, double y, double z) {
double x0 = x;
double y0 = y;
double z0 = z;
this.collisionData = new boolean[6];
if(!noClip) {
List<AxisAlignedBB> list = this.world.getCollidingBoundingBoxes(null, this.getBoundingBox().expand(x, y, z));
for(AxisAlignedBB aabb : list) y = aabb.calculateYOffset(this.getBoundingBox(), y);
this.setBoundingBox(this.getBoundingBox().offset(0.0D, y, 0.0D));
for(AxisAlignedBB aabb : list) x = aabb.calculateXOffset(this.getBoundingBox(), x);
this.setBoundingBox(this.getBoundingBox().offset(x, 0.0D, 0.0D));
for(AxisAlignedBB aabb : list) z = aabb.calculateZOffset(this.getBoundingBox(), z);
this.setBoundingBox(this.getBoundingBox().offset(0.0D, 0.0D, z));
} else {
this.setBoundingBox(this.getBoundingBox().offset(x, y, z));
}
this.setPosToAABB();
if(x0 != x && x > 0) this.collisionData[Library.NEG_X.ordinal()] = true;
if(x0 != x && x < 0) this.collisionData[Library.POS_X.ordinal()] = true;
if(y0 != y && y > 0) this.collisionData[Library.NEG_Y.ordinal()] = true;
if(y0 != y && y < 0) this.collisionData[Library.POS_Y.ordinal()] = true;
if(z0 != z && z > 0) this.collisionData[Library.NEG_Z.ordinal()] = true;
if(z0 != z && z < 0) this.collisionData[Library.POS_Z.ordinal()] = true;
if(x0 != x) this.motionX = 0.0D;
if(y0 != y) this.motionY = 0.0D;
if(z0 != z) this.motionZ = 0.0D;
}
}

View File

@ -29,17 +29,17 @@ public class ParticleEngine {
}
public void updateParticles() {
for(FXLayer layer : layers) layer.updateLayer();
}
public void renderParticles(float interp) {
for(FXLayer layer : layers) layer.renderLayer(interp);
}
public static class FXLayer {
protected ResourceLocation batchTexture;
protected List particles;
protected List<PSysFX> particles;
public FXLayer() { }
@ -51,7 +51,7 @@ public class ParticleEngine {
}
protected void renderLayer() {
protected void renderLayer(float interp) {
}
}

View File

@ -7,7 +7,7 @@ import com.hbm.blocks.bomb.BlockTaint;
import com.hbm.config.GeneralConfig;
import com.hbm.config.PotionConfig;
import com.hbm.entity.mob.EntityTaintCrab;
import com.hbm.entity.mob.EntityTaintedCreeper;
import com.hbm.entity.mob.EntityCreeperTainted;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.extprop.HbmLivingProps;
import com.hbm.items.ModItems;
@ -102,7 +102,7 @@ public class HbmPotion extends Potion {
if(this == taint) {
if(!(entity instanceof EntityTaintedCreeper) && !(entity instanceof EntityTaintCrab) && entity.worldObj.rand.nextInt(40) == 0)
if(!(entity instanceof EntityCreeperTainted) && !(entity instanceof EntityTaintCrab) && entity.worldObj.rand.nextInt(40) == 0)
entity.attackEntityFrom(ModDamageSource.taint, (level + 1));
if(GeneralConfig.enableHardcoreTaint && !entity.worldObj.isRemote) {

View File

@ -2,7 +2,6 @@ package com.hbm.render.block;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.network.CraneSplitter;
import com.hbm.main.ResourceManager;
import com.hbm.render.util.ObjUtil;
@ -11,7 +10,6 @@ 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;
import net.minecraftforge.client.model.obj.WavefrontObject;
@ -28,11 +26,11 @@ public class RenderSplitter implements ISimpleBlockRenderingHandler {
GL11.glRotated(-90, 0, 1, 0);
GL11.glTranslatef(0F, -0.5F, 0.5F);
tessellator.startDrawingQuads();
ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.splitter, ModBlocks.block_steel.getIcon(0, 0), tessellator, 0, false);
drawSplitter(tessellator, block, true, 0, false);
tessellator.draw();
GL11.glTranslatef(0F, 0F, -1F);
tessellator.startDrawingQuads();
ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.splitter, ModBlocks.block_steel.getIcon(0, 0), tessellator, 0, false);
drawSplitter(tessellator, block, false, 0, false);
tessellator.draw();
GL11.glPopMatrix();
@ -54,26 +52,26 @@ public class RenderSplitter implements ISimpleBlockRenderingHandler {
if(meta == 14 || meta == 3) rotation = 180F / 180F * (float)Math.PI;
boolean isLeft = meta >= 12;
CraneSplitter splitter = (CraneSplitter) block;
IIcon conveyor = splitter.iconBelt;
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Top", ModBlocks.block_steel.getIcon(0, 0), tessellator, rotation, true);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Bottom", ModBlocks.block_steel.getIcon(0, 0), tessellator, rotation, true);
if(isLeft) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Left", ModBlocks.block_steel.getIcon(0, 0), tessellator, rotation, true);
if(!isLeft) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Right", ModBlocks.block_steel.getIcon(0, 0), tessellator, rotation, true);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Back", ModBlocks.block_steel.getIcon(0, 0), tessellator, rotation, true);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Front", ModBlocks.block_steel.getIcon(0, 0), tessellator, rotation, true);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Inner", ModBlocks.block_steel.getIcon(0, 0), tessellator, rotation, true);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "InnerLeft", ModBlocks.block_steel.getIcon(0, 0), tessellator, rotation, true);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "InnerRight", ModBlocks.block_steel.getIcon(0, 0), tessellator, rotation, true);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "InnerTop", ModBlocks.block_steel.getIcon(0, 0), tessellator, rotation, true);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "InnerBottom", conveyor, tessellator, rotation, true);
drawSplitter(tessellator, block, isLeft, rotation, true);
tessellator.addTranslation(-x - 0.5F, -y, -z - 0.5F);
return true;
}
private static void drawSplitter(Tessellator tessellator, Block block, boolean isLeft, float rotation, boolean shadeNormals) {
CraneSplitter splitter = (CraneSplitter) block;
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Top", isLeft ? splitter.iconTopLeft : splitter.iconTopRight, tessellator, rotation, shadeNormals);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Bottom", isLeft ? splitter.iconTopRight : splitter.iconTopLeft , tessellator, rotation, shadeNormals);
if(isLeft) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Left", splitter.iconLeft, tessellator, rotation, shadeNormals);
if(!isLeft) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Right", splitter.iconRight, tessellator, rotation, shadeNormals);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Back", isLeft ? splitter.iconBackLeft : splitter.iconBackRight, tessellator, rotation, shadeNormals);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Front", isLeft ? splitter.iconFrontLeft : splitter.iconFrontRight, tessellator, rotation, shadeNormals);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "Inner", splitter.iconInner, tessellator, rotation, shadeNormals);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "InnerLeft", splitter.iconInnerSide, tessellator, rotation, shadeNormals);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "InnerRight", splitter.iconInnerSide, tessellator, rotation, shadeNormals);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "InnerTop", splitter.iconInnerSide, tessellator, rotation, shadeNormals);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.splitter, "InnerBottom", splitter.iconBelt, tessellator, rotation, shadeNormals);
}
@Override
public boolean shouldRender3DInInventory(int modelId) {

View File

@ -0,0 +1,18 @@
package com.hbm.render.entity.effect;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class RenderMist extends Render {
@Override
public void doRender(Entity entity, double x, double y, double z, float f0, float f1) {
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return null;
}
}

View File

@ -0,0 +1,92 @@
package com.hbm.render.entity.mob;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.entity.RenderCreeper;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
public class RenderCreeperUniversal extends RenderCreeper {
private final ResourceLocation creeperTextures;
private final ResourceLocation armoredCreeperTextures;
private float swellMod = 1.0F;
public RenderCreeperUniversal(String texture, String overlay) {
super();
creeperTextures = new ResourceLocation(texture);
armoredCreeperTextures = new ResourceLocation(overlay);
}
public RenderCreeperUniversal setSwellMod(float mod) {
this.swellMod = mod;
return this;
}
@Override
protected void preRenderCallback(EntityCreeper creeper, float interp) {
float swell = creeper.getCreeperFlashIntensity(interp);
float flash = 1.0F + MathHelper.sin(swell * 100.0F) * swell * 0.01F;
if(swell < 0.0F) {
swell = 0.0F;
}
if(swell > 1.0F) {
swell = 1.0F;
}
swell *= swell;
swell *= swell;
swell *= swellMod;
float scaleHorizontal = (1.0F + swell * 0.4F) * flash;
float scaleVertical = (1.0F + swell * 0.1F) / flash;
GL11.glScalef(scaleHorizontal, scaleVertical, scaleHorizontal);
}
@Override
protected int shouldRenderPass(EntityCreeper creeper, int pass, float interp) {
if(creeper.getPowered()) {
if(creeper.isInvisible()) {
GL11.glDepthMask(false);
} else {
GL11.glDepthMask(true);
}
if(pass == 1) {
float time = (float) creeper.ticksExisted + interp;
this.bindTexture(armoredCreeperTextures);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
float x = time * 0.01F;
float y = time * 0.01F;
GL11.glTranslatef(x, y, 0.0F);
this.setRenderPassModel(this.creeperModel);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_BLEND);
float flashColor = 0.5F;
GL11.glColor4f(flashColor, flashColor, flashColor, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
return 1;
}
if(pass == 2) {
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_BLEND);
}
}
return -1;
}
@Override
protected ResourceLocation getEntityTexture(EntityCreeper p_110775_1_) {
return creeperTextures;
}
}

View File

@ -1,189 +0,0 @@
package com.hbm.render.entity.mob;
import org.lwjgl.opengl.GL11;
import com.hbm.entity.mob.EntityNuclearCreeper;
import com.hbm.lib.RefStrings;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelCreeper;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
public class RenderNuclearCreeper extends RenderLiving
{
private static final ResourceLocation armoredCreeperTextures = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/creeper_armor.png");
private static final ResourceLocation creeperTextures = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/creeper.png");
/** The creeper model. */
private ModelBase creeperModel = new ModelCreeper(2.0F);
public RenderNuclearCreeper()
{
super(new ModelCreeper(), 0.5F);
}
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
protected void preRenderCallback(EntityNuclearCreeper p_77041_1_, float p_77041_2_)
{
float f1 = p_77041_1_.getCreeperFlashIntensity(p_77041_2_);
float f2 = 1.0F + MathHelper.sin(f1 * 100.0F) * f1 * 0.01F;
if (f1 < 0.0F)
{
f1 = 0.0F;
}
if (f1 > 1.0F)
{
f1 = 1.0F;
}
f1 *= f1;
f1 *= f1;
float f3 = (1.0F + f1 * 0.4F) * f2;
float f4 = (1.0F + f1 * 0.1F) / f2;
GL11.glScalef(f3, f4, f3);
}
/**
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
*/
protected int getColorMultiplier(EntityNuclearCreeper p_77030_1_, float p_77030_2_, float p_77030_3_)
{
float f2 = p_77030_1_.getCreeperFlashIntensity(p_77030_3_);
if ((int)(f2 * 10.0F) % 2 == 0)
{
return 0;
}
else
{
int i = (int)(f2 * 0.2F * 255.0F);
if (i < 0)
{
i = 0;
}
if (i > 255)
{
i = 255;
}
short short1 = 255;
short short2 = 255;
short short3 = 255;
return i << 24 | short1 << 16 | short2 << 8 | short3;
}
}
/**
* Queries whether should render the specified pass or not.
*/
protected int shouldRenderPass(EntityNuclearCreeper p_77032_1_, int p_77032_2_, float p_77032_3_)
{
if (p_77032_1_.getPowered())
{
if (p_77032_1_.isInvisible())
{
GL11.glDepthMask(false);
}
else
{
GL11.glDepthMask(true);
}
if (p_77032_2_ == 1)
{
float f1 = p_77032_1_.ticksExisted + p_77032_3_;
this.bindTexture(armoredCreeperTextures);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
float f2 = f1 * 0.01F;
float f3 = f1 * 0.01F;
GL11.glTranslatef(f2, f3, 0.0F);
this.setRenderPassModel(this.creeperModel);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_BLEND);
float f4 = 0.5F;
GL11.glColor4f(f4, f4, f4, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
return 1;
}
if (p_77032_2_ == 2)
{
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_BLEND);
}
}
return -1;
}
protected int inheritRenderPass(EntityNuclearCreeper p_77035_1_, int p_77035_2_, float p_77035_3_)
{
return -1;
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityNuclearCreeper p_110775_1_)
{
return creeperTextures;
}
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
@Override
protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_)
{
this.preRenderCallback((EntityNuclearCreeper)p_77041_1_, p_77041_2_);
}
/**
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
*/
@Override
protected int getColorMultiplier(EntityLivingBase p_77030_1_, float p_77030_2_, float p_77030_3_)
{
return this.getColorMultiplier((EntityNuclearCreeper)p_77030_1_, p_77030_2_, p_77030_3_);
}
/**
* Queries whether should render the specified pass or not.
*/
@Override
protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_)
{
return this.shouldRenderPass((EntityNuclearCreeper)p_77032_1_, p_77032_2_, p_77032_3_);
}
@Override
protected int inheritRenderPass(EntityLivingBase p_77035_1_, int p_77035_2_, float p_77035_3_)
{
return this.inheritRenderPass((EntityNuclearCreeper)p_77035_1_, p_77035_2_, p_77035_3_);
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
{
return this.getEntityTexture((EntityNuclearCreeper)p_110775_1_);
}
}

View File

@ -1,189 +0,0 @@
package com.hbm.render.entity.mob;
import org.lwjgl.opengl.GL11;
import com.hbm.entity.mob.EntityTaintedCreeper;
import com.hbm.lib.RefStrings;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelCreeper;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
public class RenderTaintedCreeper extends RenderLiving
{
private static final ResourceLocation armoredCreeperTextures = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/creeper_armor_taint.png");
private static final ResourceLocation creeperTextures = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/creeper_tainted.png");
/** The creeper model. */
private ModelBase creeperModel = new ModelCreeper(2.0F);
public RenderTaintedCreeper()
{
super(new ModelCreeper(), 0.5F);
}
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
protected void preRenderCallback(EntityTaintedCreeper p_77041_1_, float p_77041_2_)
{
float f1 = p_77041_1_.getCreeperFlashIntensity(p_77041_2_);
float f2 = 1.0F + MathHelper.sin(f1 * 100.0F) * f1 * 0.01F;
if (f1 < 0.0F)
{
f1 = 0.0F;
}
if (f1 > 1.0F)
{
f1 = 1.0F;
}
f1 *= f1;
f1 *= f1;
float f3 = (1.0F + f1 * 0.4F) * f2;
float f4 = (1.0F + f1 * 0.1F) / f2;
GL11.glScalef(f3, f4, f3);
}
/**
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
*/
protected int getColorMultiplier(EntityTaintedCreeper p_77030_1_, float p_77030_2_, float p_77030_3_)
{
float f2 = p_77030_1_.getCreeperFlashIntensity(p_77030_3_);
if ((int)(f2 * 10.0F) % 2 == 0)
{
return 0;
}
else
{
int i = (int)(f2 * 0.2F * 255.0F);
if (i < 0)
{
i = 0;
}
if (i > 255)
{
i = 255;
}
short short1 = 255;
short short2 = 255;
short short3 = 255;
return i << 24 | short1 << 16 | short2 << 8 | short3;
}
}
/**
* Queries whether should render the specified pass or not.
*/
protected int shouldRenderPass(EntityTaintedCreeper p_77032_1_, int p_77032_2_, float p_77032_3_)
{
if (p_77032_1_.getPowered())
{
if (p_77032_1_.isInvisible())
{
GL11.glDepthMask(false);
}
else
{
GL11.glDepthMask(true);
}
if (p_77032_2_ == 1)
{
float f1 = p_77032_1_.ticksExisted + p_77032_3_;
this.bindTexture(armoredCreeperTextures);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
float f2 = f1 * 0.01F;
float f3 = f1 * 0.01F;
GL11.glTranslatef(f2, f3, 0.0F);
this.setRenderPassModel(this.creeperModel);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_BLEND);
float f4 = 0.5F;
GL11.glColor4f(f4, f4, f4, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
return 1;
}
if (p_77032_2_ == 2)
{
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_BLEND);
}
}
return -1;
}
protected int inheritRenderPass(EntityTaintedCreeper p_77035_1_, int p_77035_2_, float p_77035_3_)
{
return -1;
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityTaintedCreeper p_110775_1_)
{
return creeperTextures;
}
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
@Override
protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_)
{
this.preRenderCallback((EntityTaintedCreeper)p_77041_1_, p_77041_2_);
}
/**
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
*/
@Override
protected int getColorMultiplier(EntityLivingBase p_77030_1_, float p_77030_2_, float p_77030_3_)
{
return this.getColorMultiplier((EntityTaintedCreeper)p_77030_1_, p_77030_2_, p_77030_3_);
}
/**
* Queries whether should render the specified pass or not.
*/
@Override
protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_)
{
return this.shouldRenderPass((EntityTaintedCreeper)p_77032_1_, p_77032_2_, p_77032_3_);
}
@Override
protected int inheritRenderPass(EntityLivingBase p_77035_1_, int p_77035_2_, float p_77035_3_)
{
return this.inheritRenderPass((EntityTaintedCreeper)p_77035_1_, p_77035_2_, p_77035_3_);
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
{
return this.getEntityTexture((EntityTaintedCreeper)p_110775_1_);
}
}

View File

@ -29,12 +29,6 @@ public class RenderChemical extends Render {
EntityChemical chem = (EntityChemical) entity;
ChemicalStyle style = chem.getStyle();
if(chem.lastClientPosX == -1 && chem.lastClientPosY == -1 && chem.lastClientPosZ == -1) {
chem.lastClientPosX = chem.posX - chem.motionX;
chem.lastClientPosY = chem.posY - chem.motionY;
chem.lastClientPosZ = chem.posZ - chem.motionZ;
}
if(style == ChemicalStyle.AMAT || style == ChemicalStyle.LIGHTNING)
renderAmatBeam(chem, f1);
@ -47,10 +41,6 @@ public class RenderChemical extends Render {
this.bindEntityTexture(chem);
renderGasFire(chem, f1);
}
chem.lastClientPosX = chem.prevPosX + (chem.posX - chem.prevPosX) * f1;
chem.lastClientPosY = chem.prevPosX + (chem.posY - chem.prevPosY) * f1;
chem.lastClientPosZ = chem.prevPosX + (chem.posZ - chem.prevPosZ) * f1;
GL11.glPopMatrix();
}

View File

@ -0,0 +1,99 @@
package com.hbm.render.item;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
public class ItemRenderBoltgun implements IItemRenderer {
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch(type) {
case EQUIPPED:
case EQUIPPED_FIRST_PERSON:
case ENTITY:
case INVENTORY:
return true;
default: return false;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING);
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.boltgun_tex);
switch(type) {
case EQUIPPED_FIRST_PERSON:
double s0 = 0.15D;
GL11.glTranslated(0.5, 0.35, -0.25F);
GL11.glRotated(15, 0, 0, 1);
GL11.glRotated(80, 0, 1, 0);
GL11.glScaled(s0, s0, s0);
GL11.glPushMatrix();
double[] anim = HbmAnimations.getRelevantTransformation("RECOIL");
GL11.glTranslated(0, 0, -anim[0]);
ResourceManager.boltgun.renderPart("Barrel");
GL11.glPopMatrix();
break;
case EQUIPPED:
double scale = 0.25D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(10, 0, 1, 0);
GL11.glRotated(10, 0, 0, 1);
GL11.glRotated(10, 1, 0, 0);
GL11.glTranslated(1.5, -0.25, 1);
break;
case ENTITY:
double s1 = 0.1D;
GL11.glScaled(s1, s1, s1);
break;
case INVENTORY:
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_LIGHTING);
double s = 1.75D;
GL11.glTranslated(7, 10, 0);
GL11.glRotated(-90, 0, 1, 0);
GL11.glRotated(-135, 1, 0, 0);
GL11.glScaled(s, s, -s);
break;
default: break;
}
ResourceManager.boltgun.renderPart("Gun");
if(type != type.EQUIPPED_FIRST_PERSON) {
ResourceManager.boltgun.renderPart("Barrel");
}
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

View File

@ -12,8 +12,6 @@ import net.minecraft.util.MathHelper;
import net.minecraftforge.client.IItemRenderer;
public class ItemRenderChainsaw implements IItemRenderer {
public ItemRenderChainsaw() { }
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
@ -29,7 +27,6 @@ public class ItemRenderChainsaw implements IItemRenderer {
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING);
}

View File

@ -26,5 +26,4 @@ public class RenderWatz extends TileEntitySpecialRenderer {
GL11.glPopMatrix();
}
}

View File

@ -0,0 +1,62 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.ModBlocks;
import com.hbm.render.util.SmallBlockPronter;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderWatzMultiblock extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
bindTexture(TextureMap.locationBlocksTexture);
SmallBlockPronter.startDrawing();
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_cooler, 0, 0F, 1F, 0F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_cooler, 0, 0F, 2F, 0F);
for(int i = 0; i < 3; i++) {
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_element, 0, 1F, i, 0F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_element, 0, 2F, i, 0F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_element, 0, 0F, i, 1F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_element, 0, 0F, i, 2F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_element, 0, -1F, i, 0F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_element, 0, -2F, i, 0F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_element, 0, 0F, i, -1F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_element, 0, 0F, i, -2F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_element, 0, 1F, i, 1F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_element, 0, 1F, i, -1F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_element, 0, -1F, i, 1F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_element, 0, -1F, i, -1F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_cooler, 0, 2F, i, 1F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_cooler, 0, 2F, i, -1F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_cooler, 0, 1F, i, 2F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_cooler, 0, -1F, i, 2F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_cooler, 0, -2F, i, 1F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_cooler, 0, -2F, i, -1F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_cooler, 0, 1F, i, -2F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_cooler, 0, -1F, i, -2F);
for(int j = -1; j < 2; j++) {
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, 3F, i, j);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, j, i, 3F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, -3F, i, j);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, j, i, -3F);
}
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, 2F, i, 2F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, 2F, i, -2F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, -2F, i, 2F);
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, -2F, i, -2F);
}
SmallBlockPronter.draw();
GL11.glPopMatrix();
}
}

View File

@ -0,0 +1,54 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.ModBlocks;
import com.hbm.main.ResourceManager;
import com.hbm.render.item.ItemRenderBase;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
public class RenderWatzPump extends TileEntitySpecialRenderer implements IItemRendererProvider {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y, (float) z + 0.5F);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.watz_pump_tex);
ResourceManager.watz_pump.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
@Override
public Item getItemForRenderer() {
return Item.getItemFromBlock(ModBlocks.watz_pump);
}
@Override
public IItemRenderer getRenderer() {
return new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -1.5, 0);
double scale = 5;
GL11.glScaled(scale, scale, scale);
}
public void renderCommon() {
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.watz_pump_tex);
ResourceManager.watz_pump.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}};
}
}

View File

@ -26,18 +26,8 @@ import net.minecraftforge.client.model.IModelCustom;
public class RendererObjTester extends TileEntitySpecialRenderer {
private static final ResourceLocation objTesterModelRL = new ResourceLocation(/*"/assets/" + */RefStrings.MODID, "models/TestObj.obj");
//private static final ResourceLocation objTesterModelRL = new ResourceLocation(/*"/assets/" + */RefStrings.MODID, "models/Prototype.obj");
private IModelCustom objTesterModel;
private ResourceLocation objTesterTexture;
public RendererObjTester()
{
objTesterModel = AdvancedModelLoader.loadModel(objTesterModelRL);
objTesterTexture = new ResourceLocation(RefStrings.MODID, "textures/models/TestObj.png");
//objTesterTexture = new ResourceLocation(RefStrings.MODID, "textures/models/Prototype.png");
}
@Override
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y, z + 0.5);

View File

@ -2,19 +2,26 @@ package com.hbm.render.util;
import org.lwjgl.opengl.GL11;
import com.hbm.interfaces.Spaghetti;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection;
public class SmallBlockPronter {
static float pixel = 1F/16F;
/**
* Bind the required texture yourself bruh
* Bind the required texture yourself bruh <- ding dong, 2023 bob speaking, fuck this guy
* @param loc
* @param x
* @param y
* @param z
*/
@Deprecated @Spaghetti("this is horseshit")
public static void renderSmolBlockAt(float x, float y, float z) {
GL11.glPushMatrix();
GL11.glTranslatef(x - 1, y - 1, z);
@ -64,4 +71,65 @@ public class SmallBlockPronter {
GL11.glPopMatrix();
}
public static void startDrawing() {
GL11.glEnable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glDepthMask(false);
Tessellator.instance.startDrawingQuads();
}
public static void draw() {
Tessellator.instance.draw();
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_LIGHTING);
}
public static void drawSmolBlockAt(Block b, int meta, float x, float y, float z) {
Tessellator tesseract = Tessellator.instance;
IIcon iconTop = b.getIcon(ForgeDirection.UP.ordinal(), meta);
IIcon iconBottom = b.getIcon(ForgeDirection.DOWN.ordinal(), meta);
IIcon iconNorth = b.getIcon(ForgeDirection.NORTH.ordinal(), meta);
IIcon iconSouth = b.getIcon(ForgeDirection.SOUTH.ordinal(), meta);
IIcon iconEast = b.getIcon(ForgeDirection.EAST.ordinal(), meta);
IIcon iconWest = b.getIcon(ForgeDirection.WEST.ordinal(), meta);
tesseract.setNormal(0F, 1F, 0F);
tesseract.addVertexWithUV(x + 1 - 11 * pixel / 2, y + 1 - 11 * pixel / 2, z + 1 - 11 * pixel / 2, iconSouth.getMaxU(), iconSouth.getMinV());
tesseract.addVertexWithUV(x + 11 * pixel / 2, y + 1 - 11 * pixel / 2, z + 1 - 11 * pixel / 2, iconSouth.getMinU(), iconSouth.getMinV());
tesseract.addVertexWithUV(x + 11 * pixel / 2, y + 11 * pixel / 2, z + 1 - 11 * pixel / 2, iconSouth.getMinU(), iconSouth.getMaxV());
tesseract.addVertexWithUV(x + 1 - 11 * pixel / 2, y + 11 * pixel / 2, z + 1 - 11 * pixel / 2, iconSouth.getMaxU(), iconSouth.getMaxV());
tesseract.addVertexWithUV(x + 1 - 11 * pixel / 2, y + 1 - 11 * pixel / 2, z + 11 * pixel / 2, iconEast.getMaxU(), iconEast.getMinV());
tesseract.addVertexWithUV(x + 1 - 11 * pixel / 2, y + 1 - 11 * pixel / 2, z + 1 - 11 * pixel / 2, iconEast.getMinU(), iconEast.getMinV());
tesseract.addVertexWithUV(x + 1 - 11 * pixel / 2, y + 11 * pixel / 2, z + 1 - 11 * pixel / 2, iconEast.getMinU(), iconEast.getMaxV());
tesseract.addVertexWithUV(x + 1 - 11 * pixel / 2, y + 11 * pixel / 2, z + 11 * pixel / 2, iconEast.getMaxU(), iconEast.getMaxV());
tesseract.addVertexWithUV(x + 11 * pixel / 2, y + 1 - 11 * pixel / 2, z + 11 * pixel / 2, iconNorth.getMaxU(), iconNorth.getMinV());
tesseract.addVertexWithUV(x + 1 - 11 * pixel / 2, y + 1 - 11 * pixel / 2, z + 11 * pixel / 2, iconNorth.getMinU(), iconNorth.getMinV());
tesseract.addVertexWithUV(x + 1 - 11 * pixel / 2,y + 11 * pixel / 2, z + 11 * pixel / 2, iconNorth.getMinU(), iconNorth.getMaxV());
tesseract.addVertexWithUV(x + 11 * pixel / 2, y + 11 * pixel / 2, z + 11 * pixel / 2, iconNorth.getMaxU(), iconNorth.getMaxV());
tesseract.addVertexWithUV(x + 11 * pixel / 2, y + 1 - 11 * pixel / 2, z + 1 - 11 * pixel / 2, iconWest.getMaxU(), iconWest.getMinV());
tesseract.addVertexWithUV(x + 11 * pixel / 2, y + 1 - 11 * pixel / 2, z + 11 * pixel / 2, iconWest.getMinU(), iconWest.getMinV());
tesseract.addVertexWithUV(x + 11 * pixel / 2, y + 11 * pixel / 2, z + 11 * pixel / 2, iconWest.getMinU(), iconWest.getMaxV());
tesseract.addVertexWithUV(x + 11 * pixel / 2, y + 11 * pixel / 2, z + 1 - 11 * pixel / 2, iconWest.getMaxU(), iconWest.getMaxV());
tesseract.addVertexWithUV(x + 1 - 11 * pixel / 2, y + 1 - 11 * pixel / 2, z + 11 * pixel / 2, iconTop.getMaxU(), iconTop.getMinV());
tesseract.addVertexWithUV(x + 11 * pixel / 2, y + 1 - 11 * pixel / 2, z + 11 * pixel / 2, iconTop.getMinU(), iconTop.getMinV());
tesseract.addVertexWithUV(x + 11 * pixel / 2, y + 1 - 11 * pixel / 2, z + 1 - 11 * pixel / 2, iconTop.getMinU(), iconTop.getMaxV());
tesseract.addVertexWithUV(x + 1 - 11 * pixel / 2, y + 1 - 11 * pixel / 2, z + 1 - 11 * pixel / 2, iconTop.getMaxU(), iconTop.getMaxV());
tesseract.addVertexWithUV(x + 11 * pixel / 2, y + 11 * pixel / 2, z + 11 * pixel / 2, iconBottom.getMaxU(), iconBottom.getMinV());
tesseract.addVertexWithUV(x + 1 - 11 * pixel / 2, y + 11 * pixel / 2, z + 11 * pixel / 2, iconBottom.getMinU(), iconBottom.getMinV());
tesseract.addVertexWithUV(x + 1 - 11 * pixel / 2, y + 11 * pixel / 2, z + 1 - 11 * pixel / 2, iconBottom.getMinU(), iconBottom.getMaxV());
tesseract.addVertexWithUV(x + 11 * pixel / 2, y + 11 * pixel / 2, z + 1 - 11 * pixel / 2, iconBottom.getMaxU(), iconBottom.getMaxV());
}
}

View File

@ -11,7 +11,9 @@ import com.hbm.blocks.generic.BlockEmitter.TileEntityEmitter;
import com.hbm.blocks.generic.BlockLoot.TileEntityLoot;
import com.hbm.blocks.generic.BlockMotherOfAllOres.TileEntityRandomOre;
import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe;
import com.hbm.blocks.generic.PartEmitter.TileEntityPartEmitter;
import com.hbm.blocks.machine.MachineFan.TileEntityFan;
import com.hbm.blocks.machine.WatzPump.TileEntityWatzPump;
import com.hbm.blocks.network.BlockCablePaintable.TileEntityCablePaintable;
import com.hbm.blocks.network.CableDiode.TileEntityDiode;
import com.hbm.blocks.network.FluidDuctGauge.TileEntityPipeGauge;
@ -77,6 +79,7 @@ public class TileMappings {
put(TileEntityMachineTeleporter.class, "tileentity_teleblock");
put(TileEntityHatch.class, "tileentity_seal_lid");
put(TileEntityMachineIGenerator.class, "tileentity_igenerator");
put(TileEntityPartEmitter.class, "tileentity_partemitter");
put(TileEntityDummy.class, "tileentity_dummy");
put(TileEntityMachineCyclotron.class, "tileentity_cyclotron");
put(TileEntityOilDuct.class, "tileentity_oil_duct");
@ -165,6 +168,7 @@ public class TileMappings {
put(TileEntityMachineFENSU.class, "tileentity_fensu");
put(TileEntityTrappedBrick.class, "tileentity_trapped_brick");
put(TileEntityPlasmaStruct.class, "tileentity_plasma_struct");
put(TileEntityWatzStruct.class, "tileentity_watz_struct");
put(TileEntityHadronDiode.class, "tileentity_hadron_diode");
put(TileEntityHadronPower.class, "tileentity_hadron_power");
put(TileEntityHadron.class, "tileentity_hadron");
@ -183,7 +187,6 @@ public class TileMappings {
put(TileEntityPipeBaseNT.class, "tileentity_pipe_base");
put(TileEntityPipePaintable.class, "tileentity_pipe_paintable");
put(TileEntityPipeGauge.class, "tileentity_pipe_gauge");
put(TileEntityWatz.class, "tileentity_watz");
put(TileEntityMachineBAT9000.class, "tileentity_bat9000");
put(TileEntityMachineOrbus.class, "tileentity_orbus");
@ -306,6 +309,9 @@ public class TileMappings {
put(TileEntityReactorZirnox.class, "tileentity_zirnox");
put(TileEntityZirnoxDestroyed.class, "tileentity_zirnox_destroyed");
put(TileEntityWatz.class, "tileentity_watz");
put(TileEntityWatzPump.class, "tileentity_watz_pump");
}
private static void putPile() {
@ -347,6 +353,7 @@ public class TileMappings {
put(TileEntityCraneInserter.class, "tileentity_inserter");
put(TileEntityCraneExtractor.class, "tileentity_extractor");
put(TileEntityCraneGrabber.class, "tileentity_grabber");
put(TileEntityCraneBoxer.class, "tileentity_boxer");
put(TileEntityCraneUnboxer.class, "tileentity_unboxer");
put(TileEntityCraneRouter.class, "tileentity_router");

View File

@ -145,23 +145,11 @@ public class TileEntityMachineMixer extends TileEntityMachineBase implements INB
if(recipe == null) return false;
if(recipe.input1 != null) {
if(recipe.input1.type != tanks[0].getTankType()) {
tanks[0].setTankType(recipe.input1.type);
}
if(tanks[0].getFill() < recipe.input1.fill) return false;
}
if(recipe.input2 != null) {
if(recipe.input2.type != tanks[1].getTankType()) {
tanks[1].setTankType(recipe.input2.type);
}
if(tanks[1].getFill() < recipe.input2.fill) return false;
}
tanks[0].setTankType(recipe.input1 != null ? recipe.input1.type : Fluids.NONE);
tanks[1].setTankType(recipe.input2 != null ? recipe.input2.type : Fluids.NONE);
if(recipe.input1 != null && tanks[0].getFill() < recipe.input1.fill) return false;
if(recipe.input2 != null && tanks[1].getFill() < recipe.input2.fill) return false;
/* simplest check would usually go first, but fluid checks also do the setup and we want that to happen even without power */
if(this.power < getConsumption()) return false;

View File

@ -1,6 +1,7 @@
package com.hbm.tileentity.machine;
import com.hbm.config.VersatileConfig;
import com.hbm.inventory.OreDictManager;
import com.hbm.inventory.container.ContainerMachineSchrabidiumTransmutator;
import com.hbm.inventory.gui.GUIMachineSchrabidiumTransmutator;
import com.hbm.inventory.recipes.MachineRecipes;
@ -50,7 +51,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntityMachineB
public boolean isItemValidForSlot(int i, ItemStack stack) {
switch (i) {
case 0:
if (MachineRecipes.mODE(stack, "ingotUranium"))
if (MachineRecipes.mODE(stack, OreDictManager.U.ingot()))
return true;
break;
case 2:
@ -113,7 +114,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntityMachineB
}
public boolean canProcess() {
if (power >= 4990000 && slots[0] != null && MachineRecipes.mODE(slots[0], "ingotUranium") && slots[2] != null
if (power >= 4990000 && slots[0] != null && MachineRecipes.mODE(slots[0], OreDictManager.U.ingot()) && slots[2] != null
&& slots[2].getItem() == ModItems.redcoil_capacitor
&& ItemCapacitor.getDura(slots[2]) > 0
&& (slots[1] == null || (slots[1] != null && slots[1].getItem() == VersatileConfig.getTransmutatorItem()

View File

@ -5,7 +5,6 @@ import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.entity.mob.EntityCyberCrab;
import com.hbm.entity.mob.EntityNuclearCreeper;
import com.hbm.entity.mob.EntityTaintCrab;
import com.hbm.entity.mob.EntityTeslaCrab;
import com.hbm.lib.Library;
@ -134,10 +133,6 @@ public class TileEntityTesla extends TileEntityMachineBase implements IEnergyUse
((EntityCreeper)e).getDataWatcher().updateObject(17, Byte.valueOf((byte)1));
}
if(e instanceof EntityNuclearCreeper) {
((EntityNuclearCreeper)e).getDataWatcher().updateObject(17, Byte.valueOf((byte)1));
}
double offset = 0;
if(source != null && e instanceof EntityPlayer && worldObj.isRemote)

View File

@ -3,6 +3,7 @@ package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.inventory.container.ContainerWatz;
import com.hbm.inventory.fluid.Fluids;
@ -28,6 +29,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
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;
@ -40,6 +42,7 @@ public class TileEntityWatz extends TileEntityMachineBase implements IFluidStand
public double fluxLastBase; //flux created by the previous passive emission, only used for display
public double fluxLastReaction; //flux created by the previous reaction, used for the next reaction
public double fluxDisplay;
public boolean isOn;
/* lock types for item IO */
public boolean isLocked = false;
@ -64,6 +67,7 @@ public class TileEntityWatz extends TileEntityMachineBase implements IFluidStand
if(!worldObj.isRemote && !updateLock()) {
boolean turnedOn = worldObj.getBlock(xCoord, yCoord + 3, zCoord) == ModBlocks.watz_pump && worldObj.getIndirectPowerLevelTo(xCoord, yCoord + 5, zCoord, 0) > 0;
List<TileEntityWatz> segments = new ArrayList();
segments.add(this);
this.subscribeToTop();
@ -97,11 +101,18 @@ public class TileEntityWatz extends TileEntityMachineBase implements IFluidStand
}
/* update reaction, top to bottom */
this.updateReaction(null, sharedTanks);
this.updateReaction(null, sharedTanks, turnedOn);
for(int i = 1; i < segments.size(); i++) {
TileEntityWatz segment = segments.get(i);
TileEntityWatz above = segments.get(i - 1);
segment.updateReaction(above, sharedTanks);
segment.updateReaction(above, sharedTanks, turnedOn);
}
/* send sync packets (order doesn't matter) */
for(TileEntityWatz segment : segments) {
segment.isOn = turnedOn;
segment.sendPacket(sharedTanks);
segment.heat *= 0.99; //cool 1% per tick
}
/* re-distribute fluid from shared tanks back into actual tanks, bottom to top */
@ -109,28 +120,18 @@ public class TileEntityWatz extends TileEntityMachineBase implements IFluidStand
TileEntityWatz segment = segments.get(i);
for(int j = 0; j < 3; j++) {
int min = Math.min(segment.tanks[j].getMaxFill(), sharedTanks[j].getFill());
segment.tanks[j].setFill(min);
sharedTanks[j].setFill(sharedTanks[j].getFill() - min);
segment.tanks[j].setFill(min);
}
}
/* send sync packets (order doesn't matter) */
for(TileEntityWatz segment : segments) {
segment.sendPacket(sharedTanks);
segment.heat *= 0.99; //cool 1% per tick
}
segments.get(segments.size() - 1).sendOutBottom();
}
}
/** basic sanity checking, usually wouldn't do anything except when NBT loading borks */
public void setupCoolant() {
if(!tanks[0].getTankType().hasTrait(FT_Heatable.class)) {
tanks[0].setTankType(Fluids.COOLANT);
}
tanks[0].setTankType(Fluids.COOLANT);
tanks[1].setTankType(tanks[0].getTankType().getTrait(FT_Heatable.class).getFirstStep().typeProduced);
}
@ -148,62 +149,69 @@ public class TileEntityWatz extends TileEntityMachineBase implements IFluidStand
int cycles = Math.min(heatCycles, Math.min(hotCycles, coolCycles));
this.heat -= cycles * step.heatReq;
tanks[0].setFill(tanks[0].getFill() - coolCycles * step.amountReq);
tanks[1].setFill(tanks[1].getFill() + hotCycles * step.amountProduced);
tanks[0].setFill(tanks[0].getFill() - cycles * step.amountReq);
tanks[1].setFill(tanks[1].getFill() + cycles * step.amountProduced);
}
/** enforces strict top to bottom update order (instead of semi-random based on placement) */
public void updateReaction(TileEntityWatz above, FluidTank[] tanks) {
public void updateReaction(TileEntityWatz above, FluidTank[] tanks, boolean turnedOn) {
List<ItemStack> pellets = new ArrayList();
for(int i = 0; i < 24; i++) {
ItemStack stack = slots[i];
if(stack != null && stack.getItem() == ModItems.watz_pellet) {
pellets.add(stack);
}
}
double baseFlux = 0D;
/* init base flux */
for(ItemStack stack : pellets) {
EnumWatzType type = EnumUtil.grabEnumSafely(EnumWatzType.class, stack.getItemDamage());
baseFlux += type.passive;
}
double inputFlux = baseFlux + fluxLastReaction;
double addedFlux = 0D;
double addedHeat = 0D;
for(ItemStack stack : pellets) {
EnumWatzType type = EnumUtil.grabEnumSafely(EnumWatzType.class, stack.getItemDamage());
Function burnFunc = type.burnFunc;
Function heatMod = type.heatMult;
if(turnedOn) {
List<ItemStack> pellets = new ArrayList();
if(burnFunc != null) {
double mod = heatMod != null ? heatMod.effonix(heat) : 1D;
double burn = burnFunc.effonix(inputFlux) * mod;
ItemWatzPellet.setYield(stack, ItemWatzPellet.getYield(stack) - burn);
addedFlux += burn;
addedHeat += type.heatEmission * burn;
tanks[2].setFill(tanks[2].getFill() + (int) Math.round(type.mudContent * burn));
for(int i = 0; i < 24; i++) {
ItemStack stack = slots[i];
if(stack != null && stack.getItem() == ModItems.watz_pellet) {
pellets.add(stack);
}
}
}
for(ItemStack stack : pellets) {
EnumWatzType type = EnumUtil.grabEnumSafely(EnumWatzType.class, stack.getItemDamage());
Function absorbFunc = type.absorbFunc;
if(absorbFunc != null) {
addedHeat += absorbFunc.effonix(baseFlux + fluxLastReaction);
double baseFlux = 0D;
/* init base flux */
for(ItemStack stack : pellets) {
EnumWatzType type = EnumUtil.grabEnumSafely(EnumWatzType.class, stack.getItemDamage());
baseFlux += type.passive;
}
double inputFlux = baseFlux + fluxLastReaction;
double addedFlux = 0D;
double addedHeat = 0D;
for(ItemStack stack : pellets) {
EnumWatzType type = EnumUtil.grabEnumSafely(EnumWatzType.class, stack.getItemDamage());
Function burnFunc = type.burnFunc;
Function heatMod = type.heatMult;
if(burnFunc != null) {
double mod = heatMod != null ? heatMod.effonix(heat) : 1D;
double burn = burnFunc.effonix(inputFlux) * mod;
ItemWatzPellet.setYield(stack, ItemWatzPellet.getYield(stack) - burn);
addedFlux += burn;
addedHeat += type.heatEmission * burn;
tanks[2].setFill(tanks[2].getFill() + (int) Math.round(type.mudContent * burn));
}
}
for(ItemStack stack : pellets) {
EnumWatzType type = EnumUtil.grabEnumSafely(EnumWatzType.class, stack.getItemDamage());
Function absorbFunc = type.absorbFunc;
if(absorbFunc != null) {
addedHeat += absorbFunc.effonix(baseFlux + fluxLastReaction);
}
}
this.heat += addedHeat;
this.fluxLastBase = baseFlux;
this.fluxLastReaction = addedFlux;
} else {
this.fluxLastBase = 0;
this.fluxLastReaction = 0;
}
this.heat += addedHeat;
this.fluxLastBase = baseFlux;
this.fluxLastReaction = addedFlux;
if(above != null) {
for(int i = 0; i < 24; i++) {
ItemStack stackBottom = slots[i];
@ -235,12 +243,25 @@ public class TileEntityWatz extends TileEntityMachineBase implements IFluidStand
NBTTagCompound data = new NBTTagCompound();
data.setInteger("heat", this.heat);
data.setBoolean("isOn", isOn);
data.setBoolean("lock", isLocked);
data.setDouble("flux", this.fluxLastReaction + this.fluxLastBase);
for(int i = 0; i < tanks.length; i++) {
tanks[i].writeToNBT(data, "t" + i);
}
this.networkPack(data, 25);
}
@Override
public void networkUnpack(NBTTagCompound nbt) {
this.heat = nbt.getInteger("heat");
this.isOn = nbt.getBoolean("isOn");
this.isLocked = nbt.getBoolean("lock");
this.fluxDisplay = nbt.getDouble("flux");
for(int i = 0; i < tanks.length; i++) {
tanks[i].readFromNBT(nbt, "t" + i);
}
}
/** Prevent manual updates when another segment is above this one */
public boolean updateLock() {
@ -272,14 +293,49 @@ public class TileEntityWatz extends TileEntityMachineBase implements IFluidStand
new DirPos(xCoord, yCoord - 1, zCoord - 2, ForgeDirection.DOWN)
};
}
@Override
public void networkUnpack(NBTTagCompound nbt) {
this.heat = nbt.getInteger("heat");
this.fluxDisplay = nbt.getDouble("flux");
for(int i = 0; i < tanks.length; i++) {
tanks[i].readFromNBT(nbt, "t" + i);
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("locks", 10);
for(int i = 0; i < list.tagCount(); i++) {
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) {
locks[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
for(int i = 0; i < tanks.length; i++) tanks[i].readFromNBT(nbt, "t" + i);
this.fluxLastBase = nbt.getDouble("lastFluxB");
this.fluxLastReaction = nbt.getDouble("lastFluxR");
this.isLocked = nbt.getBoolean("isLocked");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
for(int i = 0; i < locks.length; i++) {
if(locks[i] != null) {
NBTTagCompound nbt1 = new NBTTagCompound();
nbt1.setByte("slot", (byte) i);
locks[i].writeToNBT(nbt1);
list.appendTag(nbt1);
}
}
nbt.setTag("locks", list);
for(int i = 0; i < tanks.length; i++) tanks[i].writeToNBT(nbt, "t" + i);
nbt.setDouble("lastFluxB", fluxLastBase);
nbt.setDouble("lastFluxR", fluxLastReaction);
nbt.setBoolean("isLocked", isLocked);
}
@Override
@ -307,7 +363,9 @@ public class TileEntityWatz extends TileEntityMachineBase implements IFluidStand
@Override
public boolean isItemValidForSlot(int i, ItemStack stack) {
return stack.getItem() == ModItems.watz_pellet;
if(stack.getItem() != ModItems.watz_pellet) return false;
if(!this.isLocked) return true;
return this.locks[i] != null && this.locks[i].getItem() == stack.getItem() && locks[i].getItemDamage() == stack.getItemDamage();
}
@Override

View File

@ -0,0 +1,104 @@
package com.hbm.tileentity.machine;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.Watz;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityWatzStruct extends TileEntity {
@Override
public void updateEntity() {
if(worldObj.isRemote) return;
if(worldObj.getTotalWorldTime() % 20 != 0) return;
/*
* skeptics may say that his is shit. i don't necessarily disagree, but it was both easy and quick to do
* and it remains readable and not terribly long, so who the fuck cares.
*/
if(!cbr(ModBlocks.watz_cooler, 0, 1, 0)) return;
if(!cbr(ModBlocks.watz_cooler, 0, 2, 0)) return;
for(int i = 0; i < 3; i++) {
if(!cbr(ModBlocks.watz_element, 1, i, 0)) return;
if(!cbr(ModBlocks.watz_element, 2, i, 0)) return;
if(!cbr(ModBlocks.watz_element, 0, i, 1)) return;
if(!cbr(ModBlocks.watz_element, 0, i, 2)) return;
if(!cbr(ModBlocks.watz_element, -1, i, 0)) return;
if(!cbr(ModBlocks.watz_element, -2, i, 0)) return;
if(!cbr(ModBlocks.watz_element, 0, i, -1)) return;
if(!cbr(ModBlocks.watz_element, 0, i, -2)) return;
if(!cbr(ModBlocks.watz_element, 1, i, 1)) return;
if(!cbr(ModBlocks.watz_element, 1, i, -1)) return;
if(!cbr(ModBlocks.watz_element, -1, i, 1)) return;
if(!cbr(ModBlocks.watz_element, -1, i, -1)) return;
if(!cbr(ModBlocks.watz_cooler, 2, i, 1)) return;
if(!cbr(ModBlocks.watz_cooler, 2, i, -1)) return;
if(!cbr(ModBlocks.watz_cooler, 1, i, 2)) return;
if(!cbr(ModBlocks.watz_cooler, -1, i, 2)) return;
if(!cbr(ModBlocks.watz_cooler, -2, i, 1)) return;
if(!cbr(ModBlocks.watz_cooler, -2, i, -1)) return;
if(!cbr(ModBlocks.watz_cooler, 1, i, -2)) return;
if(!cbr(ModBlocks.watz_cooler, -1, i, -2)) return;
for(int j = -1; j < 2; j++) {
if(!cbr(ModBlocks.watz_end, 3, i, j)) return;
if(!cbr(ModBlocks.watz_end, j, i, 3)) return;
if(!cbr(ModBlocks.watz_end, -3, i, j)) return;
if(!cbr(ModBlocks.watz_end, j, i, -3)) return;
}
if(!cbr(ModBlocks.watz_end, 2, i, 2)) return;
if(!cbr(ModBlocks.watz_end, 2, i, -2)) return;
if(!cbr(ModBlocks.watz_end, -2, i, 2)) return;
if(!cbr(ModBlocks.watz_end, -2, i, -2)) return;
}
Watz watz = (Watz)ModBlocks.watz;
BlockDummyable.safeRem = true;
worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.watz, this.getBlockMetadata() + BlockDummyable.offset, 3);
watz.fillSpace(worldObj, xCoord, yCoord, zCoord, ForgeDirection.NORTH, 0);
BlockDummyable.safeRem = false;
}
/** [G]et [B]lock at [R]elative position */
private Block gbr(int x, int y, int z) {
return worldObj.getBlock(xCoord + x, yCoord + y, zCoord + z);
}
/** [C]heck [B]lock at [R]elative position */
private boolean cbr(Block b, int x, int y, int z) {
return b == gbr(x, y, z);
}
AxisAlignedBB bb = null;
@Override
public AxisAlignedBB getRenderBoundingBox() {
if(bb == null) {
bb = AxisAlignedBB.getBoundingBox(
xCoord - 3,
yCoord,
zCoord - 3,
xCoord + 4,
yCoord + 3,
zCoord + 4
);
}
return bb;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
}

View File

@ -1,17 +1,10 @@
package com.hbm.tileentity.machine.oil;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.BlockDummyable;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidSource;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.recipes.CrackingRecipes;
import com.hbm.lib.Library;
import com.hbm.tileentity.INBTPacketReceiver;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.util.Tuple.Pair;
@ -24,20 +17,17 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase implements IFluidSource, IFluidAcceptor, INBTPacketReceiver, IFluidStandardTransceiver {
public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase implements INBTPacketReceiver, IFluidStandardTransceiver {
public FluidTank[] tanks;
public List<IFluidAcceptor> list1 = new ArrayList();
public List<IFluidAcceptor> list2 = new ArrayList();
public List<IFluidAcceptor> list3 = new ArrayList();
public TileEntityMachineCatalyticCracker() {
tanks = new FluidTank[5];
tanks[0] = new FluidTank(Fluids.BITUMEN, 4000, 0);
tanks[1] = new FluidTank(Fluids.STEAM, 8000, 1);
tanks[2] = new FluidTank(Fluids.OIL, 4000, 2);
tanks[3] = new FluidTank(Fluids.PETROLEUM, 4000, 3);
tanks[4] = new FluidTank(Fluids.SPENTSTEAM, 800, 4);
tanks[0] = new FluidTank(Fluids.BITUMEN, 4000);
tanks[1] = new FluidTank(Fluids.STEAM, 8000);
tanks[2] = new FluidTank(Fluids.OIL, 4000);
tanks[3] = new FluidTank(Fluids.PETROLEUM, 4000);
tanks[4] = new FluidTank(Fluids.SPENTSTEAM, 800);
}
@Override
@ -51,14 +41,11 @@ public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase impl
updateConnections();
this.worldObj.theProfiler.endStartSection("catalyticCracker_do_recipe");
if(worldObj.getTotalWorldTime() % 20 == 0)
if(worldObj.getTotalWorldTime() % 5 == 0)
crack();
this.worldObj.theProfiler.endStartSection("catalyticCracker_send_fluid");
if(worldObj.getTotalWorldTime() % 10 == 0) {
fillFluidInit(tanks[2].getTankType());
fillFluidInit(tanks[3].getTankType());
fillFluidInit(tanks[4].getTankType());
for(DirPos pos : getConPos()) {
for(int i = 2; i <= 4; i++) {
@ -149,63 +136,6 @@ public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase impl
for(int i = 0; i < 5; i++)
tanks[i].writeToNBT(nbt, "tank" + i);
}
@Override
public void setFillForSync(int fill, int index) {
if(index < 5 && tanks[index] != null)
tanks[index].setFill(fill);
}
@Override
public void setFluidFill(int fill, FluidType type) {
for(FluidTank tank : tanks) {
if(tank.getTankType() == type) {
tank.setFill(fill);
}
}
}
@Override
public void setTypeForSync(FluidType type, int index) {
this.tanks[index].setTankType(type);
}
@Override
public int getFluidFill(FluidType type) {
for(FluidTank tank : tanks) {
if(tank.getTankType() == type) {
return tank.getFill();
}
}
return 0;
}
@Override
public int getMaxFluidFill(FluidType type) {
if(type == tanks[0].getTankType())
return tanks[0].getMaxFill();
else if(type == tanks[1].getTankType())
return tanks[1].getMaxFill();
else
return 0;
}
@Override
public void fillFluidInit(FluidType type) {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
fillFluid(xCoord + dir.offsetX * 4 + rot.offsetX * 1, yCoord, zCoord + dir.offsetZ * 4 + rot.offsetZ * 1, this.getTact(), type);
fillFluid(xCoord + dir.offsetX * 4 - rot.offsetX * 2, yCoord, zCoord + dir.offsetZ * 4 - rot.offsetZ * 2, this.getTact(), type);
fillFluid(xCoord - dir.offsetX * 4 + rot.offsetX * 1, yCoord, zCoord - dir.offsetZ * 4 + rot.offsetZ * 1, this.getTact(), type);
fillFluid(xCoord - dir.offsetX * 4 - rot.offsetX * 2, yCoord, zCoord - dir.offsetZ * 4 - rot.offsetZ * 2, this.getTact(), type);
fillFluid(xCoord + dir.offsetX * 2 + rot.offsetX * 3, yCoord, zCoord + dir.offsetZ * 2 + rot.offsetZ * 3, this.getTact(), type);
fillFluid(xCoord + dir.offsetX * 2 - rot.offsetX * 4, yCoord, zCoord + dir.offsetZ * 2 - rot.offsetZ * 4, this.getTact(), type);
fillFluid(xCoord - dir.offsetX * 2 + rot.offsetX * 3, yCoord, zCoord - dir.offsetZ * 2 + rot.offsetZ * 3, this.getTact(), type);
fillFluid(xCoord - dir.offsetX * 2 - rot.offsetX * 4, yCoord, zCoord - dir.offsetZ * 2 - rot.offsetZ * 4, this.getTact(), type);
}
protected DirPos[] getConPos() {
@ -223,31 +153,6 @@ public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase impl
new DirPos(xCoord - dir.offsetX * 2 - rot.offsetX * 4, yCoord, zCoord - dir.offsetZ * 2 - rot.offsetZ * 4, rot.getOpposite())
};
}
@Override
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
}
@Override
public boolean getTact() {
return worldObj.getTotalWorldTime() % 20 < 10;
}
@Override
public List<IFluidAcceptor> getFluidList(FluidType type) {
if(type == tanks[2].getTankType()) return list1;
if(type == tanks[3].getTankType()) return list2;
if(type == tanks[4].getTankType()) return list3;
return new ArrayList<IFluidAcceptor>();
}
@Override
public void clearFluidList(FluidType type) {
if(type == tanks[2].getTankType()) list1.clear();
if(type == tanks[3].getTankType()) list2.clear();
if(type == tanks[4].getTankType()) list3.clear();
}
AxisAlignedBB bb = null;

View File

@ -199,7 +199,7 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
public int getDelayEff() {
int delay = getDelay();
return Math.max((delay - (delay / 4 * this.speedLevel) + (delay / 10 * this.energyLevel) / this.overLevel), 1);
return Math.max((delay - (delay / 4 * this.speedLevel) + (delay / 10 * this.energyLevel)) / this.overLevel, 1);
}
public abstract int getPowerReq();

View File

@ -222,7 +222,10 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
//if it's just a consumer, buffer it as a subscriber
} else if(te instanceof IEnergyConnector) {
consumers.add((IEnergyConnector) te);
IEnergyConnector con = (IEnergyConnector) te;
if(con.canConnect(dir.getOpposite())) {
consumers.add((IEnergyConnector) te);
}
}
}

View File

@ -0,0 +1,195 @@
package com.hbm.tileentity.network;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.network.CraneInserter;
import com.hbm.entity.item.EntityMovingItem;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.inventory.container.ContainerCraneGrabber;
import com.hbm.inventory.gui.GUICraneGrabber;
import com.hbm.items.ModItems;
import com.hbm.module.ModulePatternMatcher;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
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;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityCraneGrabber extends TileEntityMachineBase implements IGUIProvider, IControlReceiver {
public boolean isWhitelist = false;
public ModulePatternMatcher matcher;
public TileEntityCraneGrabber() {
super(11);
this.matcher = new ModulePatternMatcher(9);
}
public void nextMode(int i) {
this.matcher.nextMode(worldObj, slots[i], i);
}
@Override
public String getName() {
return "container.craneGrabber";
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
int delay = 20;
if(slots[10] != null && slots[10].getItem() == ModItems.upgrade_ejector) {
switch(slots[10].getItemDamage()) {
case 0: delay = 10; break;
case 1: delay = 5; break;
case 2: delay = 2; break;
}
}
if(worldObj.getTotalWorldTime() % delay == 0 && !this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) {
int amount = 1;
if(slots[9] != null && slots[9].getItem() == ModItems.upgrade_stack) {
switch(slots[9].getItemDamage()) {
case 0: amount = 4; break;
case 1: amount = 16; break;
case 2: amount = 64; break;
}
}
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata());
TileEntity te = worldObj.getTileEntity(xCoord - dir.offsetX, yCoord - dir.offsetY, zCoord - dir.offsetZ);
int[] access = null;
ISidedInventory sided = null;
if(te instanceof ISidedInventory) {
sided = (ISidedInventory) te;
access = CraneInserter.masquerade(sided, dir.ordinal());
}
if(te instanceof IInventory) {
/*
* due to this really primitive way of just offsetting the AABB instead of contracting it, there's a wacky
* edge-case where it's possible to feed the grabber by inserting items from the side if there's a triple
* lane conveyor in front of the grabbing end. this is such a non-issue that i'm not going to bother trying
* to fuck with the AABB further, since that's just a major headache for no practical benefit
*/
double reach = 1D;
if(this.getBlockMetadata() > 1) { //ignore if pointing up or down
Block b = worldObj.getBlock(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
if(b == ModBlocks.conveyor_double) reach = 0.5D;
if(b == ModBlocks.conveyor_triple) reach = 0.33D;
}
double x = xCoord + dir.offsetX * reach;
double y = yCoord + dir.offsetY * reach;
double z = zCoord + dir.offsetZ * reach;
List<EntityMovingItem> items = worldObj.getEntitiesWithinAABB(EntityMovingItem.class, AxisAlignedBB.getBoundingBox(x + 0.1875D, y + 0.1875D, z + 0.1875D, x + 0.8125D, y + 0.8125D, z + 0.8125D));
for(EntityMovingItem item : items) {
ItemStack stack = item.getItemStack();
boolean match = this.matchesFilter(stack);
if(this.isWhitelist && !match || !this.isWhitelist && match) continue;
ItemStack copy = stack.copy();
int toAdd = Math.min(stack.stackSize, amount);
copy.stackSize = toAdd;
ItemStack ret = CraneInserter.addToInventory((IInventory) te, access, copy, dir.ordinal());
int didAdd = toAdd - (ret != null ? ret.stackSize : 0);
stack.stackSize -= didAdd;
if(stack.stackSize <= 0) {
item.setDead();
}
amount -= didAdd;
if(amount <= 0) {
break;
}
}
}
}
NBTTagCompound data = new NBTTagCompound();
data.setBoolean("isWhitelist", isWhitelist);
this.matcher.writeToNBT(data);
this.networkPack(data, 15);
}
}
public void networkUnpack(NBTTagCompound nbt) {
this.isWhitelist = nbt.getBoolean("isWhitelist");
this.matcher.modes = new String[this.matcher.modes.length];
this.matcher.readFromNBT(nbt);
}
public boolean matchesFilter(ItemStack stack) {
for(int i = 0; i < 9; i++) {
ItemStack filter = slots[i];
if(filter != null && this.matcher.isValidForFilter(filter, i, stack)) {
return true;
}
}
return false;
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new ContainerCraneGrabber(player.inventory, this);
}
@Override
@SideOnly(Side.CLIENT)
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new GUICraneGrabber(player.inventory, this);
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.isWhitelist = nbt.getBoolean("isWhitelist");
this.matcher.readFromNBT(nbt);
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setBoolean("isWhitelist", this.isWhitelist);
this.matcher.writeToNBT(nbt);
}
@Override
public boolean hasPermission(EntityPlayer player) {
return Vec3.createVectorHelper(xCoord - player.posX, yCoord - player.posY, zCoord - player.posZ).lengthVector() < 20;
}
@Override
public void receiveControl(NBTTagCompound data) {
if(data.hasKey("whitelist")) {
this.isWhitelist = !this.isWhitelist;
}
}
}

View File

@ -117,13 +117,4 @@ public class ArmorRegistry {
this.lang = lang;
}
}
/*public static enum ArmorClass {
MASK_FILTERED,
MASK_OXY,
GOGGLES,
HAZMAT_HEAT,
HAZMAT_RADIATION,
HAZMAT_BIO;
}*/
}

View File

@ -3,7 +3,7 @@ package com.hbm.util;
import java.util.HashSet;
import com.hbm.entity.mob.EntityDuck;
import com.hbm.entity.mob.EntityNuclearCreeper;
import com.hbm.entity.mob.EntityCreeperNuclear;
import com.hbm.entity.mob.EntityQuackos;
import com.hbm.extprop.HbmLivingProps;
import com.hbm.handler.HazmatRegistry;
@ -65,7 +65,7 @@ public class ContaminationUtil {
return true;
if(immuneEntities.isEmpty()) {
immuneEntities.add(EntityNuclearCreeper.class);
immuneEntities.add(EntityCreeperNuclear.class);
immuneEntities.add(EntityMooshroom.class);
immuneEntities.add(EntityZombie.class);
immuneEntities.add(EntitySkeleton.class);

Some files were not shown because too many files have changed in this diff Show More