tungsten crate, more recycling recipes, fixes

This commit is contained in:
Bob 2021-02-15 21:41:54 +01:00
parent c40f412270
commit 63973c78b1
35 changed files with 802 additions and 240 deletions

View File

@ -157,6 +157,7 @@ container.chemplant=Chemiefabrik
container.compactLauncher=Kompakt-Startrampe
container.crateIron=Eisenkiste
container.crateSteel=Stahlkiste
container.crateTungsten=Wolframkiste
container.crystallizer=Erzauflöser
container.cyclotron=Zyklotron
container.dfcEmitter=DFC-Emitter
@ -2220,6 +2221,10 @@ potion.hbm_stability=Stabilität
potion.hbm_taint=Verdorben
potion.hbm_telekinesis=! ! !
radar.detectMissiles=Raketen erkennen
radar.detectPlayers=Spieler erkennen
radar.smartMode=Smart Mode$Redstonesignal ignoriert aufsteigende Raketen
tile.absorber.name=Strahlungs-Absorber
tile.absorber_green.name=Fortgeschrittener Strahlungs-Absorber
tile.absorber_pink.name=Elite Strahlungs-Absorber
@ -2366,6 +2371,7 @@ tile.crate_lead.name=Gefahrenstoffkiste
tile.crate_metal.name=Maschinenkiste
tile.crate_red.name=Rote Kiste
tile.crate_steel.name=Stahlkiste
tile.crate_tungsten.name=Wolframkiste
tile.crate_weapon.name=Waffenkiste
tile.crystal_hardened.name=Gehärteter Dunkler Kristall
tile.crystal_pulsar.name=Pulsating Crystal

View File

@ -163,6 +163,7 @@ container.chemplant=Chemical Plant
container.compactLauncher=Compact Launch Pad
container.crateIron=Iron Crate
container.crateSteel=Steel Crate
container.crateTungsten=Tungsten Crate
container.crystallizer=Ore Acidizer
container.cyclotron=Cyclotron
container.dfcCore=Dark Fusion Core
@ -2226,6 +2227,10 @@ potion.hbm_stability=Stability
potion.hbm_taint=Tainted
potion.hbm_telekinesis=! ! !
radar.detectMissiles=Detect Missiles
radar.detectPlayers=Detect Players
radar.smartMode=Smart Mode$Redstone output ignores ascending missiles
tile.absorber.name=Radiation Absorber
tile.absorber_green.name=Advanced Radiation Absorber
tile.absorber_pink.name=Elite Radiation Absorber
@ -2372,6 +2377,7 @@ tile.crate_lead.name=Hazmat Crate
tile.crate_metal.name=Machine Crate
tile.crate_red.name=Red Crate
tile.crate_steel.name=Steel Crate
tile.crate_tungsten.name=Tungsten Crate
tile.crate_weapon.name=Weapon Crate
tile.crystal_hardened.name=Hardened Dark Crystal
tile.crystal_pulsar.name=Pulsating Crystal

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

View File

@ -387,6 +387,9 @@ public class ModBlocks {
public static Block crate_steel;
public static final int guiID_crate_steel = 47;
public static Block crate_tungsten;
public static final int guiID_crate_tungsten = 103;
public static Block safe;
public static final int guiID_safe = 70;
@ -1477,6 +1480,7 @@ public class ModBlocks {
crate_jungle = new BlockJungleCrate(Material.rock).setBlockName("crate_jungle").setStepSound(Block.soundTypeStone).setHardness(1.0F).setResistance(2.5F).setCreativeTab(MainRegistry.consumableTab).setBlockTextureName(RefStrings.MODID + ":crate_jungle");
crate_iron = new BlockStorageCrate(Material.iron).setBlockName("crate_iron").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
crate_steel = new BlockStorageCrate(Material.iron).setBlockName("crate_steel").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
crate_tungsten = new BlockStorageCrate(Material.iron).setBlockName("crate_tungsten").setStepSound(Block.soundTypeMetal).setHardness(7.5F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab);
safe = new BlockStorageCrate(Material.iron).setBlockName("safe").setStepSound(Block.soundTypeMetal).setHardness(7.5F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab);
boxcar = new DecoBlock(Material.iron).setBlockName("boxcar").setStepSound(Block.soundTypeMetal).setHardness(10.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":boxcar");
@ -2022,6 +2026,7 @@ public class ModBlocks {
//Crates
GameRegistry.registerBlock(crate_iron, crate_iron.getUnlocalizedName());
GameRegistry.registerBlock(crate_steel, crate_steel.getUnlocalizedName());
GameRegistry.registerBlock(crate_tungsten, crate_tungsten.getUnlocalizedName());
GameRegistry.registerBlock(safe, safe.getUnlocalizedName());
//Junk

View File

@ -9,6 +9,7 @@ import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityCrateIron;
import com.hbm.tileentity.machine.TileEntityCrateSteel;
import com.hbm.tileentity.machine.TileEntityCrateTungsten;
import com.hbm.tileentity.machine.TileEntityLockableBase;
import com.hbm.tileentity.machine.TileEntitySafe;
@ -32,32 +33,31 @@ import net.minecraft.world.World;
public class BlockStorageCrate extends BlockContainer {
private final Random field_149933_a = new Random();
private Random rand;
private static boolean keepInventory;
private final Random field_149933_a = new Random();
@SideOnly(Side.CLIENT)
private IIcon iconTop;
public BlockStorageCrate(Material p_i45394_1_) {
super(p_i45394_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
if(this == ModBlocks.crate_iron)
{
if(this == ModBlocks.crate_iron) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":crate_iron_top");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":crate_iron_side");
}
if(this == ModBlocks.crate_steel)
{
if(this == ModBlocks.crate_steel) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":crate_steel_top");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":crate_steel_side");
}
if(this == ModBlocks.safe)
{
if(this == ModBlocks.crate_tungsten) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":crate_tungsten_top");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":crate_tungsten_side");
}
if(this == ModBlocks.safe) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":safe_front");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":safe_side");
}
@ -66,10 +66,10 @@ public class BlockStorageCrate extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
if(this == ModBlocks.safe)
return metadata == 0 && side == 3 ? this.iconTop : (side == metadata ? this.iconTop : this.blockIcon);
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
}
@ -79,90 +79,79 @@ public class BlockStorageCrate extends BlockContainer {
return new TileEntityCrateIron();
if(this == ModBlocks.crate_steel)
return new TileEntityCrateSteel();
if(this == ModBlocks.crate_tungsten)
return new TileEntityCrateTungsten();
if(this == ModBlocks.safe)
return new TileEntitySafe();
return null;
}
@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(((TileEntityLockableBase)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_)).isLocked()) {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
return;
}
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_) {
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(((TileEntityLockableBase) p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_)).isLocked()) {
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
return;
}
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;
if(tileentityfurnace != null) {
for(int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) {
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
while (itemstack.stackSize > 0)
{
int j1 = this.field_149933_a.nextInt(21) + 10;
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;
if (j1 > itemstack.stackSize)
{
j1 = itemstack.stackSize;
}
while(itemstack.stackSize > 0) {
int j1 = this.field_149933_a.nextInt(21) + 10;
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(j1 > itemstack.stackSize) {
j1 = itemstack.stackSize;
}
if (itemstack.hasTagCompound())
{
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
}
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()));
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);
}
}
}
if(itemstack.hasTagCompound()) {
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
}
}
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_);
}
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
}
@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)
{
if(world.isRemote) {
return true;
} else if(player.getHeldItem() != null && (player.getHeldItem().getItem() instanceof ItemLock || player.getHeldItem().getItem() == ModItems.key_kit)) {
return false;
} else if(!player.isSneaking())
{
} else if(!player.isSneaking()) {
TileEntity entity = world.getTileEntity(x, y, z);
if(entity instanceof TileEntityCrateIron && ((TileEntityCrateIron)entity).canAccess(player))
{
if(entity instanceof TileEntityCrateIron && ((TileEntityCrateIron) entity).canAccess(player)) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_crate_iron, world, x, y, z);
}
if(entity instanceof TileEntityCrateSteel && ((TileEntityCrateSteel)entity).canAccess(player))
{
if(entity instanceof TileEntityCrateSteel && ((TileEntityCrateSteel) entity).canAccess(player)) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_crate_steel, world, x, y, z);
}
if(entity instanceof TileEntitySafe && ((TileEntitySafe)entity).canAccess(player))
{
if(entity instanceof TileEntityCrateTungsten && ((TileEntityCrateTungsten) entity).canAccess(player)) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_crate_tungsten, world, x, y, z);
}
if(entity instanceof TileEntitySafe && ((TileEntitySafe) entity).canAccess(player)) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_safe, world, x, y, z);
}
return true;
@ -170,29 +159,25 @@ public class BlockStorageCrate extends BlockContainer {
return false;
}
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
if(this != ModBlocks.safe)
super.onBlockPlacedBy(world, x, y, z, player, itemStack);
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0)
{
if(i == 0) {
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
}
if(i == 1)
{
if(i == 1) {
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
}
if(i == 2)
{
if(i == 2) {
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
}
if(i == 3)
{
if(i == 3) {
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
}
}

View File

@ -426,5 +426,7 @@ public class WeaponRecipes {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.custom_schrab, 1), new Object[] { " C ", "LUL", "LUL", 'C', "plateCopper", 'L', "plateLead", 'U', "ingotSchrabidium" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.demon_core_open, 1), new Object[] { "PRP", " CS", "PRP", 'P', "plateTitanium", 'R', "plateDenseLead", 'C', ModItems.man_core, 'S', ModItems.screwdriver }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.crucible, 1, 3), new Object[] { "MEM", "YDY", "YCY", 'M', ModItems.ingot_meteorite_forged, 'E', ModItems.ingot_euphemium, 'Y', ModItems.billet_yharonite, 'D', ModItems.demon_core_closed, 'C', ModItems.ingot_chainsteel }));
}
}

