killed useless blocks, sellafite ores

This commit is contained in:
Bob 2024-01-10 20:48:34 +01:00
parent eb3c0ff9b1
commit 3dcf5a8e47
25 changed files with 124 additions and 1227 deletions

View File

@ -3,6 +3,8 @@
* The fallout effect no longer creates dead grass, instead it converts the area into three new biomes, the outer crater, crater and inner crater
* The entire crater is now slaked sellafite which now has texture variance to look more like debris, as well as getting darker towards the center
* The biomes being overridden means that nukes are now a solution to thaumcraft taint. Yay!
* There are now new ore variants for the block conversions which match the surrounding sellafite
* Berylliumm ore now has a 100% chance of being converted into emerald
* The watz now cools up to 20% of its current heat level instead of 10%, making reactors a lot cooler and therefore react faster, which means more energy and faster depletion rates
* Mud production rates have been halved, to prevent currently working setups from exploding instantly
* This is your reminder that you can achieve more power, mud and depletion by building larger watz powerplants, i.e. stacking more watz segments on top of each other. Your tiny poo reactors make me sick.
@ -10,6 +12,7 @@
* Adjusted the nuclear flash's intensity, the flash will now deal less and less radiation the longer it goes on
* The nuclear flash now bypasses radiation resistance, being only affected by blocks and distance
* Mushroom clouds' initial scale is now based on the total scale instead of all spawning roughly at the same size, causing fireballs to be comically small for huge bombs
* Removed the old mining drill for good
## Fixed
* Fixed a rare crash caused by radars force-loading chunks conflicting with certain mods' chunk loading changes

View File

