hadron overhaul, slight fixes, recipe adjustments

This commit is contained in:
Bob 2021-03-14 21:09:23 +01:00
parent ec3fe28feb
commit ed34a5b26a
24 changed files with 585 additions and 242 deletions

View File

@ -41,6 +41,8 @@ public class ModBlocks {
public static Block obj_tester;
public static Block test_ticker;
public static Block test_missile;
public static Block test_core;
public static Block test_charge;
public static Block ore_uranium;
public static Block ore_uranium_scorched;
@ -481,10 +483,19 @@ public class ModBlocks {
public static Block hadron_plating_voltz;
public static Block hadron_plating_glass;
public static Block hadron_coil_alloy;
public static Block hadron_coil_gold;
public static Block hadron_coil_neodymium;
public static Block hadron_coil_magtung;
public static Block hadron_coil_schrabidium;
public static Block hadron_coil_schrabidate;
public static Block hadron_coil_starmetal;
public static Block hadron_coil_chlorophyte;
public static Block hadron_coil_mese;
public static Block hadron_power;
public static Block hadron_power_10m;
public static Block hadron_power_100m;
public static Block hadron_power_1g;
public static Block hadron_power_10g;
public static Block hadron_diode;
public static Block hadron_analysis;
public static Block hadron_analysis_glass;
@ -925,15 +936,14 @@ public class ModBlocks {
test_container = new TestContainer(0).setBlockName("test_container").setCreativeTab(null);
test_bomb = new TestBomb(Material.tnt).setBlockName("test_bomb").setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":test_bomb");
test_bomb_advanced = new TestBombAdvanced(Material.tnt).setBlockName("test_bomb_advanced").setCreativeTab(null);
test_nuke = new TestNuke(Material.iron).setBlockName("test_nuke").setCreativeTab(null).setHardness(2.5F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":test_nuke");
event_tester = new TestEventTester(Material.iron).setBlockName("event_tester").setCreativeTab(null).setHardness(2.5F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":event_tester");
rotation_tester = new TestRotationTester(Material.iron).setBlockName("rotation_tester").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F);
obj_tester = new TestObjTester(Material.iron).setBlockName("obj_tester").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F);
test_ticker = new TestTicker(Material.iron).setBlockName("test_ticker").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":test_ticker");
test_missile = new TestMissile(Material.iron).setBlockName("test_missile").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":test_missile");
test_core = new TestCore(Material.iron).setBlockName("test_core").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":test_core");
test_charge = new TestCharge(Material.iron).setBlockName("test_charge").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F);
ore_uranium = new BlockOutgas(Material.rock, true, 5, false).setBlockName("ore_uranium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_uranium");
ore_uranium_scorched = new BlockOutgas(Material.rock, true, 5, false).setBlockName("ore_uranium_scorched").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_uranium_scorched");
@ -1012,7 +1022,7 @@ public class ModBlocks {
block_polonium = new BlockOre(Material.iron, 30F, 300F).setBlockName("block_polonium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_polonium");
block_mox_fuel = new BlockOre(Material.iron, 15F, 150F).setBlockName("block_mox_fuel").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_mox_fuel");
block_plutonium = new BlockOre(Material.iron, 15F, 150F).setBlockName("block_plutonium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_plutonium");
block_pu238 = new BlockOre(Material.iron, 0.1F, 1.5F).setBlockName("block_pu238").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_pu238");
block_pu238 = new BlockOre(Material.iron, 0.1F, 1.5F).setBlockName("block_pu238").setCreativeTab(MainRegistry.blockTab).setLightLevel(5F/15F).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_pu238");
block_pu239 = new BlockOre(Material.iron, 15F, 150F).setBlockName("block_pu239").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_pu239");
block_pu240 = new BlockOre(Material.iron, 10F, 100F).setBlockName("block_pu240").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_pu240");
block_pu_mix = new BlockOre(Material.iron, 10F, 100F).setBlockName("block_pu_mix").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_pu_mix");
@ -1280,11 +1290,20 @@ public class ModBlocks {
hadron_plating_striped = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_striped").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_striped");
hadron_plating_voltz = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_voltz").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_voltz");
hadron_plating_glass = new BlockNTMGlass(0, RefStrings.MODID + ":hadron_plating_glass", Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_glass").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_glass");
hadron_coil_alloy = new BlockHadronCoil(Material.iron, 1).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_alloy").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_alloy");
hadron_coil_schrabidium = new BlockHadronCoil(Material.iron, 3).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_schrabidium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_schrabidium");
hadron_coil_starmetal = new BlockHadronCoil(Material.iron, 10).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_starmetal").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_starmetal");
hadron_coil_mese = new BlockHadronCoil(Material.iron, 25).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_mese").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_mese");
hadron_power = new BlockHadronPower(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_power").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_power");
hadron_coil_alloy = new BlockHadronCoil(Material.iron, 10).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_alloy").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_alloy");
hadron_coil_gold = new BlockHadronCoil(Material.iron, 25).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_gold").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_gold");
hadron_coil_neodymium = new BlockHadronCoil(Material.iron, 50).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_neodymium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_neodymium");
hadron_coil_magtung = new BlockHadronCoil(Material.iron, 100).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_magtung").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_magtung");
hadron_coil_schrabidium = new BlockHadronCoil(Material.iron, 250).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_schrabidium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_schrabidium");
hadron_coil_schrabidate = new BlockHadronCoil(Material.iron, 500).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_schrabidate").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_schrabidate");
hadron_coil_starmetal = new BlockHadronCoil(Material.iron, 1000).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_starmetal").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_starmetal");
hadron_coil_chlorophyte = new BlockHadronCoil(Material.iron, 2500).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_chlorophyte").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_chlorophyte");
hadron_coil_mese = new BlockHadronCoil(Material.iron, 10000).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_mese").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_mese");
hadron_power = new BlockHadronPower(Material.iron, 1000000L).setStepSound(Block.soundTypeMetal).setBlockName("hadron_power").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_power");
hadron_power_10m = new BlockHadronPower(Material.iron, 10000000L).setStepSound(Block.soundTypeMetal).setBlockName("hadron_power_10m").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_power");
hadron_power_100m = new BlockHadronPower(Material.iron, 100000000L).setStepSound(Block.soundTypeMetal).setBlockName("hadron_power_100m").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_power");
hadron_power_1g = new BlockHadronPower(Material.iron, 1000000000L).setStepSound(Block.soundTypeMetal).setBlockName("hadron_power_1g").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_power");
hadron_power_10g = new BlockHadronPower(Material.iron, 10000000000L).setStepSound(Block.soundTypeMetal).setBlockName("hadron_power_10g").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_power");
hadron_diode = new BlockHadronDiode(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_diode").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
hadron_analysis = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_analysis").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_analysis");
hadron_analysis_glass = new BlockNTMGlass(0, RefStrings.MODID + ":hadron_analysis_glass", Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_analysis_glass").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_analysis_glass");
@ -1672,6 +1691,8 @@ public class ModBlocks {
GameRegistry.registerBlock(obj_tester, obj_tester.getUnlocalizedName());
GameRegistry.registerBlock(test_ticker, test_ticker.getUnlocalizedName());
GameRegistry.registerBlock(test_missile, test_missile.getUnlocalizedName());
GameRegistry.registerBlock(test_core, test_core.getUnlocalizedName());
GameRegistry.registerBlock(test_charge, test_charge.getUnlocalizedName());
//Ores
GameRegistry.registerBlock(ore_uranium, ore_uranium.getUnlocalizedName());
@ -2108,10 +2129,19 @@ public class ModBlocks {
GameRegistry.registerBlock(hadron_plating_glass, hadron_plating_glass.getUnlocalizedName());
GameRegistry.registerBlock(hadron_plating_voltz, hadron_plating_voltz.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_alloy, ItemHadronCoil.class, hadron_coil_alloy.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_gold, ItemHadronCoil.class, hadron_coil_gold.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_neodymium, ItemHadronCoil.class, hadron_coil_neodymium.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_magtung, ItemHadronCoil.class, hadron_coil_magtung.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_schrabidium, ItemHadronCoil.class, hadron_coil_schrabidium.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_schrabidate, ItemHadronCoil.class, hadron_coil_schrabidate.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_starmetal, ItemHadronCoil.class, hadron_coil_starmetal.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_chlorophyte, ItemHadronCoil.class, hadron_coil_chlorophyte.getUnlocalizedName());
GameRegistry.registerBlock(hadron_coil_mese, ItemHadronCoil.class, hadron_coil_mese.getUnlocalizedName());
GameRegistry.registerBlock(hadron_power, hadron_power.getUnlocalizedName());
GameRegistry.registerBlock(hadron_power_10m, hadron_power_10m.getUnlocalizedName());
GameRegistry.registerBlock(hadron_power_100m, hadron_power_100m.getUnlocalizedName());
GameRegistry.registerBlock(hadron_power_1g, hadron_power_1g.getUnlocalizedName());
GameRegistry.registerBlock(hadron_power_10g, hadron_power_10g.getUnlocalizedName());
GameRegistry.registerBlock(hadron_diode, hadron_diode.getUnlocalizedName());
GameRegistry.registerBlock(hadron_analysis, hadron_analysis.getUnlocalizedName());
GameRegistry.registerBlock(hadron_analysis_glass, hadron_analysis_glass.getUnlocalizedName());

View File

@ -8,9 +8,12 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class BlockHadronPower extends BlockContainer {
public long power;
public BlockHadronPower(Material mat) {
public BlockHadronPower(Material mat, long power) {
super(mat);
this.power = power;
}
@Override

View File

@ -0,0 +1,118 @@
package com.hbm.blocks.test;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Facing;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class TestCharge extends Block {
@SideOnly(Side.CLIENT)
private IIcon bottomIcon;
@SideOnly(Side.CLIENT)
private IIcon topIcon;
public TestCharge(Material mat) {
super(mat);
}
@Override
public int getRenderType() {
return 16;
}
@Override
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
int l = determineOrientation(p_149689_1_, p_149689_2_, p_149689_3_, p_149689_4_, p_149689_5_);
p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, l, 2);
}
public static int determineOrientation(World p_150071_0_, int p_150071_1_, int p_150071_2_, int p_150071_3_, EntityLivingBase p_150071_4_) {
//instead of mirrored piston behavior, we could just scan for nearby cores and adjust it accordingly
if(MathHelper.abs((float) p_150071_4_.posX - (float) p_150071_1_) < 2.0F && MathHelper.abs((float) p_150071_4_.posZ - (float) p_150071_3_) < 2.0F) {
double d0 = p_150071_4_.posY + 1.82D - (double) p_150071_4_.yOffset;
if(d0 - (double) p_150071_2_ > 2.0D) {
return 0;
}
if((double) p_150071_2_ - d0 > 0.0D) {
return 1;
}
}
int l = MathHelper.floor_double((double) (p_150071_4_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
return l == 0 ? 3 : (l == 1 ? 4 : (l == 2 ? 2 : (l == 3 ? 5 : 1)));
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_) {
this.blockIcon = p_149651_1_.registerIcon(RefStrings.MODID + ":test_charge_side");
this.topIcon = p_149651_1_.registerIcon(RefStrings.MODID + ":test_charge_top");
this.bottomIcon = p_149651_1_.registerIcon(RefStrings.MODID + ":test_charge_bottom");
}
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
int k = getPistonOrientation(p_149691_2_);
return k > 5 ? this.topIcon : (p_149691_1_ == k ? this.topIcon : (p_149691_1_ == Facing.oppositeSide[k] ? this.bottomIcon : this.blockIcon));
}
public static int getPistonOrientation(int p_150076_0_) {
return p_150076_0_ & 7;
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
//instead of exploding outright, we schedule an update. this will let redstone lines transmit signals
//even if they are on top of the charge which would get destroyed, allowing for more compact designs
if(!world.isRemote && world.isBlockIndirectlyGettingPowered(x, y, z)) {
world.scheduledUpdatesAreImmediate = false;
world.scheduleBlockUpdate(x, y, z, this, 1);
}
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if(!world.isRemote) {
ForgeDirection dir = ForgeDirection.getOrientation(getPistonOrientation(world.getBlockMetadata(x, y, z)));
//is our target a core?
if(world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) == ModBlocks.test_core) {
//increment meta, schedule an update and set to air
world.setBlock(x, y, z, Blocks.air);
int core = world.getBlockMetadata(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
//this should be false by default and only true for special world gen, but some mods tend to leak immediate updates
world.scheduledUpdatesAreImmediate = false;
world.setBlockMetadataWithNotify(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, core + 1, 4); //flag 4 causes no block update and no re-render on clients
world.scheduleBlockUpdate(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, ModBlocks.test_core, 1); //set delay to 2 if 1 isn't enough
//if not, just explode, who cares
} else {
world.newExplosion(null, x + 0.5, y + 0.5, z + 0.5, 5.0F, false, true);
}
}
}
}

View File

@ -0,0 +1,43 @@
package com.hbm.blocks.test;
import java.util.Random;
import com.hbm.config.BombConfig;
import com.hbm.entity.effect.EntityNukeCloudSmall;
import com.hbm.entity.logic.EntityNukeExplosionMK4;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
public class TestCore extends Block {
public TestCore(Material mat) {
super(mat);
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if(!world.isRemote) {
int meta = world.getBlockMetadata(x, y, z);
if(meta >= 6) {
world.setBlockToAir(x, y, z);
world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, BombConfig.missileRadius, x + 0.5, y + 0.5, z + 0.5));
EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, BombConfig.missileRadius * 0.005F);
entity2.posX = x;
entity2.posY = y;
entity2.posZ = z;
world.spawnEntityInWorld(entity2);
} else if(meta > 0) {
world.newExplosion(null, x + 0.5, y + 0.5, z + 0.5, 5.0F, false, true);
}
}
}
}