View File

@ -720,6 +720,13 @@ public class GUIHandler implements IGuiHandler {
}
return null;
}
case ModBlocks.guiID_crate_tungsten: {
if(entity instanceof TileEntityCrateTungsten) {
return new ContainerCrateTungsten(player.inventory, (TileEntityCrateTungsten) entity);
}
return null;
}
}
// NON-TE CONTAINERS
@ -1429,6 +1436,13 @@ public class GUIHandler implements IGuiHandler {
}
return null;
}
case ModBlocks.guiID_crate_tungsten: {
if(entity instanceof TileEntityCrateTungsten) {
return new GUICrateTungsten(player.inventory, (TileEntityCrateTungsten) entity);
}
return null;
}
}
// ITEM GUIS

View File

@ -389,7 +389,7 @@ public class AssemblerRecipes {
makeRecipe(new ComparableStack(ModItems.solinium_igniter, 1), new AStack[] {new OreDictStack("plateTitanium", 4), new ComparableStack(ModItems.wire_advanced_alloy, 2), new ComparableStack(ModItems.circuit_schrabidium, 1), new ComparableStack(ModItems.coil_gold, 1), },400);
makeRecipe(new ComparableStack(ModItems.solinium_core, 1), new AStack[] {new ComparableStack(ModItems.nugget_solinium, 9), new ComparableStack(ModItems.nugget_euphemium, 1), },400);
makeRecipe(new ComparableStack(ModItems.solinium_propellant, 1), new AStack[] {new ComparableStack(Blocks.tnt, 3), new OreDictStack("plateDenseLead", 2), new ComparableStack(ModItems.plate_polymer, 6), new ComparableStack(ModItems.wire_tungsten, 6), new ComparableStack(ModItems.biomass_compressed, 4), },350);
makeRecipe(new ComparableStack(ModItems.schrabidium_hammer, 1), new AStack[] {new ComparableStack(ModBlocks.block_schrabidium, 15), new ComparableStack(ModItems.ingot_polymer, 128), new ComparableStack(Items.nether_star, 3), new ComparableStack(ModItems.fragment_meteorite, 512), },1000);
makeRecipe(new ComparableStack(ModItems.schrabidium_hammer, 1), new AStack[] {new ComparableStack(ModBlocks.block_schrabidium, 35), new ComparableStack(ModItems.billet_yharonite, 128), new ComparableStack(Items.nether_star, 3), new ComparableStack(ModItems.fragment_meteorite, 512), },1000);
makeRecipe(new ComparableStack(ModItems.component_limiter, 1), new AStack[] {new ComparableStack(ModItems.hull_big_steel, 2), new OreDictStack("plateSteel", 32), new OreDictStack("plateTitanium", 18), new ComparableStack(ModItems.plate_desh, 12), new ComparableStack(ModItems.pipes_steel, 4), new ComparableStack(ModItems.circuit_gold, 8), new ComparableStack(ModItems.circuit_schrabidium, 4), new ComparableStack(ModItems.ingot_starmetal, 14), new ComparableStack(ModItems.plate_dalekanium, 5), new ComparableStack(ModItems.powder_magic, 16), new ComparableStack(ModBlocks.fwatz_computer, 3), },2500);
makeRecipe(new ComparableStack(ModItems.component_emitter, 1), new AStack[] {new ComparableStack(ModItems.hull_big_steel, 3), new ComparableStack(ModItems.hull_big_titanium, 2), new OreDictStack("plateSteel", 32), new OreDictStack("plateLead", 24), new ComparableStack(ModItems.plate_desh, 24), new ComparableStack(ModItems.pipes_steel, 8), new ComparableStack(ModItems.circuit_gold, 12), new ComparableStack(ModItems.circuit_schrabidium, 8), new ComparableStack(ModItems.ingot_starmetal, 26), new ComparableStack(ModItems.powder_magic, 48), new ComparableStack(ModBlocks.fwatz_computer, 2), new ComparableStack(ModItems.crystal_xen, 1), },2500);
makeRecipe(new ComparableStack(ModBlocks.ams_limiter, 1), new AStack[] {new ComparableStack(ModItems.component_limiter, 5), new OreDictStack("plateSteel", 64), new OreDictStack("plateTitanium", 128), new ComparableStack(ModItems.plate_dineutronium, 16), new ComparableStack(ModItems.circuit_schrabidium, 6), new ComparableStack(ModItems.pipes_steel, 16), new ComparableStack(ModItems.motor, 12), new ComparableStack(ModItems.coil_advanced_torus, 12), new ComparableStack(ModItems.entanglement_kit, 1), },6000);

View File

@ -191,6 +191,11 @@ public class ShredderRecipes {
ShredderRecipes.setRecipe(ModItems.coil_gold_torus, new ItemStack(ModItems.powder_gold, 2));
ShredderRecipes.setRecipe(ModItems.coil_tungsten, new ItemStack(ModItems.powder_tungsten, 1));
ShredderRecipes.setRecipe(ModItems.coil_magnetized_tungsten, new ItemStack(ModItems.powder_magnetized_tungsten, 1));
ShredderRecipes.setRecipe(ModBlocks.crate_iron, new ItemStack(ModItems.powder_iron, 8));
ShredderRecipes.setRecipe(ModBlocks.crate_steel, new ItemStack(ModItems.powder_steel, 8));
ShredderRecipes.setRecipe(ModBlocks.crate_tungsten, new ItemStack(ModItems.powder_tungsten, 36));
ShredderRecipes.setRecipe(Blocks.anvil, new ItemStack(ModItems.powder_iron, 31));
ShredderRecipes.setRecipe(ModBlocks.chain, new ItemStack(ModItems.powder_steel_tiny, 1));
for(int i = 0; i < 16; i++) {
ShredderRecipes.setRecipe(new ItemStack(Blocks.stained_hardened_clay, 1, i), new ItemStack(Items.clay_ball, 4));

View File

@ -9,70 +9,57 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerCrateSteel extends Container {
private TileEntityCrateSteel diFurnace;
public ContainerCrateSteel(InventoryPlayer invPlayer, TileEntityCrateSteel tedf) {
diFurnace = tedf;
for(int i = 0; i < 6; i++)
{
for(int j = 0; j < 9; j++)
{
for(int i = 0; i < 6; i++) {
for(int j = 0; j < 9; j++) {
this.addSlotToContainer(new Slot(tedf, j + i * 9, 8 + j * 18, 18 + i * 18));
}
}
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 9; j++)
{
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 + (18 * 3) + 2));
}
}
for(int i = 0; i < 9; i++)
{
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + (18 * 3) + 2));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
{
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack())
{
if(var4 != null && var4.getHasStack()) {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (par2 <= diFurnace.getSizeInventory() - 1) {
if (!this.mergeItemStack(var5, diFurnace.getSizeInventory(), this.inventorySlots.size(), true))
{
if(par2 <= diFurnace.getSizeInventory() - 1) {
if(!this.mergeItemStack(var5, diFurnace.getSizeInventory(), this.inventorySlots.size(), true)) {
return null;
}
} else if(!this.mergeItemStack(var5, 0, diFurnace.getSizeInventory(), false)) {
return null;
}
else if (!this.mergeItemStack(var5, 0, diFurnace.getSizeInventory(), false))
{
return null;
}
if (var5.stackSize == 0)
{
if(var5.stackSize == 0) {
var4.putStack((ItemStack) null);
}
else
{
} else {
var4.onSlotChanged();
}
var4.onPickupFromSlot(p_82846_1_, var5);
}
return var3;
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {

View File

@ -0,0 +1,68 @@
package com.hbm.inventory.container;
import com.hbm.tileentity.machine.TileEntityCrateTungsten;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerCrateTungsten extends Container {
private TileEntityCrateTungsten crate;
public ContainerCrateTungsten(InventoryPlayer invPlayer, TileEntityCrateTungsten te) {
crate = te;
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {
this.addSlotToContainer(new Slot(te, j + i * 9, 8 + j * 18, 18 + i * 18));
}
}
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, 32 + i * 18 + (18 * 3)));
}
}
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 90 + (18 * 3)));
}
}
@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 <= crate.getSizeInventory() - 1) {
if(!this.mergeItemStack(var5, crate.getSizeInventory(), this.inventorySlots.size(), true)) {
return null;
}
} else if(!this.mergeItemStack(var5, 0, crate.getSizeInventory(), false)) {
return null;
}
if(var5.stackSize == 0) {
var4.putStack((ItemStack) null);
} else {
var4.onSlotChanged();
}
var4.onPickupFromSlot(p_82846_1_, var5);
}
return var3;
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return crate.isUseableByPlayer(player);
}
}