@ -534,12 +534,8 @@ public class ModBlocks {
public static Block sellafield_slaked;
public static Block sellafield;
/*public static Block sellafield_0;
public static Block sellafield_1;
public static Block sellafield_2;
public static Block sellafield_3;
public static Block sellafield_4;
public static Block sellafield_core;*/
public static Block ore_sellafield_diamond;
public static Block ore_sellafield_emerald;
public static Block geysir_water;
public static Block geysir_chlorine;
@ -783,8 +779,6 @@ public class ModBlocks {
public static Block capacitor_tantalium;
public static Block capacitor_schrabidate;
@Deprecated public static Block machine_coal_off;
@Deprecated public static Block machine_coal_on;
public static Block machine_wood_burner;
public static Block red_wire_coated;
@ -1035,10 +1029,7 @@ public class ModBlocks {
public static Block machine_deaerator;
public static final int guiID_machine_deaerator = 74;
public static Block machine_drill;
public static Block drill_pipe;
public static Block machine_excavator;
public static Block machine_autosaw;
public static Block machine_mining_laser;
@ -1260,8 +1251,6 @@ public class ModBlocks {
public static Block volcano_core;
public static Block dummy_block_drill;
public static Block dummy_port_drill;
public static Block dummy_block_ams_limiter;
public static Block dummy_port_ams_limiter;
public static Block dummy_block_ams_emitter;
@ -1778,12 +1767,8 @@ public class ModBlocks {
sellafield_slaked = new BlockSellafieldSlaked(Material.rock).setBlockName("sellafield_slaked").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_slaked");
sellafield = new BlockSellafield(Material.rock).setBlockName("sellafield").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_0");
/*sellafield_0 = new BlockHazard(Material.rock).setBlockName("sellafield_0").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_0");
sellafield_1 = new BlockHazard(Material.rock).setBlockName("sellafield_1").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_1");
sellafield_2 = new BlockHazard(Material.rock).setBlockName("sellafield_2").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_2");
sellafield_3 = new BlockHazard(Material.rock).setBlockName("sellafield_3").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_3");
sellafield_4 = new BlockHazard(Material.rock).setBlockName("sellafield_4").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_4");
sellafield_core = new BlockHazard(Material.rock).setBlockName("sellafield_core").setStepSound(Block.soundTypeStone).setHardness(10.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_core");*/
ore_sellafield_diamond = new BlockSellafieldOre(Material.rock).setBlockName("ore_sellafield_diamond").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":ore_overlay_diamond");
ore_sellafield_emerald = new BlockSellafieldOre(Material.rock).setBlockName("ore_sellafield_emerald").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":ore_overlay_emerald");
geysir_water = new BlockGeysir(Material.rock).setBlockName("geysir_water").setStepSound(Block.soundTypeStone).setHardness(5.0F);
geysir_chlorine = new BlockGeysir(Material.rock).setBlockName("geysir_chlorine").setStepSound(Block.soundTypeStone).setHardness(5.0F);
@ -1948,10 +1933,7 @@ public class ModBlocks {
capacitor_tantalium = new MachineCapacitor(Material.iron, 150_000_000L, "tantalium").setBlockName("capacitor_tantalium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_tantalium");
capacitor_schrabidate = new MachineCapacitor(Material.iron, 50_000_000_000L, "schrabidate").setBlockName("capacitor_schrabidate").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_schrabidate");
machine_coal_off = new MachineCoal(false).setBlockName("machine_coal_off").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_copper");
machine_coal_on = new MachineCoal(true).setBlockName("machine_coal_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_copper");
machine_wood_burner = new MachineWoodBurner(Material.iron).setBlockName("machine_wood_burner").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_diesel = new MachineDiesel().setBlockName("machine_diesel").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_combustion_engine = new MachineCombustionEngine().setBlockName("machine_combustion_engine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
@ -2295,9 +2277,7 @@ public class ModBlocks {
machine_catalytic_reformer = new MachineCatalyticReformer(Material.iron).setBlockName("machine_catalytic_reformer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_coker = new MachineCoker(Material.iron).setBlockName("machine_coker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_autosaw = new MachineAutosaw().setBlockName("machine_autosaw").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_drill = new MachineMiningDrill(Material.iron).setBlockName("machine_drill").setHardness(5.0F).setResistance(100.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":machine_drill");
machine_excavator = new MachineExcavator().setBlockName("machine_excavator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
drill_pipe = new BlockNoDrop(Material.iron).setBlockName("drill_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":drill_pipe");
machine_mining_laser = new MachineMiningLaser(Material.iron).setBlockName("machine_mining_laser").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_mining_laser");
barricade = new BlockNoDrop(Material.sand).setBlockName("barricade").setHardness(1.0F).setResistance(2.5F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":barricade");
machine_assembler = new MachineAssembler(Material.iron).setBlockName("machine_assembler").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_assembler");
@ -2446,8 +2426,6 @@ public class ModBlocks {
Fluid liquidConcrete = new GenericFluid("concrete_liquid").setViscosity(2000);
concrete_liquid = new GenericFiniteFluid(liquidConcrete, Material.rock, "concrete_liquid", "concrete_liquid_flowing").setQuantaPerBlock(4).setBlockName("concrete_liquid").setResistance(500F);
dummy_block_drill = new DummyBlockDrill(Material.iron, false).setBlockName("dummy_block_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
dummy_port_drill = new DummyBlockDrill(Material.iron, true).setBlockName("dummy_port_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
dummy_block_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_block_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
dummy_port_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_port_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
dummy_block_ams_emitter = new DummyBlockAMSEmitter(Material.iron).setBlockName("dummy_block_ams_emitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
@ -2975,7 +2953,9 @@ public class ModBlocks {
GameRegistry.registerBlock(impact_dirt, impact_dirt.getUnlocalizedName());
//RAD
GameRegistry.registerBlock(sellafield_slaked, sellafield_slaked.getUnlocalizedName());
register(sellafield_slaked);
register(ore_sellafield_diamond);
register(ore_sellafield_emerald);
GameRegistry.registerBlock(sellafield, ItemBlockNamedMeta.class, sellafield.getUnlocalizedName());
//Geysirs
@ -3184,8 +3164,6 @@ public class ModBlocks {
GameRegistry.registerBlock(machine_nuke_furnace_on, machine_nuke_furnace_on.getUnlocalizedName());
GameRegistry.registerBlock(machine_rtg_furnace_off, machine_rtg_furnace_off.getUnlocalizedName());
GameRegistry.registerBlock(machine_rtg_furnace_on, machine_rtg_furnace_on.getUnlocalizedName());
GameRegistry.registerBlock(machine_coal_off, machine_coal_off.getUnlocalizedName());
GameRegistry.registerBlock(machine_coal_on, machine_coal_on.getUnlocalizedName());
register(machine_wood_burner);
register(machine_diesel);
register(machine_selenium);
@ -3399,7 +3377,6 @@ public class ModBlocks {
register(machine_catalytic_cracker);
register(machine_catalytic_reformer);
register(machine_coker);
register(machine_drill);
register(machine_autosaw);
register(machine_excavator);
register(machine_mining_laser);
@ -3594,8 +3571,6 @@ public class ModBlocks {
//GameRegistry.registerBlock(concrete_liquid, concrete_liquid.getUnlocalizedName());
//Multiblock Dummy Blocks
GameRegistry.registerBlock(dummy_block_drill, dummy_block_drill.getUnlocalizedName());
GameRegistry.registerBlock(dummy_port_drill, dummy_port_drill.getUnlocalizedName());
GameRegistry.registerBlock(dummy_block_ams_limiter, dummy_block_ams_limiter.getUnlocalizedName());
GameRegistry.registerBlock(dummy_port_ams_limiter, dummy_port_ams_limiter.getUnlocalizedName());
GameRegistry.registerBlock(dummy_block_ams_emitter, dummy_block_ams_emitter.getUnlocalizedName());
@ -3614,7 +3589,6 @@ public class ModBlocks {
//Other Technical Blocks
GameRegistry.registerBlock(oil_pipe, oil_pipe.getUnlocalizedName());
GameRegistry.registerBlock(drill_pipe, drill_pipe.getUnlocalizedName());
GameRegistry.registerBlock(vent_chlorine, vent_chlorine.getUnlocalizedName());
GameRegistry.registerBlock(vent_cloud, vent_cloud.getUnlocalizedName());
GameRegistry.registerBlock(vent_pink_cloud, vent_pink_cloud.getUnlocalizedName());

View File

@ -124,7 +124,7 @@ public class BlockCrate extends BlockFalling {
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 9);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_reactor_breeding), 6);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off), 7);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_coal_off), 10);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_wood_burner), 10);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_diesel), 8);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_selenium), 7);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_rtg_grey), 4);
@ -134,7 +134,6 @@ public class BlockCrate extends BlockFalling {
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off), 8);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_assembler), 10);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_fluidtank), 7);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_drill), 4);
BlockCrate.addToListWithWeight(metalList, ModItems.centrifuge_element, 6);
BlockCrate.addToListWithWeight(metalList, ModItems.motor, 8);
BlockCrate.addToListWithWeight(metalList, ModItems.coil_tungsten, 7);

View File

@ -0,0 +1,93 @@
package com.hbm.blocks.generic;
import java.util.Random;
import com.hbm.blocks.IBlockMultiPass;
import com.hbm.blocks.ModBlocks;
import com.hbm.render.block.RenderBlockMultipass;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
public class BlockSellafieldOre extends BlockSellafieldSlaked implements IBlockMultiPass {
public BlockSellafieldOre(Material mat) {
super(mat);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister reg) {
this.blockIcon = reg.registerIcon(this.getTextureName());
super.registerBlockIcons(reg);
}
@Override
public int getRenderType() {
return IBlockMultiPass.getRenderType();
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
if(RenderBlockMultipass.currentPass == 1) return this.blockIcon;
return super.getIcon(world, x, y, z, side);
}
@Override
@SideOnly(Side.CLIENT)
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
if(RenderBlockMultipass.currentPass == 1) return 0xffffff;
return super.colorMultiplier(world, x, y, z);
}
@Override
public int getPasses() {
return 2;
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
if(this == ModBlocks.ore_sellafield_diamond) return Items.diamond;
if(this == ModBlocks.ore_sellafield_emerald) return Items.emerald;
return null;
}
@Override
public int quantityDropped(Random rand) {
return 1;
}
@Override
public int quantityDroppedWithBonus(int fortune, Random rand) {
if(fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped(0, rand, fortune)) {
int j = rand.nextInt(fortune + 2) - 1;
if(j < 0) j = 0;
return this.quantityDropped(rand) * (j + 1);
} else {
return this.quantityDropped(rand);
}
}
private Random rand = new Random();
@Override
public int getExpDrop(IBlockAccess world, int meta, int fortune) {
if(this.getItemDropped(meta, rand, fortune) != Item.getItemFromBlock(this)) {
int j1 = 0;
if(this == ModBlocks.ore_sellafield_diamond) j1 = MathHelper.getRandomIntegerInRange(rand, 3, 7);
if(this == ModBlocks.ore_sellafield_emerald) j1 = MathHelper.getRandomIntegerInRange(rand, 3, 7);
return j1;
}
return 0;
}
}