View File

@ -144,6 +144,7 @@ public class WeaponRecipes {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_minigun, 1), new Object[] { "PIB", "PCM", "PIB", 'P', ModItems.pipes_steel, 'B', "blockSteel", 'I', "ingotPolymer", 'C', ModItems.mechanism_rifle_2, 'M', ModItems.motor }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_avenger, 1), new Object[] { "PIB", "PCM", "PIB", 'P', ModItems.pipes_steel, 'B', "blockBeryllium", 'I', "ingotDesh", 'C', ModItems.mechanism_rifle_2, 'M', ModItems.motor }));
GameRegistry.addRecipe(new ItemStack(ModItems.gun_lacunae, 1), new Object[] { "TIT", "ILI", "PRP", 'T', ModItems.syringe_taint, 'I', ModItems.ingot_starmetal, 'L', ModItems.gun_minigun, 'P', ModItems.pellet_rtg, 'R', ModBlocks.machine_rtg_grey });
GameRegistry.addRecipe(new ItemStack(ModItems.gun_mymy, 1), new Object[] { "PP ", " WP", 'P', ModItems.plate_polymer, 'W', ModItems.wire_aluminium });
//GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_darter, 1), new Object[] { "SST", " P", 'S', "plateSteel", 'T', ModItems.gas_empty, 'P', ModItems.ingot_polymer }));
//Legacy ammo recycling
@ -212,6 +213,7 @@ public class WeaponRecipes {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.assembly_actionexpress, 12), new Object[] { " I", "GC", " P", 'I', "ingotLead", 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50 }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.assembly_nuke, 1), new Object[] { " WP", "SEP", " WP", 'W', ModItems.wire_aluminium, 'P', "plateSteel", 'S', ModItems.hull_small_steel, 'E', ModItems.ingot_semtex }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_dart, 16), new Object[] { "IPI", "ICI", "IPI", 'I', ModItems.plate_polymer, 'P', "plateIron", 'C', new ItemStack(ModItems.fluid_tank_full, 1, FluidType.WATZ.ordinal()) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_dart_nerf, 16), new Object[] { "I", "I", 'I', ModItems.plate_polymer }));
//Ammo types
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_12gauge_incendiary, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_12gauge, 'A', ModItems.powder_fire });