View File

@ -0,0 +1,48 @@
package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerCrateTungsten;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.TileEntityCrateTungsten;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUICrateTungsten extends GuiContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_crate_tungsten.png");
private static ResourceLocation texture_hot = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_crate_tungsten_hot.png");
private TileEntityCrateTungsten diFurnace;
public GUICrateTungsten(InventoryPlayer invPlayer, TileEntityCrateTungsten tedf) {
super(new ContainerCrateTungsten(invPlayer, tedf));
diFurnace = tedf;
this.xSize = 176;
this.ySize = 168;
}
@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, 0xffffff);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 0xffffff);
}
@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);
if(diFurnace.getWorldObj().getBlockMetadata(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord) == 0)
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
else
Minecraft.getMinecraft().getTextureManager().bindTexture(texture_hot);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
}

View File

@ -16,18 +16,18 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUIMachineCyclotron extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/machine/gui_cyclotron.png");
private TileEntityMachineCyclotron cyclotron;
public GUIMachineCyclotron(InventoryPlayer invPlayer, TileEntityMachineCyclotron tile) {
super(new ContainerMachineCyclotron(invPlayer, tile));
cyclotron = tile;
this.xSize = 176;
this.ySize = 222;
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
@ -37,30 +37,27 @@ public class GUIMachineCyclotron extends GuiInfoContainer {
cyclotron.coolant.renderTankInfo(this, mouseX, mouseY, guiLeft + 53, guiTop + 72, 7, 52);
cyclotron.amat.renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 90, 7, 34);
String[] text = new String[] { "Acceptable upgrades:",
" -Speed (stacks to level 3)",
" -Effectiveness (stacks to level 3)",
" -Power Saving (stacks to level 3)"};
String[] text = new String[] { "Acceptable upgrades:", " -Speed (stacks to level 3)", " -Effectiveness (stacks to level 3)", " -Power Saving (stacks to level 3)" };
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 21, guiTop + 75, 8, 8, mouseX, mouseY, text);
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.cyclotron.hasCustomInventoryName() ? this.cyclotron.getInventoryName() : I18n.format(this.cyclotron.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 mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
if(guiLeft + 97 <= x && guiLeft + 97 + 18 > x && guiTop + 107 < y && guiTop + 107 + 18 >= y) {
super.mouseClicked(x, y, i);
if(guiLeft + 97 <= x && guiLeft + 97 + 18 > x && guiTop + 107 < y && guiTop + 107 + 18 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(cyclotron.xCoord, cyclotron.yCoord, cyclotron.zCoord, 0, 0));
}
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(cyclotron.xCoord, cyclotron.yCoord, cyclotron.zCoord, 0, 0));
}
}
@Override
@ -69,15 +66,15 @@ public class GUIMachineCyclotron extends GuiInfoContainer {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
int k = (int)cyclotron.getPowerScaled(52);
int k = (int) cyclotron.getPowerScaled(52);
drawTexturedModalRect(guiLeft + 80, guiTop + 124 - k, 212, 52 - k, 7, k);
int l = cyclotron.getProgressScaled(36);
drawTexturedModalRect(guiLeft + 52, guiTop + 26, 176, 0, l, 36);
if(cyclotron.isOn)
drawTexturedModalRect(guiLeft + 97, guiTop + 107, 219, 0, 18, 18);
this.drawInfoPanel(guiLeft + 21, guiTop + 75, 8, 8, 8);
Minecraft.getMinecraft().getTextureManager().bindTexture(cyclotron.coolant.getSheet());

View File

@ -7,10 +7,14 @@ import org.lwjgl.opengl.GL11;
import com.hbm.config.WeaponConfig;
import com.hbm.inventory.container.ContainerMachineRadar;
import com.hbm.lib.RefStrings;
import com.hbm.packet.AuxButtonPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.machine.TileEntityMachineRadar;
import com.hbm.util.I18nUtil;
import api.hbm.entity.IRadarDetectable.RadarTargetType;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
@ -34,6 +38,10 @@ public class GUIMachineRadar extends GuiInfoContainer {
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 221, 200, 7, diFurnace.power, diFurnace.maxPower);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 10, guiTop + 103, 8, 8, mouseX, mouseY, I18nUtil.resolveKeyArray("radar.detectMissiles") );
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 10, guiTop + 113, 8, 8, mouseX, mouseY, I18nUtil.resolveKeyArray("radar.detectPlayers"));
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 10, guiTop + 123, 8, 8, mouseX, mouseY, I18nUtil.resolveKeyArray("radar.smartMode"));
if(!diFurnace.nearbyMissiles.isEmpty()) {
for(int[] m : diFurnace.nearbyMissiles) {
int x = guiLeft + (int)((m[0] - diFurnace.xCoord) / ((double)WeaponConfig.radarRange * 2 + 1) * (200D - 8D)) + 108;
@ -52,6 +60,26 @@ public class GUIMachineRadar extends GuiInfoContainer {
}
}
}
@Override
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
if(guiLeft -10 <= x && guiLeft + -10 + 8 > x && guiTop + 103 < y && guiTop + 103 + 8 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord, 0, 0));
}
if(guiLeft -10 <= x && guiLeft + -10 + 8 > x && guiTop + 113 < y && guiTop + 113 + 8 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord, 0, 1));
}
if(guiLeft -10 <= x && guiLeft + -10 + 8 > x && guiTop + 123 < y && guiTop + 123 + 8 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord, 0, 2));
}
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
@ -65,6 +93,16 @@ public class GUIMachineRadar extends GuiInfoContainer {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
drawTexturedModalRect(guiLeft - 14, guiTop + 99, 216, 198, 14, 36);
if(diFurnace.scanMissiles)
drawTexturedModalRect(guiLeft - 10, guiTop + 103, 230, 202, 8, 8);
if(diFurnace.scanPlayers)
drawTexturedModalRect(guiLeft - 10, guiTop + 113, 230, 212, 8, 8);
if(diFurnace.smartMode)
drawTexturedModalRect(guiLeft - 10, guiTop + 123, 230, 222, 8, 8);
if(diFurnace.power > 0) {
int i = (int)diFurnace.getPowerScaled(200);

View File

@ -2190,13 +2190,13 @@ public class ModItems {
ingot_uranium_fuel = new ItemRadioactive(3.5F).setUnlocalizedName("ingot_uranium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_uranium_fuel");
ingot_plutonium_fuel = new ItemRadioactive(3.5F).setUnlocalizedName("ingot_plutonium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_plutonium_fuel");
ingot_mox_fuel = new ItemRadioactive(3.5F).setUnlocalizedName("ingot_mox_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_mox_fuel");
ingot_schrabidium_fuel = new ItemRadioactive(5F).setUnlocalizedName("ingot_schrabidium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_schrabidium_fuel");
ingot_schrabidium_fuel = new ItemRadioactive(5F, false, true).setUnlocalizedName("ingot_schrabidium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_schrabidium_fuel");
ingot_thorium_fuel = new ItemRadioactive(0.5F).setUnlocalizedName("ingot_thorium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_thorium_fuel");
nugget_uranium_fuel = new ItemRadioactive(1F).setUnlocalizedName("nugget_uranium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_uranium_fuel");
nugget_thorium_fuel = new ItemRadioactive(0.025F).setUnlocalizedName("nugget_thorium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_thorium_fuel");
nugget_plutonium_fuel = new ItemRadioactive(1F).setUnlocalizedName("nugget_plutonium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_plutonium_fuel");
nugget_mox_fuel = new ItemRadioactive(1F).setUnlocalizedName("nugget_mox_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_mox_fuel");
nugget_schrabidium_fuel = new ItemRadioactive(1.5F).setUnlocalizedName("nugget_schrabidium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_schrabidium_fuel");
nugget_schrabidium_fuel = new ItemRadioactive(1.5F, false, true).setUnlocalizedName("nugget_schrabidium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_schrabidium_fuel");
ingot_advanced_alloy = new Item().setUnlocalizedName("ingot_advanced_alloy").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_advanced_alloy");
niter = new Item().setUnlocalizedName("niter").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":salpeter");
@ -3495,8 +3495,8 @@ public class ModItems {
gun_dampfmaschine = new GunDampfmaschine().setUnlocalizedName("gun_dampfmaschine").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_dampfmaschine");
gun_darter = new ItemGunDart(GunDartFactory.getDarterConfig()).setFull3D().setUnlocalizedName("gun_darter").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_darter");
ToolMaterial matCrucible = EnumHelper.addToolMaterial("CRUCIBLE", 3, 10000, 50.0F, 100.0F, 200);;
crucible = new ItemCrucible(500, 1F, matCrucible).setUnlocalizedName("crucible").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":crucible");
ToolMaterial matCrucible = EnumHelper.addToolMaterial("CRUCIBLE", 10, 3, 50.0F, 100.0F, 0);
crucible = new ItemCrucible(5000, 1F, matCrucible).setUnlocalizedName("crucible").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":crucible");
grenade_generic = new ItemGrenade(4).setUnlocalizedName("grenade_generic").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_generic");
grenade_strong = new ItemGrenade(5).setUnlocalizedName("grenade_strong").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_strong");

View File

@ -4,11 +4,15 @@ import java.util.List;
import com.hbm.entity.effect.EntityVortex;
import com.hbm.items.ModItems;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
@ -17,6 +21,10 @@ public class ItemLemon extends ItemFood {
public ItemLemon(int p_i45339_1_, float p_i45339_2_, boolean p_i45339_3_) {
super(p_i45339_1_, p_i45339_2_, p_i45339_3_);
if(this == ModItems.med_ipecac || this == ModItems.med_ptsd) {
this.setAlwaysEdible();
}
}
@Override
@ -220,6 +228,13 @@ public class ItemLemon extends ItemFood {
{
if(this == ModItems.med_ipecac || this == ModItems.med_ptsd) {
player.addPotionEffect(new PotionEffect(Potion.hunger.id, 50, 49));
NBTTagCompound nbt = new NBTTagCompound();
nbt.setString("type", "vomit");
nbt.setInteger("entity", player.getEntityId());
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(player.dimension, player.posX, player.posY, player.posZ, 25));
world.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:entity.vomit", 1.0F, 1.0F);
}
if(this == ModItems.med_schizophrenia) {

View File

@ -258,11 +258,11 @@ public class ItemSyringe extends Item {
if(jetpack.getItem() instanceof ItemArmor && ArmorModHandler.hasMods(jetpack)) {
jetpack = ArmorModHandler.pryMods(jetpack)[ArmorModHandler.plate_only];
if(jetpack == null || !(jetpack.getItem() instanceof IPartiallyFillable))
return stack;
}
if(jetpack == null || !(jetpack.getItem() instanceof IPartiallyFillable))
return stack;
IPartiallyFillable fillable = (IPartiallyFillable) jetpack.getItem();
int fill = Math.min(fillable.getFill(jetpack) + 1000, fillable.getMaxFill(jetpack));
fillable.setFill(jetpack, fill);

View File

@ -1,18 +1,29 @@
package com.hbm.items.weapon;
import java.util.List;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import com.hbm.items.IEquipReceiver;
import com.hbm.items.tool.ItemSwordAbility;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
public class ItemCrucible extends ItemSwordAbility implements IEquipReceiver {
@ -27,13 +38,16 @@ public class ItemCrucible extends ItemSwordAbility implements IEquipReceiver {
if(!(player instanceof EntityPlayerMP))
return;
World world = player.worldObj;
world.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:weapon.cDeploy", 1.0F, 1.0F);
NBTTagCompound nbt = new NBTTagCompound();
nbt.setString("type", "anim");
nbt.setString("mode", "crucible");
PacketDispatcher.wrapper.sendTo(new AuxParticlePacketNT(nbt, 0, 0, 0), (EntityPlayerMP)player);
if(player.getHeldItem() != null && player.getHeldItem().getItemDamage() < player.getHeldItem().getMaxDamage()) {
World world = player.worldObj;
world.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:weapon.cDeploy", 1.0F, 1.0F);
NBTTagCompound nbt = new NBTTagCompound();
nbt.setString("type", "anim");
nbt.setString("mode", "crucible");
PacketDispatcher.wrapper.sendTo(new AuxParticlePacketNT(nbt, 0, 0, 0), (EntityPlayerMP)player);
}
}
@Override
@ -42,6 +56,13 @@ public class ItemCrucible extends ItemSwordAbility implements IEquipReceiver {
if(!(entityLiving instanceof EntityPlayerMP))
return false;
if(entityLiving instanceof EntityPlayer && ((EntityPlayer)entityLiving).getDisplayName().equals("Tankish")) {
stack.setItemDamage(0);
}
if(stack.getItemDamage() >= stack.getMaxDamage())
return false;
NBTTagCompound nbt = new NBTTagCompound();
nbt.setString("type", "anim");
nbt.setString("mode", "cSwing");
@ -52,22 +73,62 @@ public class ItemCrucible extends ItemSwordAbility implements IEquipReceiver {
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase victim, EntityLivingBase attacker) {
attacker.worldObj.playSoundEffect(victim.posX, victim.posY, victim.posZ, "mob.zombie.woodbreak", 1.0F, 0.75F + victim.getRNG().nextFloat() * 0.2F);
if(!attacker.worldObj.isRemote && !victim.isEntityAlive()) {
int count = Math.min((int)Math.ceil(victim.getMaxHealth() / 3D), 250);
boolean active = stack.getItemDamage() < stack.getMaxDamage();
if(active) {
attacker.worldObj.playSoundEffect(victim.posX, victim.posY, victim.posZ, "mob.zombie.woodbreak", 1.0F, 0.75F + victim.getRNG().nextFloat() * 0.2F);
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaburst");
data.setInteger("count", count * 4);
data.setDouble("motion", 0.1D);
data.setString("mode", "blockdust");
data.setInteger("block", Block.getIdFromBlock(Blocks.redstone_block));
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, victim.posX, victim.posY + victim.height * 0.5, victim.posZ), new TargetPoint(victim.dimension, victim.posX, victim.posY + victim.height * 0.5, victim.posZ, 50));
if(!attacker.worldObj.isRemote && !victim.isEntityAlive()) {
int count = Math.min((int)Math.ceil(victim.getMaxHealth() / 3D), 250);
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaburst");
data.setInteger("count", count * 4);
data.setDouble("motion", 0.1D);
data.setString("mode", "blockdust");
data.setInteger("block", Block.getIdFromBlock(Blocks.redstone_block));
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, victim.posX, victim.posY + victim.height * 0.5, victim.posZ), new TargetPoint(victim.dimension, victim.posX, victim.posY + victim.height * 0.5, victim.posZ, 50));
}
if(attacker instanceof EntityPlayer && ((EntityPlayer)attacker).getDisplayName().equals("Tankish"))
return true;
return super.hitEntity(stack, victim, attacker);
} else {
if(!attacker.worldObj.isRemote && attacker instanceof EntityPlayer)
((EntityPlayer)attacker).addChatComponentMessage(new ChatComponentText("Not enough energy.").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
return false;
}
}
public Multimap getAttributeModifiers(ItemStack stack) {
Multimap multimap = HashMultimap.create();
if(stack.getItemDamage() < stack.getMaxDamage()) {
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", (double) this.damage, 0));
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", movement, 1));
}
return super.hitEntity(stack, victim, attacker);
return multimap;
}
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
String charge = EnumChatFormatting.RED + "Charge [";
for(int i = 2; i >= 0; i--)
if(stack.getItemDamage() <= i)
charge += "||||||";
else
charge += " ";
charge += "]";
list.add(charge);
}
}

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

View File

@ -246,6 +246,7 @@ public class CraftingManager {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_converter_rf_he, 1), new Object[] { "SSS", "BRC", "SSS", 'S', ModItems.ingot_beryllium, 'C', ModItems.coil_copper, 'R', ModItems.coil_copper_torus, 'B', "blockRedstone" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.crate_iron, 1), new Object[] { "PPP", "I I", "III", 'P', "plateIron", 'I', "ingotIron" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.crate_steel, 1), new Object[] { "PPP", "I I", "III", 'P', "plateSteel", 'I', "ingotSteel" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.crate_tungsten, 1), new Object[] { "BPB", "PCP", "BPB", 'B', "blockTungsten", 'P', ModItems.board_copper, 'C', ModBlocks.crate_steel }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.safe, 1), new Object[] { "LAL", "ACA", "LAL", 'L', "plateLead", 'A', "plateAdvanced", 'C', ModBlocks.crate_steel }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_waste_drum, 1), new Object[] { "LRL", "BRB", "LRL", 'L', "ingotLead", 'B', Blocks.iron_bars, 'R', ModItems.rod_quad_empty }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_press, 1), new Object[] { "IRI", "IPI", "IBI", 'I', "ingotIron", 'R', Blocks.furnace, 'B', "blockIron", 'P', Blocks.piston }));