View File

@ -1,61 +0,0 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.ModBlocks;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityDummy;
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class DummyBlockDrill extends DummyOldBase {
public DummyBlockDrill(Material p_i45386_1_, boolean port) {
super(p_i45386_1_, port);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityDummy();
}
@Override
@SideOnly(Side.CLIENT)
public Item getItem(World world, int x, int y, int z)
{
return Item.getItemFromBlock(ModBlocks.machine_drill);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
return true;
} else if(!player.isSneaking())
{
TileEntity te = world.getTileEntity(x, y, z);
if(te != null && te instanceof TileEntityDummy) {
int a = ((TileEntityDummy)te).targetX;
int b = ((TileEntityDummy)te).targetY;
int c = ((TileEntityDummy)te).targetZ;
TileEntityMachineMiningDrill entity = (TileEntityMachineMiningDrill) world.getTileEntity(a, b, c);
if(entity != null)
{
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, a, b, c);
}
}
return true;
} else {
return false;
}
}
}

View File

@ -1,232 +0,0 @@
package com.hbm.blocks.machine;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.MultiblockHandler;
import com.hbm.interfaces.IMultiblock;
import com.hbm.tileentity.machine.TileEntityDummy;
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class MachineMiningDrill extends BlockContainer implements IMultiblock {
public MachineMiningDrill(Material p_i45386_1_) {
super(p_i45386_1_);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityMachineMiningDrill();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
return Item.getItemFromBlock(ModBlocks.machine_drill);
}
@Override
public int getRenderType() {
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@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;
if (i == 0) {
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.drillDimension)) {
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.drillDimension, ModBlocks.dummy_block_drill);
//
DummyBlockDrill.safeBreak = true;
world.setBlock(x + 1, y, z, ModBlocks.dummy_port_drill);
TileEntity te = world.getTileEntity(x + 1, y, z);
if(te instanceof TileEntityDummy) {
TileEntityDummy dummy = (TileEntityDummy)te;
dummy.targetX = x;
dummy.targetY = y;
dummy.targetZ = z;
}
world.setBlock(x - 1, y, z, ModBlocks.dummy_port_drill);
TileEntity te2 = world.getTileEntity(x - 1, y, z);
if(te instanceof TileEntityDummy) {
TileEntityDummy dummy = (TileEntityDummy)te2;
dummy.targetX = x;
dummy.targetY = y;
dummy.targetZ = z;
}
DummyBlockDrill.safeBreak = false;
//
} else
world.func_147480_a(x, y, z, true);
}
if (i == 1) {
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.drillDimension)) {
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.drillDimension, ModBlocks.dummy_block_drill);
//
DummyBlockDrill.safeBreak = true;
world.setBlock(x, y, z + 1, ModBlocks.dummy_port_drill);
TileEntity te = world.getTileEntity(x, y, z + 1);
if(te instanceof TileEntityDummy) {
TileEntityDummy dummy = (TileEntityDummy)te;
dummy.targetX = x;
dummy.targetY = y;
dummy.targetZ = z;
}
world.setBlock(x, y, z - 1, ModBlocks.dummy_port_drill);
TileEntity te2 = world.getTileEntity(x, y, z - 1);
if(te2 instanceof TileEntityDummy) {
TileEntityDummy dummy = (TileEntityDummy)te2;
dummy.targetX = x;
dummy.targetY = y;
dummy.targetZ = z;
}
DummyBlockDrill.safeBreak = false;
//
} else
world.func_147480_a(x, y, z, true);
}
if (i == 2) {
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.drillDimension)) {
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.drillDimension, ModBlocks.dummy_block_drill);
//
DummyBlockDrill.safeBreak = true;
world.setBlock(x + 1, y, z, ModBlocks.dummy_port_drill);
TileEntity te = world.getTileEntity(x + 1, y, z);
if(te instanceof TileEntityDummy) {
TileEntityDummy dummy = (TileEntityDummy)te;
dummy.targetX = x;
dummy.targetY = y;
dummy.targetZ = z;
}
world.setBlock(x - 1, y, z, ModBlocks.dummy_port_drill);
TileEntity te2 = world.getTileEntity(x - 1, y, z);
if(te instanceof TileEntityDummy) {
TileEntityDummy dummy = (TileEntityDummy)te2;
dummy.targetX = x;
dummy.targetY = y;
dummy.targetZ = z;
}
DummyBlockDrill.safeBreak = false;
//
} else
world.func_147480_a(x, y, z, true);
}
if (i == 3) {
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.drillDimension)) {
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.drillDimension, ModBlocks.dummy_block_drill);
//
DummyBlockDrill.safeBreak = true;
world.setBlock(x, y, z + 1, ModBlocks.dummy_port_drill);
TileEntity te = world.getTileEntity(x, y, z + 1);
if(te instanceof TileEntityDummy) {
TileEntityDummy dummy = (TileEntityDummy)te;
dummy.targetX = x;
dummy.targetY = y;
dummy.targetZ = z;
}
world.setBlock(x, y, z - 1, ModBlocks.dummy_port_drill);
TileEntity te2 = world.getTileEntity(x, y, z - 1);
if(te instanceof TileEntityDummy) {
TileEntityDummy dummy = (TileEntityDummy)te2;
dummy.targetX = x;
dummy.targetY = y;
dummy.targetZ = z;
}
DummyBlockDrill.safeBreak = false;
//
} else
world.func_147480_a(x, y, z, true);
}
}
private final Random field_149933_a = new Random();
private static boolean keepInventory;
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{
if (!keepInventory)
{
ISidedInventory tileentityfurnace = (ISidedInventory)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
if (tileentityfurnace != null)
{
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
{
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
if (itemstack != null)
{
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
while (itemstack.stackSize > 0)
{
int j1 = this.field_149933_a.nextInt(21) + 10;
if (j1 > itemstack.stackSize)
{
j1 = itemstack.stackSize;
}
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound())
{
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
}
float f3 = 0.05F;
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem);
}
}
}
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
}
}
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
}
}