View File

@ -1,17 +1,10 @@
package com.hbm.creativetabs;
import java.util.ArrayList;
import java.util.List;
import com.hbm.items.ModItems;
import api.hbm.energy.IBatteryItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class ControlTab extends CreativeTabs {
@ -29,47 +22,4 @@ public class ControlTab extends CreativeTabs {
return Items.iron_pickaxe;
}
@Override
@SideOnly(Side.CLIENT)
public void displayAllReleventItems(List list) {
super.displayAllReleventItems(list);
List<ItemStack> batteries = new ArrayList();
for(Object o : list) {
if(o instanceof ItemStack) {
ItemStack stack = (ItemStack) o;
if(stack.getItem() instanceof IBatteryItem) {
batteries.add(stack);
}
}
}
for(ItemStack stack : batteries) {
if(!(stack.getItem() instanceof IBatteryItem)) //shouldn't happen but just to make sure
continue;
IBatteryItem battery = (IBatteryItem) stack.getItem();
ItemStack empty = stack.copy();
ItemStack full = stack.copy();
battery.setCharge(empty, 0);
battery.setCharge(full, battery.getMaxCharge());
int index = list.indexOf(stack);
list.remove(index);
list.add(index, full);
//do not list empty versions of SU batteries
if(battery.getChargeRate() > 0)
list.add(index, empty);
}
}
}

View File