View File

@ -448,6 +448,7 @@ public class MainRegistry {
GameRegistry.registerTileEntity(TileEntitySolarMirror.class, "tileentity_solarmirror");
GameRegistry.registerTileEntity(TileEntityMachineDetector.class, "tileentity_he_detector");
GameRegistry.registerTileEntity(TileEntityFireworks.class, "tileentity_firework_box");
GameRegistry.registerTileEntity(TileEntityCrateTungsten.class, "tileentity_crate_hot");
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);

View File

@ -247,7 +247,7 @@ public class ModEventHandlerClient {
}
}
//because armor thatisn't ItemArmor doesn't render at all
//because armor that isn't ItemArmor doesn't render at all
if(armor != null && armor.getItem() instanceof JetpackBase) {
((ItemArmorMod)armor.getItem()).modRender(event, armor);
}

View File

@ -5,6 +5,7 @@ import com.hbm.entity.mob.EntityDuck;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.items.weapon.ItemMissile.PartSize;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.tileentity.TileEntityTickingBase;
import com.hbm.tileentity.bomb.TileEntityLaunchTable;
import com.hbm.tileentity.machine.TileEntityBarrel;
import com.hbm.tileentity.machine.TileEntityCoreEmitter;
@ -276,6 +277,10 @@ public class AuxButtonPacket implements IMessage {
TileEntityMachineBase base = (TileEntityMachineBase)te;
base.handleButtonPacket(m.value, m.id);
}
if(te instanceof TileEntityTickingBase) {
TileEntityTickingBase base = (TileEntityTickingBase)te;
base.handleButtonPacket(m.value, m.id);
}
//why make new packets when you can just abuse and uglify the existing ones?
if(te == null && m.value == 999) {

View File

@ -2,20 +2,16 @@ package com.hbm.render.item.weapon;
import org.lwjgl.opengl.GL11;
import com.hbm.items.ModItems;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
import cpw.mods.fml.relauncher.ReflectionHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
public class ItemRenderCrucible implements IItemRenderer {
@ -45,6 +41,8 @@ public class ItemRenderCrucible implements IItemRenderer {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
GL11.glShadeModel(GL11.GL_SMOOTH);
boolean isOn = item.getItemDamage() < item.getMaxDamage();
switch(type) {
case EQUIPPED_FIRST_PERSON:
@ -56,11 +54,23 @@ public class ItemRenderCrucible implements IItemRenderer {
player.isSwingInProgress = false;
float prevEq = ReflectionHelper.getPrivateValue(ItemRenderer.class, Minecraft.getMinecraft().entityRenderer.itemRenderer, "prevEquippedProgress", "field_78451_d");
float eq = ReflectionHelper.getPrivateValue(ItemRenderer.class, Minecraft.getMinecraft().entityRenderer.itemRenderer, "equippedProgress", "field_78454_c");
if(eq < prevEq) {
ReflectionHelper.setPrivateValue(ItemRenderer.class, Minecraft.getMinecraft().entityRenderer.itemRenderer, 0.0F, "prevEquippedProgress", "field_78451_d");
ReflectionHelper.setPrivateValue(ItemRenderer.class, Minecraft.getMinecraft().entityRenderer.itemRenderer, 0.0F, "equippedProgress", "field_78454_c");
} else if(eq > prevEq) {
ReflectionHelper.setPrivateValue(ItemRenderer.class, Minecraft.getMinecraft().entityRenderer.itemRenderer, 1.0F, "prevEquippedProgress", "field_78451_d");
ReflectionHelper.setPrivateValue(ItemRenderer.class, Minecraft.getMinecraft().entityRenderer.itemRenderer, 1.0F, "equippedProgress", "field_78454_c");
}
GL11.glScaled(0.3, 0.3, 0.3);
GL11.glRotated(45, 0, 0, 1);
GL11.glRotated(90, 0, 1, 0);
boolean isSwing = false;
if(!player.isBlocking()) {
double[] sRot = HbmAnimations.getRelevantTransformation("SWING_ROT");
@ -69,6 +79,9 @@ public class ItemRenderCrucible implements IItemRenderer {
GL11.glRotated(sRot[0], 1, 0, 0);
GL11.glRotated(sRot[2], 0, 0, 1);
GL11.glRotated(sRot[1], 0, 1, 0);
if(sRot[0] != 0)
isSwing = true;
}
double[] rot = HbmAnimations.getRelevantTransformation("GUARD_ROT");
@ -76,27 +89,26 @@ public class ItemRenderCrucible implements IItemRenderer {
ResourceManager.crucible.renderPart("Hilt");
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.crucible_guard);
double rotGuard = rot[0];
if(!isSwing && !isOn)
rotGuard = 90;
GL11.glPushMatrix();
if(rot[2] == 1) {
GL11.glTranslated(0, 3, 0.5);
GL11.glRotated(rot[0], -1, 0, 0);
GL11.glRotated(rotGuard, -1, 0, 0);
GL11.glTranslated(0, -3, -0.5);
}
ResourceManager.crucible.renderPart("GuardLeft");
GL11.glPopMatrix();
GL11.glPushMatrix();
if(rot[2] == 1) {
GL11.glTranslated(0, 3, -0.5);
GL11.glRotated(rot[0], 1, 0, 0);
GL11.glRotated(rotGuard, 1, 0, 0);
GL11.glTranslated(0, -3, 0.5);
}
ResourceManager.crucible.renderPart("GuardRight");
GL11.glPopMatrix();
float equippedProgress = ReflectionHelper.getPrivateValue(ItemRenderer.class, Minecraft.getMinecraft().entityRenderer.itemRenderer, "equippedProgress", "field_78454_c");
if(equippedProgress == 1.0F && rot[2] == 0) {
if(eq == 1.0F && prevEq == 1.0F && rot[2] == 0 && (isSwing || isOn)) {
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
@ -127,22 +139,35 @@ public class ItemRenderCrucible implements IItemRenderer {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.crucible_hilt);
ResourceManager.crucible.renderPart("Hilt");
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.crucible_guard);
ResourceManager.crucible.renderPart("GuardLeft");
ResourceManager.crucible.renderPart("GuardRight");
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
GL11.glTranslated(0.005, 0, 0);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.crucible_blade);
ResourceManager.crucible.renderPart("Blade");
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopAttrib();
GL11.glTranslated(0, 3, 0.5);
GL11.glRotated(isOn ? 0 : 90, -1, 0, 0);
GL11.glTranslated(0, -3, -0.5);
ResourceManager.crucible.renderPart("GuardLeft");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 3, -0.5);
GL11.glRotated(isOn ? 0 : 90, 1, 0, 0);
GL11.glTranslated(0, -3, 0.5);
ResourceManager.crucible.renderPart("GuardRight");
GL11.glPopMatrix();
if(isOn) {
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
GL11.glTranslated(0.005, 0, 0);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.crucible_blade);
ResourceManager.crucible.renderPart("Blade");
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopAttrib();
GL11.glPopMatrix();
}
break;
case INVENTORY:
@ -156,11 +181,24 @@ public class ItemRenderCrucible implements IItemRenderer {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.crucible_hilt);
ResourceManager.crucible.renderPart("Hilt");
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.crucible_guard);
GL11.glPushMatrix();
GL11.glTranslated(0, 3, 0.5);
GL11.glRotated(isOn ? 0 : 90, -1, 0, 0);
GL11.glTranslated(0, -3, -0.5);
ResourceManager.crucible.renderPart("GuardLeft");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 3, -0.5);
GL11.glRotated(isOn ? 0 : 90, 1, 0, 0);
GL11.glTranslated(0, -3, 0.5);
ResourceManager.crucible.renderPart("GuardRight");
GL11.glPopMatrix();
GL11.glTranslated(0.005, 0, 0);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.crucible_blade);
ResourceManager.crucible.renderPart("Blade");
if(isOn) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.crucible_blade);
ResourceManager.crucible.renderPart("Blade");
}
break;
default: break;