View File

@ -75,8 +75,6 @@ public class FalloutConfigJSON {
entries.add(new FalloutEntry() .mB(Blocks.leaves2) .prim(new Triplet(ModBlocks.waste_leaves, 0, 1)) .min(woodEffectRange));
entries.add(new FalloutEntry().mB(Blocks.mossy_cobblestone).prim(new Triplet(Blocks.coal_ore, 0, 1)));
entries.add(new FalloutEntry().mB(Blocks.coal_ore).prim(new Triplet(Blocks.diamond_ore, 0, 3), new Triplet(Blocks.emerald_ore, 0, 2)).c(0.5));
entries.add(new FalloutEntry().mB(ModBlocks.ore_lignite).prim(new Triplet(Blocks.diamond_ore, 0, 1)).c(0.2));
entries.add(new FalloutEntry().mB(ModBlocks.ore_uranium).prim(new Triplet(ModBlocks.ore_schrabidium, 0, 1), new Triplet(ModBlocks.ore_uranium_scorched, 0, 99)));
entries.add(new FalloutEntry().mB(ModBlocks.ore_nether_uranium).prim(new Triplet(ModBlocks.ore_nether_schrabidium, 0, 1), new Triplet(ModBlocks.ore_nether_uranium_scorched, 0, 99)));
entries.add(new FalloutEntry().mB(ModBlocks.ore_gneiss_uranium).prim(new Triplet(ModBlocks.ore_gneiss_schrabidium, 0, 1), new Triplet(ModBlocks.ore_gneiss_uranium_scorched, 0, 99)));
@ -85,8 +83,11 @@ public class FalloutConfigJSON {
Block stone = Compat.tryLoadBlock(Compat.MOD_EF, "stone");
for(int i = 1; i <= 10; i++) {
entries.add(new FalloutEntry().prim(new Triplet(ModBlocks.ore_sellafield_diamond, 10 - i, 3), new Triplet(ModBlocks.ore_sellafield_emerald, 10 - i, 2)).c(0.5).max(i * 5).sol(true).mB(Blocks.coal_ore));
entries.add(new FalloutEntry().prim(new Triplet(ModBlocks.ore_sellafield_diamond, 10 - i, 1)).c(0.2).max(i * 5).sol(true).mB(ModBlocks.ore_lignite));
entries.add(new FalloutEntry().prim(new Triplet(ModBlocks.ore_sellafield_emerald, 10 - i, 1)).max(i * 5).sol(true).mB(ModBlocks.ore_beryllium));
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mMa(Material.rock));
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mB(Blocks.gravel));
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mMa(Material.sand));
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mMa(Material.ground));
if(i <= 9) entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mMa(Material.grass));
if(deepslate != null) entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mB(deepslate));

View File

@ -227,13 +227,13 @@ public class WorldConfig {
meteorShowerDuration = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "5.05_meteorShowerDuration", "Max duration of meteor shower in ticks", 20 * 60 * 30);
final String CATEGORY_BIOMES = CommonConfig.CATEGORY_BIOMES;
craterBiomeId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.B00_craterBiomeId", "The numeric ID for the crater biome", 80);
craterBiomeInnerId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.B01_craterBiomeInnerId", "The numeric ID for the inner crater biome", 81);
craterBiomeOuterId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.B02_craterBiomeOuterId", "The numeric ID for the outer crater biome", 82);
craterBiomeRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_METEOR, "17.R00_craterBiomeRad", "RAD/s for the crater biome", 0.5D);
craterBiomeInnerRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_METEOR, "17.R01_craterBiomeInnerRad", "RAD/s for the inner crater biome", 5D);
craterBiomeOuterRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_METEOR, "17.R02_craterBiomeOuterRad", "RAD/s for the outer crater biome", 25D);
craterBiomeWaterMult = (float) CommonConfig.createConfigDouble(config, CATEGORY_METEOR, "17.R03_craterBiomeWaterMult", "Multiplier for RAD/s in crater biomes when in water", 5D);
craterBiomeId = CommonConfig.createConfigInt(config, CATEGORY_BIOMES, "17.B00_craterBiomeId", "The numeric ID for the crater biome", 80);
craterBiomeInnerId = CommonConfig.createConfigInt(config, CATEGORY_BIOMES, "17.B01_craterBiomeInnerId", "The numeric ID for the inner crater biome", 81);
craterBiomeOuterId = CommonConfig.createConfigInt(config, CATEGORY_BIOMES, "17.B02_craterBiomeOuterId", "The numeric ID for the outer crater biome", 82);
craterBiomeRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_BIOMES, "17.R00_craterBiomeRad", "RAD/s for the crater biome", 5D);
craterBiomeInnerRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_BIOMES, "17.R01_craterBiomeInnerRad", "RAD/s for the inner crater biome", 25D);
craterBiomeOuterRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_BIOMES, "17.R02_craterBiomeOuterRad", "RAD/s for the outer crater biome", 0.5D);
craterBiomeWaterMult = (float) CommonConfig.createConfigDouble(config, CATEGORY_BIOMES, "17.R03_craterBiomeWaterMult", "Multiplier for RAD/s in crater biomes when in water", 5D);
radioStructure = CommonConfig.setDefZero(radioStructure, 1000);
antennaStructure = CommonConfig.setDefZero(antennaStructure, 1000);

View File