@ -128,7 +128,7 @@ public class HbmLivingProps implements IExtendedEntityProperties {
public static void setAsbestos(EntityLivingBase entity, int asbestos) {
getData(entity).asbestos = asbestos;
if(asbestos <= 1000000) {
if(asbestos >= 30 * 60 * 20) {
getData(entity).asbestos = 0;
entity.attackEntityFrom(ModDamageSource.asbestos, 1000);
}

View File

@ -157,6 +157,7 @@ public class BulletConfigSyncingUtil {
public static int B75_HE = i++;
public static int NEEDLE_GPS = i++;
public static int DART_NORMAL = i++;
public static int G20_NORMAL_FIRE = i++;
public static int G20_SHRAPNEL_FIRE = i++;
@ -375,6 +376,7 @@ public class BulletConfigSyncingUtil {
configSet.put(B75_HE, Gun75BoltFactory.get75BoltHEConfig());
configSet.put(NEEDLE_GPS, GunDartFactory.getGPSConfig());
configSet.put(DART_NORMAL, GunDartFactory.getNERFConfig());
configSet.put(G20_NORMAL_FIRE, Gun20GaugeFactory.get20GaugeConfig().setToFire(3));
configSet.put(G20_SHRAPNEL_FIRE, Gun20GaugeFactory.get20GaugeShrapnelConfig().setToFire(3));

View File

@ -49,6 +49,36 @@ public class GunDartFactory {
return config;
}
public static GunConfiguration getMymyConfig() {
GunConfiguration config = new GunConfiguration();
config.rateOfFire = 1;
config.roundsPerCycle = 1;
config.gunMode = GunConfiguration.MODE_NORMAL;
config.firingMode = GunConfiguration.FIRE_MANUAL;
config.hasSights = false;
config.reloadDuration = 10;
config.firingDuration = 0;
config.ammoCap = 1;
config.reloadType = GunConfiguration.RELOAD_FULL;
config.allowsInfinity = true;
config.crosshair = Crosshair.NONE;
config.durability = 1000;
config.reloadSound = GunConfiguration.RSOUND_GRENADE;
config.firingSound = "hbm:weapon.dartShoot";
config.reloadSoundEnd = false;
config.showAmmo = true;
config.name = "NERF blaster of unknown design";
config.manufacturer = "Hasbro";
config.config = new ArrayList();
config.config.add(BulletConfigSyncingUtil.DART_NORMAL);
return config;
}
public static BulletConfiguration getGPSConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
@ -94,4 +124,16 @@ public class GunDartFactory {
return bullet;
}
public static BulletConfiguration getNERFConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_dart_nerf;
bullet.velocity = 1.0F;
bullet.gravity = 0.04D;
bullet.dmgMin = 0;
bullet.dmgMax = 0;
return bullet;
}
}

View File

@ -496,7 +496,7 @@ public class AssemblerRecipes {
makeRecipe(new ComparableStack(ModBlocks.machine_cyclotron, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_lithium_battery, 3),
new ComparableStack(ModBlocks.fusion_conductor, 8),
new ComparableStack(ModBlocks.hadron_coil_neodymium, 8),
new ComparableStack(ModItems.wire_advanced_alloy, 96),
new OreDictStack("ingotSteel", 16),
new OreDictStack("plateSteel", 32),
@ -651,6 +651,17 @@ public class AssemblerRecipes {
new ComparableStack(ModItems.mechanism_special, 1),
new ComparableStack(ModItems.battery_lithium, 1)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.turret_richard, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_battery, 1),
new OreDictStack("ingotSteel", 16),
new ComparableStack(ModItems.ingot_dura_steel, 4),
new ComparableStack(ModItems.motor, 2),
new ComparableStack(ModItems.circuit_targeting_tier4, 1),
new ComparableStack(ModItems.ingot_polymer, 2),
new ComparableStack(ModItems.hull_small_steel, 8),
new ComparableStack(ModItems.mechanism_launcher_2, 1),
new ComparableStack(ModBlocks.crate_steel, 1)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.block_cap_nuka, 1), new AStack[] { new ComparableStack(ModItems.cap_nuka, 128) }, 10);
makeRecipe(new ComparableStack(ModBlocks.block_cap_quantum, 1), new AStack[] { new ComparableStack(ModItems.cap_quantum, 128) }, 10);

View File

@ -32,7 +32,7 @@ public class HadronRecipes {
recipes.add(new HadronRecipe(
new ItemStack(ModItems.particle_hydrogen),
new ItemStack(ModItems.particle_copper),
160,
80,
new ItemStack(ModItems.particle_aproton),
new ItemStack(ModItems.particle_aelectron),
true
@ -40,7 +40,7 @@ public class HadronRecipes {
recipes.add(new HadronRecipe(
new ItemStack(ModItems.particle_amat),
new ItemStack(ModItems.particle_amat),
1600,
80,
new ItemStack(ModItems.particle_aschrab),
new ItemStack(ModItems.particle_empty),
false
@ -48,7 +48,7 @@ public class HadronRecipes {
recipes.add(new HadronRecipe(
new ItemStack(ModItems.particle_aschrab),
new ItemStack(ModItems.particle_aschrab),
2400,
100000,
new ItemStack(ModItems.particle_dark),
new ItemStack(ModItems.particle_empty),
false
@ -56,7 +56,7 @@ public class HadronRecipes {
recipes.add(new HadronRecipe(
new ItemStack(ModItems.particle_hydrogen),
new ItemStack(ModItems.particle_amat),
400,
1000,
new ItemStack(ModItems.particle_muon),
new ItemStack(ModItems.particle_empty),
true
@ -64,7 +64,7 @@ public class HadronRecipes {
recipes.add(new HadronRecipe(
new ItemStack(ModItems.particle_hydrogen),
new ItemStack(ModItems.particle_lead),
8000,
4000,
new ItemStack(ModItems.particle_higgs),
new ItemStack(ModItems.particle_empty),
false
@ -72,7 +72,7 @@ public class HadronRecipes {
recipes.add(new HadronRecipe(
new ItemStack(ModItems.particle_muon),
new ItemStack(ModItems.particle_dark),
800,
100000,
new ItemStack(ModItems.particle_strange),
new ItemStack(ModItems.particle_empty),
false
@ -80,7 +80,7 @@ public class HadronRecipes {
recipes.add(new HadronRecipe(
new ItemStack(ModItems.particle_strange),
new ItemStack(ModItems.powder_magic),
24000,
500000,
new ItemStack(ModItems.particle_sparkticle),
new ItemStack(ModItems.dust),
false
@ -88,7 +88,7 @@ public class HadronRecipes {
recipes.add(new HadronRecipe(
new ItemStack(ModItems.particle_sparkticle),
new ItemStack(ModItems.particle_higgs),
200000,
1000000,
new ItemStack(ModItems.particle_digamma),
new ItemStack(ModItems.particle_empty),
false
@ -96,7 +96,7 @@ public class HadronRecipes {
recipes.add(new HadronRecipe(
new ItemStack(Items.chicken),
new ItemStack(Items.chicken),
800,
100,
new ItemStack(ModItems.nugget),
new ItemStack(ModItems.nugget),
false

View File

@ -79,7 +79,7 @@ public class MagicRecipes {
new ComparableStack(ModItems.diamond_gavel)));
recipes.add(new MagicRecipe(new ItemStack(ModBlocks.hadron_coil_mese),
new ComparableStack(ModBlocks.hadron_coil_starmetal),
new ComparableStack(ModBlocks.hadron_coil_chlorophyte),
new ComparableStack(ModItems.powder_dineutronium),
new ComparableStack(ModItems.plate_desh),
new OreDictStack("dustGold")));

View File

@ -56,8 +56,9 @@ public class GUICoreEmitter extends GuiInfoContainer {
}
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
this.field.mouseClicked(x, y, i);
super.mouseClicked(x, y, i);
this.field.mouseClicked(x, y, i);
if(guiLeft + 97 <= x && guiLeft + 97 + 18 > x && guiTop + 52 < y && guiTop + 52 + 18 >= y) {

View File

@ -3,21 +3,16 @@ package com.hbm.inventory.gui;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map.Entry;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.inventory.AssemblerRecipes;
import com.hbm.inventory.MachineRecipes;
import com.hbm.inventory.RecipesCommon;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemCassette;
import com.hbm.items.machine.ItemChemistryTemplate;
import com.hbm.items.machine.ItemFluidIdentifier;
import com.hbm.items.machine.ItemCassette.TrackType;
import com.hbm.lib.RefStrings;
import com.hbm.packet.ItemFolderPacket;
import com.hbm.packet.PacketDispatcher;
@ -25,6 +20,7 @@ import com.hbm.packet.PacketDispatcher;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.resources.I18n;
@ -43,8 +39,10 @@ public class GUIScreenTemplateFolder extends GuiScreen {
protected int guiLeft;
protected int guiTop;
int currentPage = 0;
List<ItemStack> allStacks = new ArrayList<ItemStack>();
List<ItemStack> stacks = new ArrayList<ItemStack>();
List<FolderButton> buttons = new ArrayList<FolderButton>();
private GuiTextField search;
public GUIScreenTemplateFolder(EntityPlayer player) {
@ -55,35 +53,61 @@ public class GUIScreenTemplateFolder extends GuiScreen {
// Stamps
for(Item i : MachineRecipes.stamps_plate)
stacks.add(new ItemStack(i));
allStacks.add(new ItemStack(i));
for(Item i : MachineRecipes.stamps_wire)
stacks.add(new ItemStack(i));
allStacks.add(new ItemStack(i));
for(Item i : MachineRecipes.stamps_circuit)
stacks.add(new ItemStack(i));
allStacks.add(new ItemStack(i));
// Tracks
for(int i = 1; i < ItemCassette.TrackType.values().length; i++)
stacks.add(new ItemStack(ModItems.siren_track, 1, i));
allStacks.add(new ItemStack(ModItems.siren_track, 1, i));
// Fluid IDs
for(int i = 1; i < FluidType.values().length; i++)
stacks.add(new ItemStack(ModItems.fluid_identifier, 1, i));
allStacks.add(new ItemStack(ModItems.fluid_identifier, 1, i));
// Assembly Templates
for(int i = 0; i < AssemblerRecipes.recipeList.size(); i++)
if(AssemblerRecipes.hidden.get(AssemblerRecipes.recipeList.get(i)) == null)
stacks.add(new ItemStack(ModItems.assembly_template, 1, i));
allStacks.add(new ItemStack(ModItems.assembly_template, 1, i));
// Chemistry Templates
for(int i = 0; i < ItemChemistryTemplate.EnumChemistryTemplate.values().length; i++)
stacks.add(new ItemStack(ModItems.chemistry_template, 1, i));
allStacks.add(new ItemStack(ModItems.chemistry_template, 1, i));
} else {
for(int i = 0; i < AssemblerRecipes.recipeList.size(); i++) {
if(AssemblerRecipes.hidden.get(AssemblerRecipes.recipeList.get(i)) != null &&
AssemblerRecipes.hidden.get(AssemblerRecipes.recipeList.get(i)).contains(player.getHeldItem().getItem()))
stacks.add(new ItemStack(ModItems.assembly_template, 1, i));
allStacks.add(new ItemStack(ModItems.assembly_template, 1, i));
}
isJournal = true;
}
search(null);
}
private void search(String sub) {
stacks.clear();
this.currentPage = 0;
if(sub == null || sub.isEmpty()) {
stacks.addAll(allStacks);
updateButtons();
return;
}
sub = sub.toLowerCase();
for(ItemStack stack : allStacks) {
if(stack.getDisplayName().toLowerCase().contains(sub)) {
stacks.add(stack);
}
}
updateButtons();
}
int getPageCount() {
@ -111,6 +135,13 @@ public class GUIScreenTemplateFolder extends GuiScreen {
this.guiTop = (this.height - this.ySize) / 2;
updateButtons();
Keyboard.enableRepeatEvents(true);
this.search = new GuiTextField(this.fontRendererObj, guiLeft + 61, guiTop + 213, 48, 12);
this.search.setTextColor(0xffffff);
this.search.setDisabledTextColour(0xffffff);
this.search.setEnableBackgroundDrawing(false);
this.search.setMaxStringLength(100);
}
@Override
@ -134,6 +165,16 @@ public class GUIScreenTemplateFolder extends GuiScreen {
}
protected void mouseClicked(int i, int j, int k) {
System.out.println(i + " " + j);
System.out.println((guiLeft + i) + " " + (guiTop + j));
if(i >= guiLeft + 45 && i < guiLeft + 117 && j >= guiTop + 211 && j < guiTop + 223) {
this.search.setFocused(true);
} else {
this.search.setFocused(false);
}
try {
for(FolderButton b : buttons)
if(b.isMouseOnButton(i, j))
@ -162,13 +203,24 @@ public class GUIScreenTemplateFolder extends GuiScreen {
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(search.isFocused())
drawTexturedModalRect(guiLeft + 45, guiTop + 211, 176, 54, 72, 12);
for(FolderButton b : buttons)
b.drawButton(b.isMouseOnButton(i, j));
for(FolderButton b : buttons)
b.drawIcon(b.isMouseOnButton(i, j));
search.drawTextBox();
}
protected void keyTyped(char p_73869_1_, int p_73869_2_) {
if (this.search.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
this.search(this.search.getText());
return;
}
if(p_73869_2_ == 1 || p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
this.mc.thePlayer.closeScreen();
}

View File

@ -1314,6 +1314,7 @@ public class ModItems {
public static Item ammo_fuel_gas;
public static Item ammo_cell;
public static Item ammo_dart;
public static Item ammo_dart_nerf;
public static Item gun_rpg;
public static Item gun_rpg_ammo;
@ -1386,6 +1387,7 @@ public class ModItems {
public static Item gun_bolt_action_green;
public static Item gun_bolt_action_saturnite;
public static Item gun_bolt_action_ammo;
public static Item gun_mymy;
public static Item gun_b92;
public static Item gun_b92_ammo;
public static Item gun_b93;
@ -2308,7 +2310,7 @@ public class ModItems {
ingot_dineutronium = new ItemCustomLore().setUnlocalizedName("ingot_dineutronium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_dineutronium");
nugget_dineutronium = new ItemCustomLore().setUnlocalizedName("nugget_dineutronium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_dineutronium");
powder_dineutronium = new ItemCustomLore().setUnlocalizedName("powder_dineutronium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_dineutronium");
ingot_starmetal = new ItemCustomLore().setUnlocalizedName("ingot_starmetal").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_starmetal");
ingot_starmetal = new ItemStarmetal().setUnlocalizedName("ingot_starmetal").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_starmetal");
ingot_saturnite = new ItemCustomLore().setUnlocalizedName("ingot_saturnite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_saturnite");
plate_saturnite = new ItemCustomLore().setUnlocalizedName("plate_saturnite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_saturnite");
ingot_fiberglass = new ItemCustomLore().setUnlocalizedName("ingot_fiberglass").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_fiberglass");
@ -3430,6 +3432,7 @@ public class ModItems {
ammo_fuel_gas = new ItemAmmo().setUnlocalizedName("ammo_fuel_gas").setCreativeTab(MainRegistry.weaponTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":ammo_fuel_gas");
ammo_cell = new ItemAmmo().setUnlocalizedName("ammo_cell").setCreativeTab(MainRegistry.weaponTab).setMaxStackSize(16).setTextureName(RefStrings.MODID + ":ammo_cell");
ammo_dart = new ItemAmmo().setUnlocalizedName("ammo_dart").setCreativeTab(MainRegistry.weaponTab).setMaxStackSize(16).setTextureName(RefStrings.MODID + ":ammo_dart");
ammo_dart_nerf = new ItemAmmo().setUnlocalizedName("ammo_dart_nerf").setCreativeTab(MainRegistry.weaponTab).setMaxStackSize(16).setTextureName(RefStrings.MODID + ":ammo_dart_nerf");
gun_rpg = new ItemGunBase(GunRocketFactory.getGustavConfig()).setUnlocalizedName("gun_rpg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_rpg");
gun_karl = new ItemGunBase(GunRocketFactory.getKarlConfig()).setUnlocalizedName("gun_karl").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_karl");
@ -3502,6 +3505,7 @@ public class ModItems {
gun_bolt_action = new ItemGunBase(Gun20GaugeFactory.getBoltConfig()).setUnlocalizedName("gun_bolt_action").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_bolt_action");
gun_bolt_action_green = new ItemGunBase(Gun20GaugeFactory.getBoltGreenConfig()).setUnlocalizedName("gun_bolt_action_green").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_bolt_action_green");
gun_bolt_action_saturnite = new ItemGunBase(Gun20GaugeFactory.getBoltSaturniteConfig()).setUnlocalizedName("gun_bolt_action_saturnite").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_bolt_action_saturnite");
gun_mymy = new ItemGunBase(GunDartFactory.getMymyConfig()).setUnlocalizedName("gun_mymy").setFull3D().setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mymy");
gun_b92_ammo = new GunB92Cell().setUnlocalizedName("gun_b92_ammo").setMaxStackSize(1).setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_b92_ammo_alt");
gun_b92 = new GunB92().setUnlocalizedName("gun_b92").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_b92");
gun_b93 = new GunB93().setUnlocalizedName("gun_b93").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_b93");
@ -5883,6 +5887,7 @@ public class ModItems {
GameRegistry.registerItem(gun_bolt_action, gun_bolt_action.getUnlocalizedName());
GameRegistry.registerItem(gun_bolt_action_green, gun_bolt_action_green.getUnlocalizedName());
GameRegistry.registerItem(gun_bolt_action_saturnite, gun_bolt_action_saturnite.getUnlocalizedName());
GameRegistry.registerItem(gun_mymy, gun_mymy.getUnlocalizedName());
GameRegistry.registerItem(gun_xvl1456, gun_xvl1456.getUnlocalizedName());
GameRegistry.registerItem(gun_osipr, gun_osipr.getUnlocalizedName());
GameRegistry.registerItem(gun_immolator, gun_immolator.getUnlocalizedName());
@ -6039,6 +6044,7 @@ public class ModItems {
GameRegistry.registerItem(ammo_fuel_gas, ammo_fuel_gas.getUnlocalizedName());
GameRegistry.registerItem(ammo_cell, ammo_cell.getUnlocalizedName());
GameRegistry.registerItem(ammo_dart, ammo_dart.getUnlocalizedName());
GameRegistry.registerItem(ammo_dart_nerf, ammo_dart_nerf.getUnlocalizedName());
GameRegistry.registerItem(ammo_rocket, ammo_rocket.getUnlocalizedName());
GameRegistry.registerItem(ammo_rocket_he, ammo_rocket_he.getUnlocalizedName());
GameRegistry.registerItem(ammo_rocket_incendiary, ammo_rocket_incendiary.getUnlocalizedName());

View File

@ -6,6 +6,9 @@ import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import api.hbm.energy.IBatteryItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
@ -23,23 +26,14 @@ public class ItemBattery extends Item implements IBatteryItem {
this.chargeRate = chargeRate;
this.dischargeRate = dischargeRate;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
{
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
long charge = maxCharge;
if(itemstack.hasTagCompound())
charge = getCharge(itemstack);
if(itemstack.getItem() != ModItems.fusion_core &&
itemstack.getItem() != ModItems.factory_core_titanium &&
itemstack.getItem() != ModItems.factory_core_advanced &&
itemstack.getItem() != ModItems.energy_core &&
itemstack.getItem() != ModItems.dynosphere_desh &&
itemstack.getItem() != ModItems.dynosphere_schrabidium &&
itemstack.getItem() != ModItems.dynosphere_euphemium &&
itemstack.getItem() != ModItems.dynosphere_dineutronium)
{
if(itemstack.getItem() != ModItems.fusion_core && itemstack.getItem() != ModItems.factory_core_titanium && itemstack.getItem() != ModItems.factory_core_advanced && itemstack.getItem() != ModItems.energy_core && itemstack.getItem() != ModItems.dynosphere_desh && itemstack.getItem() != ModItems.dynosphere_schrabidium && itemstack.getItem() != ModItems.dynosphere_euphemium && itemstack.getItem() != ModItems.dynosphere_dineutronium) {
list.add("Energy stored: " + Library.getShortNumber(charge) + "/" + Library.getShortNumber(maxCharge) + "HE");
} else {
String charge1 = Library.getShortNumber((charge * 100) / this.maxCharge);
@ -50,118 +44,121 @@ public class ItemBattery extends Item implements IBatteryItem {
list.add("Discharge rate: " + Library.getShortNumber(dischargeRate) + "HE/t");
}
@Override
@Override
public EnumRarity getRarity(ItemStack p_77613_1_) {
if(this == ModItems.battery_schrabidium)
{
return EnumRarity.rare;
}
if(this == ModItems.fusion_core ||
this == ModItems.factory_core_titanium ||
this == ModItems.factory_core_advanced ||
this == ModItems.energy_core ||
this == ModItems.dynosphere_desh ||
this == ModItems.dynosphere_schrabidium ||
this == ModItems.dynosphere_euphemium ||
this == ModItems.dynosphere_dineutronium)
{
return EnumRarity.uncommon;
}
return EnumRarity.common;
}
public void chargeBattery(ItemStack stack, long i) {
if(stack.getItem() instanceof ItemBattery) {
if(stack.hasTagCompound()) {
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") + i);
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", i);
}
}
}
public void setCharge(ItemStack stack, long i) {
if(stack.getItem() instanceof ItemBattery) {
if(stack.hasTagCompound()) {
stack.stackTagCompound.setLong("charge", i);
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", i);
}
}
}
public void dischargeBattery(ItemStack stack, long i) {
if(stack.getItem() instanceof ItemBattery) {
if(stack.hasTagCompound()) {
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") - i);
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", this.maxCharge - i);
}
}
}
public long getCharge(ItemStack stack) {
if(stack.getItem() instanceof ItemBattery) {
if(stack.hasTagCompound()) {
return stack.stackTagCompound.getLong("charge");
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", ((ItemBattery)stack.getItem()).maxCharge);
return stack.stackTagCompound.getLong("charge");
}
}
return 0;
}
public long getMaxCharge() {
return maxCharge;
}
public long getChargeRate() {
return chargeRate;
}
public long getDischargeRate() {
return dischargeRate;
}
public static ItemStack getEmptyBattery(Item item) {
if(item instanceof ItemBattery) {
ItemStack stack = new ItemStack(item);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", 0);
return stack.copy();
}
return null;
}
public static ItemStack getFullBattery(Item item) {
if(item instanceof ItemBattery) {
ItemStack stack = new ItemStack(item);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", ((ItemBattery)item).getMaxCharge());
return stack.copy();
}
return new ItemStack(item);
}
public boolean showDurabilityBar(ItemStack stack) {
return true;
}
public double getDurabilityForDisplay(ItemStack stack)
{
return 1D - (double)getCharge(stack) / (double)getMaxCharge();
}
if(this == ModItems.battery_schrabidium) {
return EnumRarity.rare;
}
if(this == ModItems.fusion_core || this == ModItems.factory_core_titanium || this == ModItems.factory_core_advanced || this == ModItems.energy_core || this == ModItems.dynosphere_desh || this == ModItems.dynosphere_schrabidium || this == ModItems.dynosphere_euphemium || this == ModItems.dynosphere_dineutronium) {
return EnumRarity.uncommon;
}
return EnumRarity.common;
}
public void chargeBattery(ItemStack stack, long i) {
if(stack.getItem() instanceof ItemBattery) {
if(stack.hasTagCompound()) {
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") + i);
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", i);
}
}
}
public void setCharge(ItemStack stack, long i) {
if(stack.getItem() instanceof ItemBattery) {
if(stack.hasTagCompound()) {
stack.stackTagCompound.setLong("charge", i);
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", i);
}
}
}
public void dischargeBattery(ItemStack stack, long i) {
if(stack.getItem() instanceof ItemBattery) {
if(stack.hasTagCompound()) {
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") - i);
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", this.maxCharge - i);
}
}
}
public long getCharge(ItemStack stack) {
if(stack.getItem() instanceof ItemBattery) {
if(stack.hasTagCompound()) {
return stack.stackTagCompound.getLong("charge");
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", ((ItemBattery) stack.getItem()).maxCharge);
return stack.stackTagCompound.getLong("charge");
}
}
return 0;
}
public long getMaxCharge() {
return maxCharge;
}
public long getChargeRate() {
return chargeRate;
}
public long getDischargeRate() {
return dischargeRate;
}
public static ItemStack getEmptyBattery(Item item) {
if(item instanceof ItemBattery) {
ItemStack stack = new ItemStack(item);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", 0);
return stack.copy();
}
return null;
}
public static ItemStack getFullBattery(Item item) {
if(item instanceof ItemBattery) {
ItemStack stack = new ItemStack(item);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", ((ItemBattery) item).getMaxCharge());
return stack.copy();
}
return new ItemStack(item);
}
public boolean showDurabilityBar(ItemStack stack) {
return true;
}
public double getDurabilityForDisplay(ItemStack stack) {
return 1D - (double) getCharge(stack) / (double) getMaxCharge();
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list) {
if(this.chargeRate > 0) {
list.add(getEmptyBattery(item));
}
if(this.dischargeRate > 0) {
list.add(getFullBattery(item));
}
}
}

View File

@ -0,0 +1,61 @@
package com.hbm.items.special;
import java.util.List;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
public class ItemStarmetal extends Item {
private IIcon[] icons = new IIcon[4];
public ItemStarmetal() {
this.setHasSubtypes(true);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister reg) {
this.itemIcon = reg.registerIcon(this.getIconString());
this.icons[0] = reg.registerIcon(RefStrings.MODID + ":ingot_starmetal");
this.icons[1] = reg.registerIcon(RefStrings.MODID + ":ingot_starmetal_astra");
this.icons[2] = reg.registerIcon(RefStrings.MODID + ":ingot_starmetal_ursa");
this.icons[3] = reg.registerIcon(RefStrings.MODID + ":ingot_starmetal_orion");
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list) {
super.getSubItems(item, tab, list);
//for(int i = 0; i < 4; i++)
// list.add(new ItemStack(item, 1, i));
}
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta) {
int s = Math.abs(meta) % 4;
return icons[s];
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
switch(stack.getItemDamage()) {
case 1: list.add(EnumChatFormatting.ITALIC + "Astra"); break;
case 2: list.add(EnumChatFormatting.ITALIC + "Ursa"); break;
case 3: list.add(EnumChatFormatting.ITALIC + "Orion"); break;
}
}
}

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 (3802)";
public static final String VERSION = "1.0.27 BETA (3808)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -688,8 +688,13 @@ public class CraftingManager {
GameRegistry.addRecipe(new ItemStack(ModItems.mech_key, 1), new Object[] { "MCM", "MKM", "MMM", 'M', ModItems.ingot_meteorite_forged, 'C', ModItems.coin_maskman, 'K', ModItems.key });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_coil_alloy, 1), new Object[] { "WWW", "WCW", "WWW", 'W', ModItems.wire_advanced_alloy, 'C', ModBlocks.fusion_conductor });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_coil_schrabidium, 1), new Object[] { "SCS", "CSC", "SCS", 'S', ModItems.powder_schrabidium, 'C', ModBlocks.hadron_coil_alloy });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_coil_starmetal, 1), new Object[] { "SCS", "CSC", "SCS", 'S', ModItems.ring_starmetal, 'C', ModBlocks.hadron_coil_schrabidium });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_coil_gold, 1), new Object[] { "GGG", "GCG", "GGG", 'G', ModItems.coil_gold, 'C', ModBlocks.hadron_coil_alloy });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_coil_neodymium, 1), new Object[] { " G ", "GCG", " G ", 'G', ModItems.powder_neodymium, 'C', ModBlocks.hadron_coil_gold });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_coil_magtung, 1), new Object[] { "WWW", "WCW", "WWW", 'W', ModItems.wire_magnetized_tungsten, 'C', ModBlocks.fwatz_conductor });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_coil_schrabidium, 1), new Object[] { "WSW", "SCS", "WSW", 'W', ModItems.wire_schrabidium, 'S', ModItems.powder_schrabidium, 'C', ModBlocks.hadron_coil_magtung });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_coil_schrabidate, 1), new Object[] { "WSW", "SCS", "WSW", 'W', ModItems.wire_schrabidium, 'S', ModItems.powder_schrabidate, 'C', ModBlocks.hadron_coil_schrabidium });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_coil_starmetal, 1), new Object[] { "NSN", "SCS", "NSN", 'S', ModItems.ring_starmetal, 'N', ModBlocks.hadron_coil_neodymium, 'C', ModBlocks.hadron_coil_schrabidate });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.hadron_coil_chlorophyte, 1), new Object[] { "TCT", "CSC", "TCT", 'T', "dustTungsten", 'C', ModItems.powder_chlorophyte, 'S', ModBlocks.hadron_coil_starmetal }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.hadron_diode, 1), new Object[] { "CIC", "ISI", "CIC", 'C', ModBlocks.hadron_coil_alloy, 'I', "ingotSteel", 'S', ModItems.circuit_gold }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.hadron_plating, 1), new Object[] { "IPI", "P P", "IPI", 'I', "ingotSteel", 'P', "plateSteel" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.hadron_plating_blue, 1), new Object[] { ModBlocks.hadron_plating, "dyeBlue" }));
@ -699,6 +704,10 @@ public class CraftingManager {
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.hadron_plating_glass, 1), new Object[] { ModBlocks.hadron_plating, "blockGlass" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.hadron_plating_voltz, 1), new Object[] { ModBlocks.hadron_plating, "dyeRed" }));
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_power, 1), new Object[] { "STS", "CPC", "STS", 'S', ModItems.ingot_saturnite, 'T', ModBlocks.machine_transformer, 'C', ModItems.circuit_targeting_tier3, 'P', ModBlocks.hadron_plating_blue });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_power_10m, 1), new Object[] { "HF", 'H', ModBlocks.hadron_power, 'F', ModItems.fuse });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_power_100m, 1), new Object[] { "HF", 'H', ModBlocks.hadron_power_10m, 'F', ModItems.fuse });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_power_1g, 1), new Object[] { "HF", 'H', ModBlocks.hadron_power_100m, 'F', ModItems.fuse });
GameRegistry.addRecipe(new ItemStack(ModBlocks.hadron_power_10g, 1), new Object[] { "HF", 'H', ModBlocks.hadron_power_1g, 'F', ModItems.fuse });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.hadron_analysis, 1), new Object[] { "IPI", "PCP", "IPI", 'I', "ingotTitanium", 'P', "plateDenseLead", 'C', ModItems.circuit_gold }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.hadron_analysis_glass, 1), new Object[] { ModBlocks.hadron_analysis, "blockGlass" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.hadron_access, 1), new Object[] { "IGI", "CRC", "IPI", 'I', ModItems.plate_polymer, 'G', "paneGlass", 'C', ModItems.circuit_aluminium, 'R', "blockRedstone", 'P', ModBlocks.hadron_plating_blue }));

View File

@ -1099,9 +1099,9 @@ public class MainRegistry {
HazmatRegistry.registerHazmat(ModItems.hev_legs, 0.7F);
HazmatRegistry.registerHazmat(ModItems.hev_boots, 0.3F);
HazmatRegistry.registerHazmat(ModItems.fau_helmet, 0.5F);
HazmatRegistry.registerHazmat(ModItems.fau_plate, 1.0F);
HazmatRegistry.registerHazmat(ModItems.fau_legs, 0.7F);
HazmatRegistry.registerHazmat(ModItems.fau_helmet, 0.6F);
HazmatRegistry.registerHazmat(ModItems.fau_plate, 1.2F);
HazmatRegistry.registerHazmat(ModItems.fau_legs, 0.9F);
HazmatRegistry.registerHazmat(ModItems.fau_boots, 0.3F);
HazmatRegistry.registerHazmat(ModItems.paa_plate, 0.8F);

View File

@ -11,7 +11,7 @@ import net.minecraft.tileentity.TileEntity;
public class TileEntityFireworks extends TileEntity {
public int color = 0xff0000;
public String message = "EAT MY ASS";
public String message = "NUCLEAR TECH";
public int charges;
int index;

View File

@ -31,7 +31,7 @@ import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityHadron extends TileEntityMachineBase implements IConsumer {
public long power;
public static final long maxPower = 1000000000;
public static final long maxPower = 10000000;
public boolean isOn = false;
public boolean analysisOnly = false;
@ -270,7 +270,6 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
int momentum;
int charge;
int analysis;
static final int maxCharge = 80;
boolean isCheckExempt = false;
boolean expired = false;
@ -285,7 +284,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
this.posY = posY;
this.posZ = posZ;
this.charge = maxCharge;
this.charge = 0;
this.momentum = 0;
}
@ -322,7 +321,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
isCheckExempt = false; //clearing up the exemption we might have held from the previous turn, AFTER stepping
if(charge <= 0)
if(charge < 0)
this.expire();
}
}
@ -459,15 +458,11 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
TileEntityHadronPower plug = (TileEntityHadronPower)te;
int req = p.maxCharge - p.charge; //how many "charge points" the particle needs to be fully charged
long bit = plug.maxPower / p.maxCharge; //how much HE one "charge point" is
long bit = 10000; //how much HE one "charge point" is
int times = (int) (plug.getPower() / bit); //how many charges the plug has to offer
int total = Math.min(req, times); //whichever is less, the charges in the plug or the required charges
p.charge += total;
plug.setPower(plug.getPower() - total * bit);
p.charge += times;
plug.setPower(plug.getPower() - times * bit);
continue;
}

View File

@ -1,17 +1,19 @@
package com.hbm.tileentity.machine;
import com.hbm.blocks.machine.BlockHadronPower;
import com.hbm.interfaces.IConsumer;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
public class TileEntityHadronPower extends TileEntity implements IConsumer {
public long power;
public static final long maxPower = 1000000000;
public boolean canUpdate() {
return false;
}
public boolean canUpdate() {
return false;
}
@Override
public void setPower(long i) {
@ -26,6 +28,25 @@ public class TileEntityHadronPower extends TileEntity implements IConsumer {
@Override
public long getMaxPower() {
return maxPower;
Block b = this.getBlockType();
if(b instanceof BlockHadronPower) {
return ((BlockHadronPower)b).power;
}
return 0;
}
@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);
}
}

View File

@ -67,7 +67,7 @@ public class TileEntityTurretRichard extends TileEntityTurretBaseNT {
@Override
public double getDecetorRange() {
return 80D;
return 64D;
}
int timer;
@ -143,12 +143,12 @@ public class TileEntityTurretRichard extends TileEntityTurretBaseNT {
Vec3 pos = this.getTurretPos();
Vec3 vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0);
vec.rotateAroundZ((float) -this.rotationPitch);
vec.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.75));
vec.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.5));
EntityBulletBase proj = new EntityBulletBase(worldObj, BulletConfigSyncingUtil.getKey(bullet));
proj.setPositionAndRotation(pos.xCoord + vec.xCoord, pos.yCoord + vec.yCoord, pos.zCoord + vec.zCoord, 0.0F, 0.0F);
proj.setThrowableHeading(vec.xCoord, vec.yCoord, vec.zCoord, bullet.velocity * 0.5F, bullet.spread);
proj.setThrowableHeading(vec.xCoord, vec.yCoord, vec.zCoord, bullet.velocity * 0.75F, bullet.spread);
worldObj.spawnEntityInWorld(proj);
}