View File

@ -1,12 +1,10 @@
package com.hbm.sound;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.MovingSound;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.util.ResourceLocation;
@ -18,7 +16,7 @@ public class AudioDynamic extends MovingSound {
protected AudioDynamic(ResourceLocation loc) {
super(loc);
this.repeat = true;
this.field_147666_i = ISound.AttenuationType.NONE;
this.field_147666_i = ISound.AttenuationType.LINEAR;
this.intendedVolume = 10;
}

View File

@ -32,4 +32,6 @@ public abstract class TileEntityTickingBase extends TileEntity {
}
public void networkUnpack(NBTTagCompound nbt) { }
public void handleButtonPacket(int value, int meta) { }
}

View File

@ -281,24 +281,24 @@ public class TileEntityNukeCustom extends TileEntity implements ISidedInventory
if(ent.entry == EnumEntryType.ADD) {
switch(ent.type) {
case TNT: tnt += ent.value; break;
case NUKE: nuke += ent.value; break;
case HYDRO: hydro += ent.value; break;
case AMAT: amat += ent.value; break;
case DIRTY: dirty += ent.value; break;
case SCHRAB: schrab += ent.value; break;
case EUPH: euph += ent.value; break;
case TNT: tnt += ent.value * stack.stackSize; break;
case NUKE: nuke += ent.value * stack.stackSize; break;
case HYDRO: hydro += ent.value * stack.stackSize; break;
case AMAT: amat += ent.value * stack.stackSize; break;
case DIRTY: dirty += ent.value * stack.stackSize; break;
case SCHRAB: schrab += ent.value * stack.stackSize; break;
case EUPH: euph += ent.value * stack.stackSize; break;
}
} else if(ent.entry == EnumEntryType.MULT) {
switch(ent.type) {
case TNT: tntMod *= ent.value; break;
case NUKE: nukeMod *= ent.value; break;
case HYDRO: hydroMod *= ent.value; break;
case AMAT: amatMod *= ent.value; break;
case DIRTY: dirtyMod *= ent.value; break;
case SCHRAB: schrabMod *= ent.value; break;
case TNT: tntMod *= ent.value * stack.stackSize; break;
case NUKE: nukeMod *= ent.value * stack.stackSize; break;
case HYDRO: hydroMod *= ent.value * stack.stackSize; break;
case AMAT: amatMod *= ent.value * stack.stackSize; break;
case DIRTY: dirtyMod *= ent.value * stack.stackSize; break;
case SCHRAB: schrabMod *= ent.value * stack.stackSize; break;
}
}
}