@ -117,7 +117,7 @@ public class EntityNukeTorex extends Entity {
// spawn condensation clouds
if(ticksExisted > 200 && ticksExisted < 600) {
for(int i = 0; i < 50; i++) {
for(int i = 0; i < 20; i++) {
for(int j = 0; j < 4; j++) {
float angle = (float) (Math.PI * 2 * rand.nextDouble());
Vec3 vec = Vec3.createVectorHelper(torusWidth + rollerSize * 3, 0, 0);
@ -131,7 +131,7 @@ public class EntityNukeTorex extends Entity {
}
if(ticksExisted > 300 && ticksExisted < 600) {
for(int i = 0; i < 50; i++) {
for(int i = 0; i < 20; i++) {
for(int j = 0; j < 4; j++) {
float angle = (float) (Math.PI * 2 * rand.nextDouble());
Vec3 vec = Vec3.createVectorHelper(torusWidth + rollerSize * 2, 0, 0);

View File

@ -1,116 +0,0 @@
package com.hbm.inventory.container;
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerMachineMiningDrill extends Container {
private TileEntityMachineMiningDrill nukeBoy;
private int warning;
public ContainerMachineMiningDrill(InventoryPlayer invPlayer, TileEntityMachineMiningDrill tedf) {
nukeBoy = tedf;
//Battery
this.addSlotToContainer(new Slot(tedf, 0, 44, 53));
//Outputs
this.addSlotToContainer(new Slot(tedf, 1, 80, 17));
this.addSlotToContainer(new Slot(tedf, 2, 98, 17));
this.addSlotToContainer(new Slot(tedf, 3, 116, 17));
this.addSlotToContainer(new Slot(tedf, 4, 80, 35));
this.addSlotToContainer(new Slot(tedf, 5, 98, 35));
this.addSlotToContainer(new Slot(tedf, 6, 116, 35));
this.addSlotToContainer(new Slot(tedf, 7, 80, 53));
this.addSlotToContainer(new Slot(tedf, 8, 98, 53));
this.addSlotToContainer(new Slot(tedf, 9, 116, 53));
//Upgrades
this.addSlotToContainer(new Slot(tedf, 10, 152, 17));
this.addSlotToContainer(new Slot(tedf, 11, 152, 35));
this.addSlotToContainer(new Slot(tedf, 12, 152, 53));
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, 84 + i * 18));
}
}
for(int i = 0; i < 9; i++)
{
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
}
this.detectAndSendChanges();
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
{
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack())
{
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (par2 <= 12) {
if (!this.mergeItemStack(var5, 13, this.inventorySlots.size(), true))
{
return null;
}
}
else if (!this.mergeItemStack(var5, 0, 13, false))
{
return null;
}
if (var5.stackSize == 0)
{
var4.putStack((ItemStack) null);
}
else
{
var4.onSlotChanged();
}
}
return var3;
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return nukeBoy.isUseableByPlayer(player);
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for(int i = 0; i < this.crafters.size(); i++) {
ICrafting par1 = (ICrafting) this.crafters.get(i);
if(this.warning != this.nukeBoy.warning) {
par1.sendProgressBarUpdate(this, 1, this.nukeBoy.warning);
}
}
this.warning = this.nukeBoy.warning;
}
@Override
public void updateProgressBar(int i, int j) {
if(i == 1) {
nukeBoy.warning = j;
}
}
}

View File

@ -1,69 +0,0 @@
package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerMachineMiningDrill;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
import com.hbm.util.I18nUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUIMachineMiningDrill extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_drill.png");
private TileEntityMachineMiningDrill diFurnace;
public GUIMachineMiningDrill(InventoryPlayer invPlayer, TileEntityMachineMiningDrill tedf) {
super(new ContainerMachineMiningDrill(invPlayer, tedf));
diFurnace = tedf;
this.xSize = 176;
this.ySize = 166;
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 69 - 52, 16, 52, diFurnace.power, diFurnace.maxPower);
String[] upgradeText = new String[4];
upgradeText[0] = I18nUtil.resolveKey("desc.gui.upgrade");
upgradeText[1] = I18nUtil.resolveKey("desc.gui.upgrade.speed");
upgradeText[2] = I18nUtil.resolveKey("desc.gui.upgrade.effectiveness");
upgradeText[3] = I18nUtil.resolveKey("desc.gui.upgrade.power");
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 141, guiTop + 39, 8, 8, guiLeft + 100, guiTop + 39 + 16 + 8, upgradeText);
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.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(diFurnace.power > 0) {
int i = (int)diFurnace.getPowerScaled(52);
drawTexturedModalRect(guiLeft + 8, guiTop + 69 - i, 176, 52 - i, 16, i);
}
int k = diFurnace.warning;
if(k == 2)
drawTexturedModalRect(guiLeft + 44, guiTop + 17, 192, 0, 16, 16);
if(k == 1)
drawTexturedModalRect(guiLeft + 44, guiTop + 17, 208, 0, 16, 16);
this.drawInfoPanel(guiLeft + 141, guiTop + 39, 8, 8, 8);
}
}

View File

@ -215,7 +215,7 @@ public class ItemStarterKit extends Item {
player.inventory.addItemStackToInventory(new ItemStack(ModItems.battery_lithium, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.battery_potato, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.screwdriver, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_coal_off, 3));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_excavator, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_diesel, 2));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_selenium, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.red_cable, 64));

View File

@ -223,7 +223,6 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineGasFlare.class, new RenderGasFlare());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChimneyBrick.class, new RenderChimneyBrick());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChimneyIndustrial.class, new RenderChimneyIndustrial());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineMiningDrill.class, new RenderMiningDrill());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineMiningLaser.class, new RenderLaserMiner());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineAssembler.class, new RenderAssembler());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineAssemfac.class, new RenderAssemfac());

View File

@ -1194,6 +1194,12 @@ public class MainRegistry {
ignoreMappings.add("hbm:item.bolt_dura_steel");
ignoreMappings.add("hbm:tile.rail_large_curve_wide");
ignoreMappings.add("hbm:tile.nuke_n45");
ignoreMappings.add("hbm:tile.machine_coal_off");
ignoreMappings.add("hbm:tile.machine_coal_on");
ignoreMappings.add("hbm:tile.machine_drill");
ignoreMappings.add("hbm:tile.drill_pipe");
ignoreMappings.add("hbm:tile.dummy_block_drill");
ignoreMappings.add("hbm:tile.dummy_port_drill");
/// REMAP ///
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);

View File