View File

@ -0,0 +1,236 @@
package com.hbm.tileentity.machine;
import com.hbm.interfaces.ILaserable;
import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityCrateTungsten extends TileEntityLockableBase implements ISidedInventory, ILaserable {
private ItemStack slots[];
private String customName;
private int heatTimer;
public TileEntityCrateTungsten() {
slots = new ItemStack[27];
}
@Override
public int getSizeInventory() {
return slots.length;
}
@Override
public ItemStack getStackInSlot(int i) {
return slots[i];
}
@Override
public ItemStack getStackInSlotOnClosing(int i) {
if (slots[i] != null) {
ItemStack itemStack = slots[i];
slots[i] = null;
return itemStack;
} else {
return null;
}
}
@Override
public void setInventorySlotContents(int i, ItemStack itemStack) {
slots[i] = itemStack;
if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) {
itemStack.stackSize = getInventoryStackLimit();
}
}
@Override
public String getInventoryName() {
return this.hasCustomInventoryName() ? this.customName : "container.crateTungsten";
}
@Override
public boolean hasCustomInventoryName() {
return this.customName != null && this.customName.length() > 0;
}
public void setCustomName(String name) {
this.customName = name;
}
@Override
public int getInventoryStackLimit() {
return 64;
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
return false;
} else {
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
}
}
// You scrubs aren't needed for anything (right now)
@Override
public void openInventory() {
}
@Override
public void closeInventory() {
}
@Override
public boolean isItemValidForSlot(int i, ItemStack stack) {
return true;
}
@Override
public ItemStack decrStackSize(int i, int j) {
if (slots[i] != null) {
if (slots[i].stackSize <= j) {
ItemStack itemStack = slots[i];
slots[i] = null;
return itemStack;
}
ItemStack itemStack1 = slots[i].splitStack(j);
if (slots[i].stackSize == 0) {
slots[i] = null;
}
return itemStack1;
} else {
return null;
}
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
if(heatTimer > 0)
heatTimer--;
if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) != 1 && heatTimer > 0)
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 3);
if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) != 0 && heatTimer <= 0)
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 3);
}
if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 1) {
worldObj.spawnParticle("flame", xCoord + worldObj.rand.nextDouble(), yCoord + 1.1, zCoord + worldObj.rand.nextDouble(), 0.0, 0.0, 0.0);
worldObj.spawnParticle("smoke", xCoord + worldObj.rand.nextDouble(), yCoord + 1.1, zCoord + worldObj.rand.nextDouble(), 0.0, 0.0, 0.0);
worldObj.spawnParticle("flame", xCoord - 0.1, yCoord + worldObj.rand.nextDouble(), zCoord + worldObj.rand.nextDouble(), 0.0, 0.0, 0.0);
worldObj.spawnParticle("smoke", xCoord - 0.1, yCoord + worldObj.rand.nextDouble(), zCoord + worldObj.rand.nextDouble(), 0.0, 0.0, 0.0);
worldObj.spawnParticle("flame", xCoord + 1.1, yCoord + worldObj.rand.nextDouble(), zCoord + worldObj.rand.nextDouble(), 0.0, 0.0, 0.0);
worldObj.spawnParticle("smoke", xCoord + 1.1, yCoord + worldObj.rand.nextDouble(), zCoord + worldObj.rand.nextDouble(), 0.0, 0.0, 0.0);
worldObj.spawnParticle("flame", xCoord + worldObj.rand.nextDouble(), yCoord + worldObj.rand.nextDouble(), zCoord - 0.1, 0.0, 0.0, 0.0);
worldObj.spawnParticle("smoke", xCoord + worldObj.rand.nextDouble(), yCoord + worldObj.rand.nextDouble(), zCoord - 0.1, 0.0, 0.0, 0.0);
worldObj.spawnParticle("flame", xCoord + worldObj.rand.nextDouble(), yCoord + worldObj.rand.nextDouble(), zCoord + 1.1, 0.0, 0.0, 0.0);
worldObj.spawnParticle("smoke", xCoord + worldObj.rand.nextDouble(), yCoord + worldObj.rand.nextDouble(), zCoord + 1.1, 0.0, 0.0, 0.0);
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10);
slots = new ItemStack[getSizeInventory()];
for (int i = 0; i < list.tagCount(); i++) {
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if (b0 >= 0 && b0 < slots.length) {
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
for (int i = 0; i < slots.length; i++) {
if (slots[i] != null) {
NBTTagCompound nbt1 = new NBTTagCompound();
nbt1.setByte("slot", (byte) i);
slots[i].writeToNBT(nbt1);
list.appendTag(nbt1);
}
}
nbt.setTag("items", list);
}
@Override
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
int[] slots = new int[27];
for(int i = 0; i < slots.length; i++)
slots[i] = i;
return slots;
}
@Override
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
return this.isItemValidForSlot(i, itemStack) && !this.isLocked();
}
@Override
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
if(this.isLocked())
return false;
if(itemStack.getItem() == ModItems.billet_polonium)
return false;
if(itemStack.getItem() == ModItems.crucible && itemStack.getItemDamage() > 0)
return false;
if(FurnaceRecipes.smelting().getSmeltingResult(itemStack) == null)
return true;
return false;
}
@Override
public void addEnergy(long energy, ForgeDirection dir) {
heatTimer = 5;
for(int i = 0; i < slots.length; i++) {
if(slots[i] == null)
continue;
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(slots[i]);
if(slots[i].getItem() == ModItems.billet_polonium && energy > 10000000)
result = new ItemStack(ModItems.billet_yharonite);
if(slots[i].getItem() == ModItems.crucible && slots[i].getItemDamage() > 0 && energy > 10000000)
result = new ItemStack(ModItems.crucible, 1, 0);
int size = slots[i].stackSize;
if(result != null && result.stackSize * size <= result.getMaxStackSize()) {
slots[i] = result.copy();
slots[i].stackSize *= size;
}
}
}
}

View File

@ -22,10 +22,15 @@ import net.minecraft.util.AxisAlignedBB;
@Untested
public class TileEntityMachineRadar extends TileEntityTickingBase implements IConsumer {
public List<Entity> entList = new ArrayList();
public List<int[]> nearbyMissiles = new ArrayList();
int pingTimer = 0;
int lastPower;
final static int maxTimer = 80;
public boolean scanMissiles = true;
public boolean scanPlayers = true;
public boolean smartMode = true;
public float prevRotation;
public float rotation;
@ -38,28 +43,12 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements ICo
return "";
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
power = nbt.getLong("power");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setLong("power", power);
}
@Override
public void updateEntity() {
if(this.yCoord < WeaponConfig.radarAltitude)
return;
int lastPower = getRedPower();
if(!worldObj.isRemote) {
nearbyMissiles.clear();
@ -73,10 +62,11 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements ICo
power = 0;
}
if(lastPower != getRedPower())
if(this.lastPower != getRedPower())
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
sendMissileData();
lastPower = getRedPower();
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) != ModBlocks.muffler) {
@ -102,36 +92,53 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements ICo
}
}
public void handleButtonPacket(int value, int meta) {
switch(meta) {
case 0: this.scanMissiles = !this.scanMissiles; break;
case 1: this.scanPlayers = !this.scanPlayers; break;
case 2: this.smartMode = !this.smartMode; break;
}
}
private void allocateMissiles() {
nearbyMissiles.clear();
entList.clear();
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord + 0.5 - WeaponConfig.radarRange, 0, zCoord + 0.5 - WeaponConfig.radarRange, xCoord + 0.5 + WeaponConfig.radarRange, 5000, zCoord + 0.5 + WeaponConfig.radarRange));
for(Entity e : list) {
if(e.posY < yCoord + WeaponConfig.radarBuffer)
continue;
if(e instanceof EntityPlayer && e.posY >= yCoord + WeaponConfig.radarBuffer) {
if(e instanceof EntityPlayer && this.scanPlayers) {
nearbyMissiles.add(new int[] { (int)e.posX, (int)e.posZ, RadarTargetType.PLAYER.ordinal(), (int)e.posY });
entList.add(e);
}
if(e instanceof IRadarDetectable && e.posY >= yCoord + WeaponConfig.radarBuffer) {
if(e instanceof IRadarDetectable && this.scanMissiles) {
nearbyMissiles.add(new int[] { (int)e.posX, (int)e.posZ, ((IRadarDetectable)e).getTargetType().ordinal(), (int)e.posY });
if(!this.smartMode || e.motionY <= 0)
entList.add(e);
}
}
}
public int getRedPower() {
if(!nearbyMissiles.isEmpty()) {
if(!entList.isEmpty()) {
double maxRange = WeaponConfig.radarRange * Math.sqrt(2D);
int power = 0;
for(int i = 0; i < nearbyMissiles.size(); i++) {
for(int i = 0; i < entList.size(); i++) {
int[] j = nearbyMissiles.get(i);
double dist = Math.sqrt(Math.pow(j[0] - xCoord, 2) + Math.pow(j[1] - zCoord, 2));
Entity e = entList.get(i);
double dist = Math.sqrt(Math.pow(e.posX - xCoord, 2) + Math.pow(e.posZ - zCoord, 2));
int p = 15 - (int)Math.floor(dist / maxRange * 15);
if(p > power)
@ -148,6 +155,9 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements ICo
NBTTagCompound data = new NBTTagCompound();
data.setLong("power", power);
data.setBoolean("scanMissiles", scanMissiles);
data.setBoolean("scanPlayers", scanPlayers);
data.setBoolean("smartMode", smartMode);
data.setInteger("count", this.nearbyMissiles.size());
for(int i = 0; i < this.nearbyMissiles.size(); i++) {
@ -164,6 +174,9 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements ICo
this.nearbyMissiles.clear();
this.power = data.getLong("power");
this.scanMissiles = data.getBoolean("scanMissiles");
this.scanPlayers = data.getBoolean("scanPlayers");
this.smartMode = data.getBoolean("smartMode");
int count = data.getInteger("count");
@ -196,6 +209,24 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements ICo
public long getMaxPower() {
return maxPower;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.power = nbt.getLong("power");
this.scanMissiles = nbt.getBoolean("scanMissiles");
this.scanPlayers = nbt.getBoolean("scanPlayers");
this.smartMode = nbt.getBoolean("smartMode");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setLong("power", power);
nbt.setBoolean("scanMissiles", scanMissiles);
nbt.setBoolean("scanPlayers", scanPlayers);
nbt.setBoolean("smartMode", smartMode);
}
@Override
public AxisAlignedBB getRenderBoundingBox() {

View File

@ -222,7 +222,21 @@ public class TileEntityMachineReactorSmall extends TileEntity implements ISidedI
@Override
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
if(i == 0 || i == 1 || i == 2 || i == 3 || i == 4 || i == 5 || i == 6 || i == 7 || i == 8 || i == 9 || i == 10 || i == 11)
if(itemStack.getItem() == ModItems.rod_uranium_fuel_depleted || itemStack.getItem() == ModItems.rod_dual_uranium_fuel_depleted || itemStack.getItem() == ModItems.rod_quad_uranium_fuel_depleted || itemStack.getItem() == ModItems.rod_plutonium_fuel_depleted || itemStack.getItem() == ModItems.rod_dual_plutonium_fuel_depleted || itemStack.getItem() == ModItems.rod_quad_plutonium_fuel_depleted || itemStack.getItem() == ModItems.rod_mox_fuel_depleted || itemStack.getItem() == ModItems.rod_dual_mox_fuel_depleted || itemStack.getItem() == ModItems.rod_quad_mox_fuel_depleted || itemStack.getItem() == ModItems.rod_schrabidium_fuel_depleted || itemStack.getItem() == ModItems.rod_dual_schrabidium_fuel_depleted || itemStack.getItem() == ModItems.rod_quad_schrabidium_fuel_depleted)
if(itemStack.getItem() == ModItems.rod_uranium_fuel_depleted ||
itemStack.getItem() == ModItems.rod_dual_uranium_fuel_depleted ||
itemStack.getItem() == ModItems.rod_quad_uranium_fuel_depleted ||
itemStack.getItem() == ModItems.rod_thorium_fuel_depleted ||
itemStack.getItem() == ModItems.rod_dual_thorium_fuel_depleted ||
itemStack.getItem() == ModItems.rod_quad_thorium_fuel_depleted ||
itemStack.getItem() == ModItems.rod_plutonium_fuel_depleted ||
itemStack.getItem() == ModItems.rod_dual_plutonium_fuel_depleted ||
itemStack.getItem() == ModItems.rod_quad_plutonium_fuel_depleted ||
itemStack.getItem() == ModItems.rod_mox_fuel_depleted ||
itemStack.getItem() == ModItems.rod_dual_mox_fuel_depleted ||
itemStack.getItem() == ModItems.rod_quad_mox_fuel_depleted ||
itemStack.getItem() == ModItems.rod_schrabidium_fuel_depleted ||
itemStack.getItem() == ModItems.rod_dual_schrabidium_fuel_depleted ||
itemStack.getItem() == ModItems.rod_quad_schrabidium_fuel_depleted)
return true;
if(i == 13 || i == 15)
if(itemStack.getItem() == Items.bucket || itemStack.getItem() == ModItems.rod_empty || itemStack.getItem() == ModItems.rod_dual_empty || itemStack.getItem() == ModItems.rod_quad_empty || itemStack.getItem() == ModItems.fluid_tank_empty || itemStack.getItem() == ModItems.fluid_barrel_empty)

View File

@ -9,7 +9,6 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;

View File

@ -3,7 +3,7 @@
"modid": "hbm",
"name": "Hbm's Nuclear Tech",
"description": "A mod that adds weapons, nuclear themed stuff and machines",
"version":"1.0.27-3773",
"version":"1.0.27-3781",
"mcversion": "1.7.10",
"url": "",
"updateUrl": "",