@ -88,7 +88,6 @@ public class NEIConfig implements IConfigureNEI {
API.hideItem(ItemBattery.getEmptyBattery(ModItems.memory));
API.hideItem(ItemBattery.getFullBattery(ModItems.memory));
API.hideItem(new ItemStack(ModBlocks.machine_coal_on));
API.hideItem(new ItemStack(ModBlocks.machine_electric_furnace_on));
API.hideItem(new ItemStack(ModBlocks.machine_difurnace_on));
API.hideItem(new ItemStack(ModBlocks.machine_nuke_furnace_on));
@ -110,7 +109,6 @@ public class NEIConfig implements IConfigureNEI {
API.hideItem(new ItemStack(ModItems.burnt_bark));
API.hideItem(new ItemStack(ModItems.ams_core_thingy));
}
API.hideItem(new ItemStack(ModBlocks.dummy_block_drill));
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_base));
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_emitter));
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_limiter));
@ -118,7 +116,6 @@ public class NEIConfig implements IConfigureNEI {
API.hideItem(new ItemStack(ModBlocks.dummy_block_blast));
API.hideItem(new ItemStack(ModBlocks.dummy_block_uf6));
API.hideItem(new ItemStack(ModBlocks.dummy_block_puf6));
API.hideItem(new ItemStack(ModBlocks.dummy_port_drill));
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_base));
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_emitter));
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_limiter));

View File

@ -54,18 +54,6 @@ public class LoopedSoundPacket implements IMessage {
@SideOnly(Side.CLIENT)
public IMessage onMessage(LoopedSoundPacket m, MessageContext ctx) {
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
if (te != null && te instanceof TileEntityMachineMiningDrill) {
boolean flag = true;
for(int i = 0; i < SoundLoopMiner.list.size(); i++) {
if(SoundLoopMiner.list.get(i).getTE() == te && !SoundLoopMiner.list.get(i).isDonePlaying())
flag = false;
}
if(flag && te.getWorldObj().isRemote && ((TileEntityMachineMiningDrill)te).torque > 0.2F)
Minecraft.getMinecraft().getSoundHandler().playSound(new SoundLoopMiner(new ResourceLocation("hbm:block.minerOperate"), te));
}
if (te != null && te instanceof TileEntityMachineAssembler) {

View File

@ -17,8 +17,6 @@ public class PacketDispatcher {
//Machine type for marker rendering
wrapper.registerMessage(TEStructurePacket.Handler.class, TEStructurePacket.class, i++, Side.CLIENT);
//Mining drill rotation for rendering
wrapper.registerMessage(TEDrillPacket.Handler.class, TEDrillPacket.class, i++, Side.CLIENT);
//Fluid packet for GUI
wrapper.registerMessage(TEFluidPacket.Handler.class, TEFluidPacket.class, i++, Side.CLIENT);
//Sound packet that keeps client and server separated

View File

@ -1,67 +0,0 @@
package com.hbm.packet;
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.tileentity.TileEntity;
public class TEDrillPacket implements IMessage {
int x;
int y;
int z;
float spin;
float torque;
public TEDrillPacket()
{
}
public TEDrillPacket(int x, int y, int z, float spin, float torque)
{
this.x = x;
this.y = y;
this.z = z;
this.spin = spin;
this.torque = torque;
}
@Override
public void fromBytes(ByteBuf buf) {
x = buf.readInt();
y = buf.readInt();
z = buf.readInt();
spin = buf.readFloat();
torque = buf.readFloat();
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(x);
buf.writeInt(y);
buf.writeInt(z);
buf.writeFloat(spin);
buf.writeFloat(torque);
}
public static class Handler implements IMessageHandler<TEDrillPacket, IMessage> {
@Override
public IMessage onMessage(TEDrillPacket m, MessageContext ctx) {
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
if (te != null && te instanceof TileEntityMachineMiningDrill) {
TileEntityMachineMiningDrill gen = (TileEntityMachineMiningDrill) te;
gen.rotation = m.spin;
gen.torque = m.torque;
}
return null;
}
}
}

View File

@ -322,19 +322,6 @@ public class ItemRenderLibrary {
GL11.glShadeModel(GL11.GL_FLAT);
}});
renderers.put(Item.getItemFromBlock(ModBlocks.machine_drill), new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -2, 0);
GL11.glScaled(3, 3, 3);
}
public void renderCommon() {
GL11.glRotated(180, 0, 1, 0);
GL11.glDisable(GL11.GL_CULL_FACE);
bindTexture(ResourceManager.drill_body_tex); ResourceManager.drill_body.renderAll();
bindTexture(ResourceManager.drill_bolt_tex); ResourceManager.drill_bolt.renderAll();
GL11.glEnable(GL11.GL_CULL_FACE);
}});
renderers.put(Item.getItemFromBlock(ModBlocks.machine_mining_laser), new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -0.5, 0);

View File

@ -1,68 +0,0 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderMiningDrill extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
switch(tileEntity.getBlockMetadata())
{
case 2:
GL11.glRotatef(180, 0F, 1F, 0F); break;
case 4:
GL11.glRotatef(270, 0F, 1F, 0F); break;
case 3:
GL11.glRotatef(0, 0F, 1F, 0F); break;
case 5:
GL11.glRotatef(90, 0F, 1F, 0F); break;
}
bindTexture(ResourceManager.drill_body_tex);
ResourceManager.drill_body.renderAll();
GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
switch(tileEntity.getBlockMetadata())
{
case 2:
GL11.glRotatef(90, 0F, 1F, 0F); break;
case 4:
GL11.glRotatef(180, 0F, 1F, 0F); break;
case 3:
GL11.glRotatef(270, 0F, 1F, 0F); break;
case 5:
GL11.glRotatef(0, 0F, 1F, 0F); break;
}
GL11.glRotatef(((TileEntityMachineMiningDrill)tileEntity).rotation, 0F, 1F, 0F);
bindTexture(ResourceManager.drill_bolt_tex);
ResourceManager.drill_bolt.renderAll();
GL11.glPopMatrix();
}
}

View File

@ -1,39 +0,0 @@
package com.hbm.sound;
import java.util.ArrayList;
import java.util.List;
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
public class SoundLoopMiner extends SoundLoopMachine {
public static List<SoundLoopMiner> list = new ArrayList<SoundLoopMiner>();
public SoundLoopMiner(ResourceLocation path, TileEntity te) {
super(path, te);
list.add(this);
}
@Override
public void update() {
super.update();
if(te instanceof TileEntityMachineMiningDrill) {
TileEntityMachineMiningDrill drill = (TileEntityMachineMiningDrill)te;
if(this.volume != 3)
volume = 3;
if(drill.torque <= 0.5F)
this.donePlaying = true;
}
}
public TileEntity getTE() {
return te;
}
}

View File

@ -95,7 +95,6 @@ public class TileMappings {
put(TileEntityMachineExposureChamber.class, "tileentity_exposure_chamber");
put(TileEntityMachineRTG.class, "tileentity_machine_rtg");
put(TileEntityStructureMarker.class, "tileentity_structure_marker");
put(TileEntityMachineMiningDrill.class, "tileentity_mining_drill");
put(TileEntityMachineExcavator.class, "tileentity_ntm_excavator");
put(TileEntityFluidDuctSimple.class, "tileentity_universal_duct_simple");
put(TileEntityFluidDuct.class, "tileentity_universal_duct");

View File

@ -1,495 +0,0 @@
package com.hbm.tileentity.machine;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.UpgradeManager;
import com.hbm.inventory.container.ContainerMachineMiningDrill;
import com.hbm.inventory.gui.GUIMachineMiningDrill;
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
import com.hbm.lib.Library;
import com.hbm.packet.AuxElectricityPacket;
import com.hbm.packet.LoopedSoundPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.TEDrillPacket;
import com.hbm.sound.SoundLoopMachine;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
import api.hbm.block.IDrillInteraction;
import api.hbm.block.IMiningDrill;
import api.hbm.energy.IBatteryItem;
import api.hbm.energy.IEnergyUser;
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.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
public class TileEntityMachineMiningDrill extends TileEntityMachineBase implements IEnergyUser, IMiningDrill, IGUIProvider {
public long power;
public int warning;
public static final long maxPower = 100000;
int age = 0;
int timer = 50;
int radius = 100;
int consumption = 100;
int fortune = 0;
boolean flag = true;
public float torque;
public float rotation;
SoundLoopMachine sound;
public TileEntityMachineMiningDrill() {
super(13);
}
@Override
public String getName() {
return "container.miningDrill";
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
if(i == 0)
if(itemStack.getItem() instanceof IBatteryItem)
return true;
if(i == 1)
return true;
return false;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.power = nbt.getLong("power");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setLong("power", power);
}
public long getPowerScaled(long i) {
return (power * i) / maxPower;
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
this.updateConnections();
this.consumption = 100;
this.timer = 50;
this.radius = 1;
this.fortune = 0;
UpgradeManager.eval(slots, 10, 12);
this.radius += Math.min(UpgradeManager.getLevel(UpgradeType.EFFECT), 3);
this.consumption += Math.min(UpgradeManager.getLevel(UpgradeType.EFFECT), 3) * 80;
this.timer -= Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3) * 15;
this.consumption += Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3) * 300;
this.consumption -= Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3) * 30;
this.timer += Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3) * 5;
this.fortune += Math.min(UpgradeManager.getLevel(UpgradeType.FORTUNE), 3);
this.timer += Math.min(UpgradeManager.getLevel(UpgradeType.FORTUNE), 3) * 15;
age++;
if(age >= timer)
age -= timer;
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
if(power >= consumption) {
//operation start
if(age == timer - 1) {
warning = 0;
//warning 0, green: drill is operational
//warning 1, red: drill is full, has no power or the drill is jammed
//warning 2, yellow: drill has reached max depth
for(int i = this.yCoord - 1; i > this.yCoord - 1 - 100; i--) {
if(i <= 3) {
//Code 2: The drilling ended
warning = 2;
break;
}
if(worldObj.getBlock(xCoord, i, zCoord) != ModBlocks.drill_pipe) {
if(worldObj.getBlock(xCoord, i, zCoord).isReplaceable(worldObj, xCoord, i, zCoord) || this.tryDrill(xCoord, i, zCoord)) {
if(worldObj.getBlock(xCoord, i, zCoord).isReplaceable(worldObj, xCoord, i, zCoord)) {
worldObj.setBlock(xCoord, i, zCoord, ModBlocks.drill_pipe);
}
break;
} else {
this.warning = 1;
break;
}
}
if(this.drill(xCoord, i, zCoord, radius))
break;
}
}
//operation end
power -= consumption;
} else {
warning = 1;
}
int meta = worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
TileEntity te = null;
if(meta == 2) {
te = worldObj.getTileEntity(xCoord - 2, yCoord, zCoord);
//worldObj.setBlock(xCoord - 2, yCoord, zCoord, Blocks.dirt);
}
if(meta == 3) {
te = worldObj.getTileEntity(xCoord + 2, yCoord, zCoord);
//worldObj.setBlock(xCoord - 2, yCoord, zCoord, Blocks.dirt);
}
if(meta == 4) {
te = worldObj.getTileEntity(xCoord, yCoord, zCoord + 2);
//worldObj.setBlock(xCoord - 2, yCoord, zCoord, Blocks.dirt);
}
if(meta == 5) {
te = worldObj.getTileEntity(xCoord, yCoord, zCoord - 2);
//worldObj.setBlock(xCoord - 2, yCoord, zCoord, Blocks.dirt);
}
if(te != null && te instanceof IInventory) {
IInventory chest = (IInventory)te;
for(int i = 1; i < 10; i++)
if(tryFillContainer(chest, i))
break;
}
if(warning == 0) {
torque += 0.1;
if(torque > (100/timer))
torque = (100/timer);
} else {
torque -= 0.1F;
if(torque < -(100/timer))
torque = -(100/timer);
}
if(torque < 0) {
torque = 0;
}
rotation += torque;
if(rotation >= 360)
rotation -= 360;
PacketDispatcher.wrapper.sendToAllAround(new TEDrillPacket(xCoord, yCoord, zCoord, rotation, torque), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 150));
PacketDispatcher.wrapper.sendToAllAround(new LoopedSoundPacket(xCoord, yCoord, zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
}
}
private void updateConnections() {
this.getBlockMetadata();
if(this.blockMetadata == 5 || this.blockMetadata == 4) {
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord, Library.POS_X);
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord, Library.NEG_X);
} else if(this.blockMetadata == 3 || this.blockMetadata == 2) {
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 2, Library.POS_Z);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 2, Library.NEG_Z);
}
}
public boolean tryFillContainer(IInventory inventory, int slot) {
int size = inventory.getSizeInventory();
for(int i = 0; i < size; i++) {
if(inventory.getStackInSlot(i) != null) {
if(slots[slot] == null)
return false;
ItemStack sta1 = inventory.getStackInSlot(i).copy();
ItemStack sta2 = slots[slot].copy();
if(!inventory.isItemValidForSlot(i, sta2))
continue;
if(sta1 != null && sta2 != null) {
sta1.stackSize = 1;
sta2.stackSize = 1;
if(ItemStack.areItemStacksEqual(sta1, sta2) && ItemStack.areItemStackTagsEqual(sta1, sta2) && inventory.getStackInSlot(i).stackSize < inventory.getStackInSlot(i).getMaxStackSize()) {
slots[slot].stackSize--;
if(slots[slot].stackSize <= 0)
slots[slot] = null;
ItemStack sta3 = inventory.getStackInSlot(i).copy();
sta3.stackSize++;
inventory.setInventorySlotContents(i, sta3);
return true;
}
}
}
}
for(int i = 0; i < size; i++) {
if(slots[slot] == null)
return false;
ItemStack sta2 = slots[slot].copy();
if(!inventory.isItemValidForSlot(i, sta2))
continue;
if(inventory.getStackInSlot(i) == null && sta2 != null) {
sta2.stackSize = 1;
slots[slot].stackSize--;
if(slots[slot].stackSize <= 0)
slots[slot] = null;
inventory.setInventorySlotContents(i, sta2);
return true;
}
}
return false;
}
//Method: isOre
//"make it oreo!"
//"ok"
public boolean isOreo(int x, int y, int z) {
Block b = worldObj.getBlock(x, y, z);
float hardness = b.getBlockHardness(worldObj, x, y, z);
return hardness < 70 && hardness >= 0;
}
public boolean isMinableOreo(int x, int y, int z) {
Block b = worldObj.getBlock(x, y, z);
float hardness = b.getBlockHardness(worldObj, x, y, z);
return (hardness < 70 && hardness >= 0) || b instanceof IDrillInteraction;
}
/**
* returns true if there has been a successful mining operation
* returns false if no block could be mined and the drill is ready to extend
* */
public boolean drill(int x, int y, int z, int rad) {
if(!flag)
return false;
for(int ix = x - rad; ix <= x + rad; ix++) {
for(int iz = z - rad; iz <= z + rad; iz++) {
if(ix != x || iz != z)
if(tryDrill(ix, y, iz))
return true;
}
}
return false;
}
/**
* returns true if there has been a successful mining operation
* returns false if no block could be mined, as it is either air or unmineable
* */
public boolean tryDrill(int x, int y, int z) {
if(worldObj.getBlock(x, y, z).isAir(worldObj, x, y, z) || !isMinableOreo(x, y, z))
return false;
if(worldObj.getBlock(x, y, z).getMaterial().isLiquid()) {
worldObj.func_147480_a(x, y, z, false);
return false;
}
Block b = worldObj.getBlock(x, y, z);
int meta = worldObj.getBlockMetadata(x, y, z);
if(b instanceof IDrillInteraction) {
IDrillInteraction in = (IDrillInteraction) b;
ItemStack sta = in.extractResource(worldObj, x, y, z, meta, this);
if(sta != null && hasSpace(sta)) {
this.addItemToInventory(sta);
}
if(!in.canBreak(worldObj, x, y, z, meta, this))
return true; //true because the block is still there and mining should continue
}
ItemStack stack = new ItemStack(b.getItemDropped(meta, worldObj.rand, fortune), b.quantityDropped(meta, fortune, worldObj.rand), b.damageDropped(meta));
//yup that worked
if(stack != null && stack.getItem() == null) {
worldObj.func_147480_a(x, y, z, false);
return true;
}
if(hasSpace(stack)) {
this.addItemToInventory(stack);
worldObj.func_147480_a(x, y, z, false);
return true;
}
return true;
}
public boolean hasSpace(ItemStack stack) {
ItemStack st = stack.copy();
if(st == null)
return true;
for(int i = 1; i < 10; i++) {
if(slots[i] == null)
return true;
}
st.stackSize = 1;
ItemStack[] fakeArray = slots.clone();
boolean flag = true;
for(int i = 0; i < stack.stackSize; i++) {
if(!canAddItemToArray(st, fakeArray))
flag = false;
}
return flag;
}
public void addItemToInventory(ItemStack stack) {
ItemStack st = stack.copy();
if(st == null)
return;
int size = st.stackSize;
st.stackSize = 1;
for(int i = 0; i < size; i++)
canAddItemToArray(st, this.slots);
}
public boolean canAddItemToArray(ItemStack stack, ItemStack[] array) {
ItemStack st = stack.copy();
if(stack == null || st == null)
return true;
for(int i = 1; i < 10; i++) {
if(array[i] != null) {
ItemStack sta = array[i].copy();
if(stack == null || st == null)
return true;
if(sta != null && sta.getItem() == st.getItem() && sta.stackSize < st.getMaxStackSize()) {
array[i].stackSize++;
return true;
}
}
}
for(int i = 1; i < 10; i++) {
if(array[i] == null) {
array[i] = stack.copy();
return true;
}
}
return false;
}
@Override
public void setPower(long i) {
power = i;
}
@Override
public long getPower() {
return power;
}
@Override
public long getMaxPower() {
return maxPower;
}
@Override
public AxisAlignedBB getRenderBoundingBox() {
return TileEntity.INFINITE_EXTENT_AABB;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared()
{
return 65536.0D;
}
@Override
public DrillType getDrillTier() {
return DrillType.INDUSTRIAL;
}
@Override
public int getDrillRating() {
return 50;
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new ContainerMachineMiningDrill(player.inventory, this);
}
@Override
@SideOnly(Side.CLIENT)
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new GUIMachineMiningDrill(player.inventory, this);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B