Siren, taint, dynosphere textures
@ -280,6 +280,8 @@ tile.crate_steel.name=Stahlkiste
|
|||||||
container.crateSteel=Stahlkiste
|
container.crateSteel=Stahlkiste
|
||||||
tile.machine_press.name=Dampfpresse
|
tile.machine_press.name=Dampfpresse
|
||||||
container.press=Dampfpresse
|
container.press=Dampfpresse
|
||||||
|
tile.machine_siren.name=Sirene
|
||||||
|
container.siren=Sirene
|
||||||
|
|
||||||
tile.red_pylon.name=Strommasten
|
tile.red_pylon.name=Strommasten
|
||||||
item.wiring_red_copper.name=Kabeltrommel
|
item.wiring_red_copper.name=Kabeltrommel
|
||||||
@ -349,6 +351,7 @@ item.template_folder.name=Produktionsvorlagen-Zeichenmappe
|
|||||||
item.fluid_identifier.name=Flüssigkeits-Kennzeichnung
|
item.fluid_identifier.name=Flüssigkeits-Kennzeichnung
|
||||||
item.assembly_template.name=Fertigungsvorlage:
|
item.assembly_template.name=Fertigungsvorlage:
|
||||||
item.chemistry_template.name=Chemievorlage:
|
item.chemistry_template.name=Chemievorlage:
|
||||||
|
item.siren_track.name=Sirenentrack
|
||||||
|
|
||||||
item.fuse.name=Sicherung
|
item.fuse.name=Sicherung
|
||||||
|
|
||||||
@ -949,6 +952,7 @@ item.gun_spark.name=Die Zündkerze
|
|||||||
item.gun_hp.name=HPP Lazerjet
|
item.gun_hp.name=HPP Lazerjet
|
||||||
item.gun_euthanasia.name=Euthanasia
|
item.gun_euthanasia.name=Euthanasia
|
||||||
item.gun_defabricator.name=Defabrikator
|
item.gun_defabricator.name=Defabrikator
|
||||||
|
item.gun_dampfmaschine.name=Garantiert keine Scherzwaffe
|
||||||
|
|
||||||
item.gun_revolver_iron_ammo.name=Patrone
|
item.gun_revolver_iron_ammo.name=Patrone
|
||||||
item.gun_revolver_ammo.name=Bleipatrone
|
item.gun_revolver_ammo.name=Bleipatrone
|
||||||
|
|||||||
@ -280,6 +280,8 @@ tile.crate_steel.name=Steel Crate
|
|||||||
container.crateSteel=Steel Crate
|
container.crateSteel=Steel Crate
|
||||||
tile.machine_press.name=Steam Press
|
tile.machine_press.name=Steam Press
|
||||||
container.press=Steam Press
|
container.press=Steam Press
|
||||||
|
tile.machine_siren.name=Siren
|
||||||
|
container.siren=Siren
|
||||||
|
|
||||||
tile.red_pylon.name=Electricity Pole
|
tile.red_pylon.name=Electricity Pole
|
||||||
item.wiring_red_copper.name=Cable Drum
|
item.wiring_red_copper.name=Cable Drum
|
||||||
@ -349,6 +351,7 @@ item.template_folder.name=Machine Template Folder
|
|||||||
item.fluid_identifier.name=Fluid Identifier
|
item.fluid_identifier.name=Fluid Identifier
|
||||||
item.assembly_template.name=Assembly Template:
|
item.assembly_template.name=Assembly Template:
|
||||||
item.chemistry_template.name=Chemistry Template:
|
item.chemistry_template.name=Chemistry Template:
|
||||||
|
item.siren_track.name=Siren Track
|
||||||
|
|
||||||
item.fuse.name=Fuse
|
item.fuse.name=Fuse
|
||||||
|
|
||||||
@ -952,6 +955,7 @@ item.gun_spark.name=Spark Plug
|
|||||||
item.gun_hp.name=HPP Lazerjet
|
item.gun_hp.name=HPP Lazerjet
|
||||||
item.gun_euthanasia.name=Euthanasia
|
item.gun_euthanasia.name=Euthanasia
|
||||||
item.gun_defabricator.name=Defabricator
|
item.gun_defabricator.name=Defabricator
|
||||||
|
item.gun_dampfmaschine.name=Totally Not a Joke Weapon
|
||||||
|
|
||||||
item.gun_revolver_iron_ammo.name=Bullet
|
item.gun_revolver_iron_ammo.name=Bullet
|
||||||
item.gun_revolver_ammo.name=Lead Bullet
|
item.gun_revolver_ammo.name=Lead Bullet
|
||||||
|
|||||||
@ -65,6 +65,15 @@
|
|||||||
"entity.chopperCrashingLoop": {"category": "hostile", "sounds": [{"name": "entity/chopperCrashingLoop", "stream": true}]},
|
"entity.chopperCrashingLoop": {"category": "hostile", "sounds": [{"name": "entity/chopperCrashingLoop", "stream": true}]},
|
||||||
"entity.oldExplosion": {"category": "ambient", "sounds": [{"name": "entity/oldExplosion", "stream": false}]},
|
"entity.oldExplosion": {"category": "ambient", "sounds": [{"name": "entity/oldExplosion", "stream": false}]},
|
||||||
|
|
||||||
"alarm.trainHorn": {"category": "record", "sounds": [{"name": "alarm/trainHorn", "stream": false}]},
|
"alarm.amsSiren": {"category": "record", "sounds": [{"name": "alarm/amsSiren", "stream": false}]},
|
||||||
"alarm.razortrainHorn": {"category": "record", "sounds": [{"name": "alarm/razortrainHorn", "stream": false}]}
|
"alarm.apcLoop": {"category": "record", "sounds": [{"name": "alarm/apcLoop", "stream": false}]},
|
||||||
|
"alarm.apcPass": {"category": "record", "sounds": [{"name": "alarm/apcPass", "stream": false}]},
|
||||||
|
"alarm.bankAlarm": {"category": "record", "sounds": [{"name": "alarm/bankAlarm", "stream": false}]},
|
||||||
|
"alarm.beepSiren": {"category": "record", "sounds": [{"name": "alarm/beepSiren", "stream": false}]},
|
||||||
|
"alarm.autopilot": {"category": "record", "sounds": [{"name": "alarm/boeing707AutopilotDisconnected", "stream": false}]},
|
||||||
|
"alarm.containerAlarm": {"category": "record", "sounds": [{"name": "alarm/containerAlarm", "stream": false}]},
|
||||||
|
"alarm.hatch": {"category": "record", "sounds": [{"name": "alarm/lpfhaiwg", "stream": false}]},
|
||||||
|
"alarm.razortrainHorn": {"category": "record", "sounds": [{"name": "alarm/razortrainHorn", "stream": false}]},
|
||||||
|
"alarm.sweepSiren": {"category": "record", "sounds": [{"name": "alarm/sweepSiren", "stream": false}]},
|
||||||
|
"alarm.trainHorn": {"category": "record", "sounds": [{"name": "alarm/trainHorn", "stream": false}]}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
assets/hbm/sounds/alarm/amsSiren.ogg
Normal file
BIN
assets/hbm/sounds/alarm/apcLoop.ogg
Normal file
BIN
assets/hbm/sounds/alarm/apcPass.ogg
Normal file
BIN
assets/hbm/sounds/alarm/bankAlarm.ogg
Normal file
BIN
assets/hbm/sounds/alarm/beepSiren.ogg
Normal file
BIN
assets/hbm/sounds/alarm/containerAlarm.ogg
Normal file
BIN
assets/hbm/sounds/alarm/lpfhaiwg.ogg
Normal file
BIN
assets/hbm/sounds/alarm/sweepSiren.ogg
Normal file
BIN
assets/hbm/textures/blocks/machine_siren.png
Normal file
|
After Width: | Height: | Size: 377 B |
|
Before Width: | Height: | Size: 415 B |
BIN
assets/hbm/textures/blocks/taint_0.png
Normal file
|
After Width: | Height: | Size: 476 B |
BIN
assets/hbm/textures/blocks/taint_1.png
Normal file
|
After Width: | Height: | Size: 512 B |
BIN
assets/hbm/textures/blocks/taint_10.png
Normal file
|
After Width: | Height: | Size: 487 B |
BIN
assets/hbm/textures/blocks/taint_11.png
Normal file
|
After Width: | Height: | Size: 489 B |
BIN
assets/hbm/textures/blocks/taint_12.png
Normal file
|
After Width: | Height: | Size: 477 B |
BIN
assets/hbm/textures/blocks/taint_13.png
Normal file
|
After Width: | Height: | Size: 479 B |
BIN
assets/hbm/textures/blocks/taint_14.png
Normal file
|
After Width: | Height: | Size: 463 B |
BIN
assets/hbm/textures/blocks/taint_15.png
Normal file
|
After Width: | Height: | Size: 458 B |
BIN
assets/hbm/textures/blocks/taint_2.png
Normal file
|
After Width: | Height: | Size: 482 B |
BIN
assets/hbm/textures/blocks/taint_3.png
Normal file
|
After Width: | Height: | Size: 499 B |
BIN
assets/hbm/textures/blocks/taint_4.png
Normal file
|
After Width: | Height: | Size: 499 B |
BIN
assets/hbm/textures/blocks/taint_5.png
Normal file
|
After Width: | Height: | Size: 502 B |
BIN
assets/hbm/textures/blocks/taint_6.png
Normal file
|
After Width: | Height: | Size: 497 B |
BIN
assets/hbm/textures/blocks/taint_7.png
Normal file
|
After Width: | Height: | Size: 499 B |
BIN
assets/hbm/textures/blocks/taint_8.png
Normal file
|
After Width: | Height: | Size: 486 B |
BIN
assets/hbm/textures/blocks/taint_9.png
Normal file
|
After Width: | Height: | Size: 483 B |
BIN
assets/hbm/textures/blocks/taint_full.png
Normal file
|
After Width: | Height: | Size: 509 B |
BIN
assets/hbm/textures/blocks/taint_low.png
Normal file
|
After Width: | Height: | Size: 431 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
assets/hbm/textures/gui/potions.png
Normal file
|
After Width: | Height: | Size: 898 B |
|
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 266 B |
|
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 317 B |
BIN
assets/hbm/textures/items/cassette_overlay.png
Normal file
|
After Width: | Height: | Size: 111 B |
BIN
assets/hbm/textures/items/dynosphere_base.png
Normal file
|
After Width: | Height: | Size: 218 B |
BIN
assets/hbm/textures/items/dynosphere_desh.png
Normal file
|
After Width: | Height: | Size: 237 B |
BIN
assets/hbm/textures/items/dynosphere_desh_charged.png
Normal file
|
After Width: | Height: | Size: 239 B |
BIN
assets/hbm/textures/items/dynosphere_dineutronium.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
assets/hbm/textures/items/dynosphere_dineutronium_charged.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
assets/hbm/textures/items/dynosphere_euphemium.png
Normal file
|
After Width: | Height: | Size: 252 B |
BIN
assets/hbm/textures/items/dynosphere_euphemium_charged.png
Normal file
|
After Width: | Height: | Size: 253 B |
BIN
assets/hbm/textures/items/dynosphere_schrabidium.png
Normal file
|
After Width: | Height: | Size: 246 B |
BIN
assets/hbm/textures/items/dynosphere_schrabidium_charged.png
Normal file
|
After Width: | Height: | Size: 241 B |
@ -9,6 +9,7 @@ import com.hbm.items.bomb.ItemPrototypeBlock;
|
|||||||
import com.hbm.items.special.ItemOreBlock;
|
import com.hbm.items.special.ItemOreBlock;
|
||||||
import com.hbm.items.special.ItemPlasmaBlock;
|
import com.hbm.items.special.ItemPlasmaBlock;
|
||||||
import com.hbm.items.special.ItemSchrabidiumBlock;
|
import com.hbm.items.special.ItemSchrabidiumBlock;
|
||||||
|
import com.hbm.items.special.ItemTaintBlock;
|
||||||
import com.hbm.lib.ModDamageSource;
|
import com.hbm.lib.ModDamageSource;
|
||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
@ -389,6 +390,9 @@ public class ModBlocks {
|
|||||||
public static Block machine_press;
|
public static Block machine_press;
|
||||||
public static final int guiID_machine_press = 53;
|
public static final int guiID_machine_press = 53;
|
||||||
|
|
||||||
|
public static Block machine_siren;
|
||||||
|
public static final int guiID_siren = 57;
|
||||||
|
|
||||||
public static Block turret_light;
|
public static Block turret_light;
|
||||||
public static Block turret_heavy;
|
public static Block turret_heavy;
|
||||||
public static Block turret_rocket;
|
public static Block turret_rocket;
|
||||||
@ -410,6 +414,7 @@ public class ModBlocks {
|
|||||||
public static Block crystal_virus;
|
public static Block crystal_virus;
|
||||||
public static Block crystal_hardened;
|
public static Block crystal_hardened;
|
||||||
public static Block crystal_pulsar;
|
public static Block crystal_pulsar;
|
||||||
|
public static Block taint;
|
||||||
|
|
||||||
public static Block mud_block;
|
public static Block mud_block;
|
||||||
public static Fluid mud_fluid;
|
public static Fluid mud_fluid;
|
||||||
@ -748,12 +753,15 @@ public class ModBlocks {
|
|||||||
machine_schrabidium_transmutator = new MachineSchrabidiumTransmutator(Material.iron).setBlockName("machine_schrabidium_transmutator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock);
|
machine_schrabidium_transmutator = new MachineSchrabidiumTransmutator(Material.iron).setBlockName("machine_schrabidium_transmutator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock);
|
||||||
|
|
||||||
machine_reix_mainframe = new MachineReiXMainframe(Material.iron).setBlockName("machine_reix_mainframe").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock);
|
machine_reix_mainframe = new MachineReiXMainframe(Material.iron).setBlockName("machine_reix_mainframe").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock);
|
||||||
|
|
||||||
|
machine_siren = new MachineSiren(Material.iron).setBlockName("machine_siren").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabNuke).setBlockTextureName(RefStrings.MODID + ":machine_siren");
|
||||||
|
|
||||||
cheater_virus = new CheaterVirus(Material.iron).setBlockName("cheater_virus").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":cheater_virus");
|
cheater_virus = new CheaterVirus(Material.iron).setBlockName("cheater_virus").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":cheater_virus");
|
||||||
cheater_virus_seed = new CheaterVirusSeed(Material.iron).setBlockName("cheater_virus_seed").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":cheater_virus_seed");
|
cheater_virus_seed = new CheaterVirusSeed(Material.iron).setBlockName("cheater_virus_seed").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":cheater_virus_seed");
|
||||||
crystal_virus = new CrystalVirus(Material.iron).setBlockName("crystal_virus").setHardness(15.0F).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crystal_virus");
|
crystal_virus = new CrystalVirus(Material.iron).setBlockName("crystal_virus").setHardness(15.0F).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crystal_virus");
|
||||||
crystal_hardened = new BlockGeneric(Material.iron).setBlockName("crystal_hardened").setHardness(15.0F).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crystal_hardened");
|
crystal_hardened = new BlockGeneric(Material.iron).setBlockName("crystal_hardened").setHardness(15.0F).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crystal_hardened");
|
||||||
crystal_pulsar = new CrystalPulsar(Material.iron).setBlockName("crystal_pulsar").setHardness(15.0F).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crystal_pulsar");
|
crystal_pulsar = new CrystalPulsar(Material.iron).setBlockName("crystal_pulsar").setHardness(15.0F).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crystal_pulsar");
|
||||||
|
taint = new BlockTaint(Material.iron).setBlockName("taint").setHardness(15.0F).setResistance(10.0F).setCreativeTab(null);
|
||||||
|
|
||||||
statue_elb = new DecoBlockAlt(Material.iron).setBlockName("#null").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY);
|
statue_elb = new DecoBlockAlt(Material.iron).setBlockName("#null").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY);
|
||||||
statue_elb_g = new DecoBlockAlt(Material.iron).setBlockName("#void").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY);
|
statue_elb_g = new DecoBlockAlt(Material.iron).setBlockName("#void").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY);
|
||||||
@ -967,6 +975,9 @@ public class ModBlocks {
|
|||||||
GameRegistry.registerBlock(red_barrel, red_barrel.getUnlocalizedName());
|
GameRegistry.registerBlock(red_barrel, red_barrel.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(yellow_barrel, yellow_barrel.getUnlocalizedName());
|
GameRegistry.registerBlock(yellow_barrel, yellow_barrel.getUnlocalizedName());
|
||||||
|
|
||||||
|
//Siren
|
||||||
|
GameRegistry.registerBlock(machine_siren, machine_siren.getUnlocalizedName());
|
||||||
|
|
||||||
//Silo Hatch
|
//Silo Hatch
|
||||||
GameRegistry.registerBlock(seal_frame, seal_frame.getUnlocalizedName());
|
GameRegistry.registerBlock(seal_frame, seal_frame.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(seal_controller, seal_controller.getUnlocalizedName());
|
GameRegistry.registerBlock(seal_controller, seal_controller.getUnlocalizedName());
|
||||||
@ -1152,6 +1163,7 @@ public class ModBlocks {
|
|||||||
GameRegistry.registerBlock(crystal_virus, crystal_virus.getUnlocalizedName());
|
GameRegistry.registerBlock(crystal_virus, crystal_virus.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(crystal_hardened, crystal_hardened.getUnlocalizedName());
|
GameRegistry.registerBlock(crystal_hardened, crystal_hardened.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(crystal_pulsar, crystal_pulsar.getUnlocalizedName());
|
GameRegistry.registerBlock(crystal_pulsar, crystal_pulsar.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(taint, ItemTaintBlock.class, taint.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(cheater_virus, cheater_virus.getUnlocalizedName());
|
GameRegistry.registerBlock(cheater_virus, cheater_virus.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(cheater_virus_seed, cheater_virus_seed.getUnlocalizedName());
|
GameRegistry.registerBlock(cheater_virus_seed, cheater_virus_seed.getUnlocalizedName());
|
||||||
}
|
}
|
||||||
|
|||||||
175
com/hbm/blocks/bomb/BlockTaint.java
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
package com.hbm.blocks.bomb;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.lib.ModDamageSource;
|
||||||
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.potion.PotionEffectTaint;
|
||||||
|
import com.hbm.tileentity.deco.TileEntityTaint;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.material.MapColor;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemDye;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class BlockTaint extends BlockContainer {
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon[] icons;
|
||||||
|
|
||||||
|
public BlockTaint(Material p_i45386_1_) {
|
||||||
|
super(p_i45386_1_);
|
||||||
|
this.setTickRandomly(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||||
|
return new TileEntityTaint();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(int p_149691_1_, int meta)
|
||||||
|
{
|
||||||
|
return this.icons[meta % this.icons.length];
|
||||||
|
}
|
||||||
|
|
||||||
|
public int damageDropped(int meta)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int func_150032_b(int p_150032_0_)
|
||||||
|
{
|
||||||
|
return func_150031_c(p_150032_0_);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int func_150031_c(int p_150031_0_)
|
||||||
|
{
|
||||||
|
return p_150031_0_ & 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 16; ++i)
|
||||||
|
{
|
||||||
|
p_149666_3_.add(new ItemStack(p_149666_1_, 1, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister p_149651_1_)
|
||||||
|
{
|
||||||
|
this.icons = new IIcon[16];
|
||||||
|
|
||||||
|
for (int i = 0; i < this.icons.length; ++i)
|
||||||
|
{
|
||||||
|
this.icons[i] = p_149651_1_.registerIcon("hbm:taint_" + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MapColor getMapColor(int p_149728_1_)
|
||||||
|
{
|
||||||
|
return MapColor.purpleColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderType(){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onNeighborBlockChange(World world, int x, int y, int z, Block b)
|
||||||
|
{
|
||||||
|
if(!hasPosNeightbour(world, x, y, z) && !world.isRemote)
|
||||||
|
world.setBlockToAir(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateTick(World world, int x, int y, int z, Random rand)
|
||||||
|
{
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
if(!world.isRemote && meta < 15) {
|
||||||
|
|
||||||
|
for(int i = 0; i < 15; i++) {
|
||||||
|
int a = rand.nextInt(11) + x - 5;
|
||||||
|
int b = rand.nextInt(11) + y - 5;
|
||||||
|
int c = rand.nextInt(11) + z - 5;
|
||||||
|
if(world.getBlock(a, b, c).isReplaceable(world, a, b, c) && hasPosNeightbour(world, a, b, c))
|
||||||
|
world.setBlock(a, b, c, ModBlocks.taint, meta + 1, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < 85; i++) {
|
||||||
|
int a = rand.nextInt(7) + x - 3;
|
||||||
|
int b = rand.nextInt(7) + y - 3;
|
||||||
|
int c = rand.nextInt(7) + z - 3;
|
||||||
|
if(world.getBlock(a, b, c).isReplaceable(world, a, b, c) && hasPosNeightbour(world, a, b, c))
|
||||||
|
world.setBlock(a, b, c, ModBlocks.taint, meta + 1, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean hasPosNeightbour(World world, int x, int y, int z) {
|
||||||
|
Block b0 = world.getBlock(x + 1, y, z);
|
||||||
|
Block b1 = world.getBlock(x, y + 1, z);
|
||||||
|
Block b2 = world.getBlock(x, y, z + 1);
|
||||||
|
Block b3 = world.getBlock(x - 1, y, z);
|
||||||
|
Block b4 = world.getBlock(x, y - 1, z);
|
||||||
|
Block b5 = world.getBlock(x, y, z - 1);
|
||||||
|
boolean b = (b0.renderAsNormalBlock() && b0.getMaterial().isOpaque()) ||
|
||||||
|
(b1.renderAsNormalBlock() && b1.getMaterial().isOpaque()) ||
|
||||||
|
(b2.renderAsNormalBlock() && b2.getMaterial().isOpaque()) ||
|
||||||
|
(b3.renderAsNormalBlock() && b3.getMaterial().isOpaque()) ||
|
||||||
|
(b4.renderAsNormalBlock() && b4.getMaterial().isOpaque()) ||
|
||||||
|
(b5.renderAsNormalBlock() && b5.getMaterial().isOpaque());
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
||||||
|
{
|
||||||
|
return AxisAlignedBB.getBoundingBox(par2, par3, par4, par2, par3, par4);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||||
|
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||||
|
PotionEffect effect = new PotionEffect(PotionEffectTaint.instance.id, 15 * 20, 0);
|
||||||
|
effect.setCurativeItems(list);
|
||||||
|
if(entity instanceof EntityLivingBase)
|
||||||
|
((EntityLivingBase)entity).addPotionEffect(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -58,7 +58,7 @@ public class WasteEarth extends Block {
|
|||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||||
{
|
{
|
||||||
if(this == ModBlocks.waste_earth || this == ModBlocks.waste_earth)
|
if(this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium)
|
||||||
{
|
{
|
||||||
return Item.getItemFromBlock(Blocks.dirt);
|
return Item.getItemFromBlock(Blocks.dirt);
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ public class WasteEarth extends Block {
|
|||||||
return Items.snowball;
|
return Items.snowball;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
66
com/hbm/blocks/machine/MachineSiren.java
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
package com.hbm.blocks.machine;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityConverterHeRf;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSiren;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class MachineSiren extends BlockContainer {
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon iconTop;
|
||||||
|
|
||||||
|
public MachineSiren(Material p_i45386_1_) {
|
||||||
|
super(p_i45386_1_);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||||
|
return new TileEntityMachineSiren();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||||
|
|
||||||
|
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":block_steel");
|
||||||
|
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_siren");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(int side, int metadata) {
|
||||||
|
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||||
|
if(world.isRemote)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
} else if(!player.isSneaking())
|
||||||
|
{
|
||||||
|
TileEntityMachineSiren entity = (TileEntityMachineSiren) world.getTileEntity(x, y, z);
|
||||||
|
if(entity != null)
|
||||||
|
{
|
||||||
|
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_siren, world, x, y, z);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -12,6 +12,7 @@ import com.hbm.entity.effect.EntityBlackHole;
|
|||||||
import com.hbm.entity.projectile.EntityMeteor;
|
import com.hbm.entity.projectile.EntityMeteor;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.main.ModEventHandler;
|
import com.hbm.main.ModEventHandler;
|
||||||
|
import com.hbm.potion.PotionEffectTaint;
|
||||||
import com.hbm.world.Meteorite;
|
import com.hbm.world.Meteorite;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
@ -20,6 +21,7 @@ import net.minecraft.enchantment.EnchantmentProtection;
|
|||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
@ -212,8 +214,12 @@ public class TestEventTester extends Block {
|
|||||||
//ExplosionChaos.anvil(par1World, par2, par3 + 2, par4, 1);
|
//ExplosionChaos.anvil(par1World, par2, par3 + 2, par4, 1);
|
||||||
|
|
||||||
//return true;
|
//return true;
|
||||||
System.out.println(par5EntityPlayer.getCommandSenderName());
|
//System.out.println(par5EntityPlayer.getCommandSenderName());
|
||||||
System.out.println(par5EntityPlayer.getUniqueID());
|
//System.out.println(par5EntityPlayer.getUniqueID());
|
||||||
|
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||||
|
PotionEffect effect = new PotionEffect(PotionEffectTaint.instance.id, 300, 0);
|
||||||
|
effect.setCurativeItems(list);
|
||||||
|
par5EntityPlayer.addPotionEffect(effect);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,6 +53,7 @@ import com.hbm.tileentity.machine.TileEntityMachineReactor;
|
|||||||
import com.hbm.tileentity.machine.TileEntityMachineRefinery;
|
import com.hbm.tileentity.machine.TileEntityMachineRefinery;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineSchrabidiumTransmutator;
|
import com.hbm.tileentity.machine.TileEntityMachineSchrabidiumTransmutator;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineShredder;
|
import com.hbm.tileentity.machine.TileEntityMachineShredder;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSiren;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineTeleporter;
|
import com.hbm.tileentity.machine.TileEntityMachineTeleporter;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineUF6Tank;
|
import com.hbm.tileentity.machine.TileEntityMachineUF6Tank;
|
||||||
@ -568,6 +569,15 @@ public class GUIHandler implements IGuiHandler {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ModBlocks.guiID_siren:
|
||||||
|
{
|
||||||
|
if(entity instanceof TileEntityMachineSiren)
|
||||||
|
{
|
||||||
|
return new ContainerMachineSiren(player.inventory, (TileEntityMachineSiren) entity);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -1073,6 +1083,15 @@ public class GUIHandler implements IGuiHandler {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ModBlocks.guiID_siren:
|
||||||
|
{
|
||||||
|
if(entity instanceof TileEntityMachineSiren)
|
||||||
|
{
|
||||||
|
return new GUIMachineSiren(player.inventory, (TileEntityMachineSiren) entity);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//CLIENTONLY GUIS
|
//CLIENTONLY GUIS
|
||||||
|
|||||||
84
com/hbm/inventory/container/ContainerMachineSiren.java
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
package com.hbm.inventory.container;
|
||||||
|
|
||||||
|
import com.hbm.inventory.SlotMachineOutput;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSiren;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.ICrafting;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ContainerMachineSiren extends Container {
|
||||||
|
|
||||||
|
private TileEntityMachineSiren diFurnace;
|
||||||
|
private int afterburner;
|
||||||
|
|
||||||
|
public ContainerMachineSiren(InventoryPlayer invPlayer, TileEntityMachineSiren tedf) {
|
||||||
|
afterburner = 0;
|
||||||
|
|
||||||
|
diFurnace = tedf;
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(tedf, 0, 8, 35));
|
||||||
|
|
||||||
|
for(int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
for(int j = 0; j < 9; j++)
|
||||||
|
{
|
||||||
|
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < 9; i++)
|
||||||
|
{
|
||||||
|
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCraftingToCrafters(ICrafting crafting) {
|
||||||
|
super.addCraftingToCrafters(crafting);
|
||||||
|
}
|
||||||
|
|
||||||
|
@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 <= 0) {
|
||||||
|
if (!this.mergeItemStack(var5, 1, this.inventorySlots.size(), true))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!this.mergeItemStack(var5, 0, 1, false))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (var5.stackSize == 0)
|
||||||
|
{
|
||||||
|
var4.putStack((ItemStack) null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var4.onSlotChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return var3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player) {
|
||||||
|
return diFurnace.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
52
com/hbm/inventory/gui/GUIMachineSiren.java
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
package com.hbm.inventory.gui;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.hbm.inventory.container.ContainerMachineBattery;
|
||||||
|
import com.hbm.inventory.container.ContainerMachineSiren;
|
||||||
|
import com.hbm.items.tool.ItemCassette.TrackType;
|
||||||
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSiren;
|
||||||
|
|
||||||
|
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 GUIMachineSiren extends GuiContainer {
|
||||||
|
|
||||||
|
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_siren.png");
|
||||||
|
private TileEntityMachineSiren siren;
|
||||||
|
|
||||||
|
public GUIMachineSiren(InventoryPlayer invPlayer, TileEntityMachineSiren tedf) {
|
||||||
|
super(new ContainerMachineSiren(invPlayer, tedf));
|
||||||
|
siren = tedf;
|
||||||
|
|
||||||
|
this.xSize = 176;
|
||||||
|
this.ySize = 166;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||||
|
String name = this.siren.hasCustomInventoryName() ? this.siren.getInventoryName() : I18n.format(this.siren.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);
|
||||||
|
|
||||||
|
//Draw record meta here//
|
||||||
|
if(!siren.getCurrentType().name().equals(TrackType.NULL.name())) {
|
||||||
|
int color = siren.getCurrentType().getColor();
|
||||||
|
this.fontRendererObj.drawString(siren.getCurrentType().getTrackTitle(), 46, 28, color);
|
||||||
|
this.fontRendererObj.drawString("Type: " + siren.getCurrentType().getType().name(), 46, 40, color);
|
||||||
|
this.fontRendererObj.drawString("Volume: " + siren.getCurrentType().getVolume(), 46, 52, color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||||
|
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -10,6 +10,8 @@ import com.hbm.handler.FluidTypeHandler.FluidType;
|
|||||||
import com.hbm.inventory.MachineRecipes;
|
import com.hbm.inventory.MachineRecipes;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.items.tool.ItemAssemblyTemplate.EnumAssemblyTemplate;
|
import com.hbm.items.tool.ItemAssemblyTemplate.EnumAssemblyTemplate;
|
||||||
|
import com.hbm.items.tool.ItemCassette;
|
||||||
|
import com.hbm.items.tool.ItemCassette.TrackType;
|
||||||
import com.hbm.items.tool.ItemChemistryTemplate;
|
import com.hbm.items.tool.ItemChemistryTemplate;
|
||||||
import com.hbm.items.tool.ItemFluidIdentifier;
|
import com.hbm.items.tool.ItemFluidIdentifier;
|
||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
@ -51,6 +53,9 @@ public class GUIScreenTemplateFolder extends GuiScreen {
|
|||||||
stacks.add(new ItemStack(i));
|
stacks.add(new ItemStack(i));
|
||||||
for(Item i : MachineRecipes.stamps_circuit)
|
for(Item i : MachineRecipes.stamps_circuit)
|
||||||
stacks.add(new ItemStack(i));
|
stacks.add(new ItemStack(i));
|
||||||
|
//Tracks
|
||||||
|
for(int i = 1; i < ItemCassette.TrackType.values().length; i++)
|
||||||
|
stacks.add(new ItemStack(ModItems.siren_track, 1, i));
|
||||||
//Fluid IDs
|
//Fluid IDs
|
||||||
for(int i = 1; i < FluidType.values().length; i++)
|
for(int i = 1; i < FluidType.values().length; i++)
|
||||||
stacks.add(new ItemStack(ModItems.fluid_identifier, 1, i));
|
stacks.add(new ItemStack(ModItems.fluid_identifier, 1, i));
|
||||||
@ -202,9 +207,12 @@ public class GUIScreenTemplateFolder extends GuiScreen {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
String s = info;
|
String s = info;
|
||||||
if(stack != null)
|
if(stack != null) {
|
||||||
if(stack.getItem() instanceof ItemFluidIdentifier)
|
if(stack.getItem() instanceof ItemFluidIdentifier)
|
||||||
s += (": " + I18n.format(FluidType.getEnum(stack.getItemDamage()).getUnlocalizedName()));
|
s += (": " + I18n.format(FluidType.getEnum(stack.getItemDamage()).getUnlocalizedName()));
|
||||||
|
else if(stack.getItem() instanceof ItemCassette)
|
||||||
|
s = TrackType.getEnum(stack.getItemDamage()).getTrackTitle();
|
||||||
|
}
|
||||||
|
|
||||||
func_146283_a(Arrays.asList(new String[] { s }), x, y);
|
func_146283_a(Arrays.asList(new String[] { s }), x, y);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -607,6 +607,7 @@ public class ModItems {
|
|||||||
public static Item chemistry_icon;
|
public static Item chemistry_icon;
|
||||||
public static Item fluid_identifier;
|
public static Item fluid_identifier;
|
||||||
public static Item fluid_icon;
|
public static Item fluid_icon;
|
||||||
|
public static Item siren_track;
|
||||||
|
|
||||||
public static Item missile_generic;
|
public static Item missile_generic;
|
||||||
public static Item missile_anti_ballistic;
|
public static Item missile_anti_ballistic;
|
||||||
@ -688,6 +689,7 @@ public class ModItems {
|
|||||||
public static Item gun_twigun_ammo;
|
public static Item gun_twigun_ammo;
|
||||||
public static Item gun_defabricator;
|
public static Item gun_defabricator;
|
||||||
public static Item gun_defabricator_ammo;
|
public static Item gun_defabricator_ammo;
|
||||||
|
public static Item gun_dampfmaschine;
|
||||||
public static Item gun_waluigi;
|
public static Item gun_waluigi;
|
||||||
|
|
||||||
public static Item grenade_generic;
|
public static Item grenade_generic;
|
||||||
@ -1733,6 +1735,7 @@ public class ModItems {
|
|||||||
gun_defabricator = new GunDefabricator().setUnlocalizedName("gun_defabricator").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_defabricator");
|
gun_defabricator = new GunDefabricator().setUnlocalizedName("gun_defabricator").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_defabricator");
|
||||||
gun_super_shotgun = new ItemCustomLore().setUnlocalizedName("gun_super_shotgun").setMaxStackSize(1).setFull3D().setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_super_shotgun");
|
gun_super_shotgun = new ItemCustomLore().setUnlocalizedName("gun_super_shotgun").setMaxStackSize(1).setFull3D().setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_super_shotgun");
|
||||||
gun_moist_nugget = new ItemNugget(3, false).setUnlocalizedName("gun_moist_nugget").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_moist_nugget");
|
gun_moist_nugget = new ItemNugget(3, false).setUnlocalizedName("gun_moist_nugget").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_moist_nugget");
|
||||||
|
gun_dampfmaschine = new GunDampfmaschine().setUnlocalizedName("gun_dampfmaschine").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_dampfmaschine");
|
||||||
|
|
||||||
grenade_generic = new ItemGrenade().setUnlocalizedName("grenade_generic").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_generic");
|
grenade_generic = new ItemGrenade().setUnlocalizedName("grenade_generic").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_generic");
|
||||||
grenade_strong = new ItemGrenade().setUnlocalizedName("grenade_strong").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_strong");
|
grenade_strong = new ItemGrenade().setUnlocalizedName("grenade_strong").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":grenade_strong");
|
||||||
@ -1932,6 +1935,7 @@ public class ModItems {
|
|||||||
fluid_barrel_full = new ItemFluidTank().setUnlocalizedName("fluid_barrel_full").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fluid_barrel");
|
fluid_barrel_full = new ItemFluidTank().setUnlocalizedName("fluid_barrel_full").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fluid_barrel");
|
||||||
fluid_barrel_empty = new Item().setUnlocalizedName("fluid_barrel_empty").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fluid_barrel");
|
fluid_barrel_empty = new Item().setUnlocalizedName("fluid_barrel_empty").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fluid_barrel");
|
||||||
fluid_barrel_infinite = new Item().setUnlocalizedName("fluid_barrel_infinite").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fluid_barrel_infinite");
|
fluid_barrel_infinite = new Item().setUnlocalizedName("fluid_barrel_infinite").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fluid_barrel_infinite");
|
||||||
|
siren_track = new ItemCassette().setUnlocalizedName("siren_track").setMaxStackSize(1).setCreativeTab(MainRegistry.tabMachine).setTextureName(RefStrings.MODID + ":cassette");
|
||||||
|
|
||||||
euphemium_helmet = new ArmorEuphemium(MainRegistry.enumArmorMaterialEuphemium, 6, 0).setUnlocalizedName("astatine_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":euphemium_helmet");
|
euphemium_helmet = new ArmorEuphemium(MainRegistry.enumArmorMaterialEuphemium, 6, 0).setUnlocalizedName("astatine_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":euphemium_helmet");
|
||||||
euphemium_plate = new ArmorEuphemium(MainRegistry.enumArmorMaterialEuphemium, 6, 1).setUnlocalizedName("astatine_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":euphemium_plate");
|
euphemium_plate = new ArmorEuphemium(MainRegistry.enumArmorMaterialEuphemium, 6, 1).setUnlocalizedName("astatine_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":euphemium_plate");
|
||||||
@ -2638,6 +2642,7 @@ public class ModItems {
|
|||||||
GameRegistry.registerItem(upgrade_afterburn_3, upgrade_afterburn_3.getUnlocalizedName());
|
GameRegistry.registerItem(upgrade_afterburn_3, upgrade_afterburn_3.getUnlocalizedName());
|
||||||
|
|
||||||
//Machine Templates
|
//Machine Templates
|
||||||
|
GameRegistry.registerItem(siren_track, siren_track.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(fluid_identifier, fluid_identifier.getUnlocalizedName());
|
GameRegistry.registerItem(fluid_identifier, fluid_identifier.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(fluid_icon, fluid_icon.getUnlocalizedName());
|
GameRegistry.registerItem(fluid_icon, fluid_icon.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(assembly_template, assembly_template.getUnlocalizedName());
|
GameRegistry.registerItem(assembly_template, assembly_template.getUnlocalizedName());
|
||||||
@ -2881,6 +2886,7 @@ public class ModItems {
|
|||||||
GameRegistry.registerItem(gun_defabricator, gun_defabricator.getUnlocalizedName());
|
GameRegistry.registerItem(gun_defabricator, gun_defabricator.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_super_shotgun, gun_super_shotgun.getUnlocalizedName());
|
GameRegistry.registerItem(gun_super_shotgun, gun_super_shotgun.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_moist_nugget, gun_moist_nugget.getUnlocalizedName());
|
GameRegistry.registerItem(gun_moist_nugget, gun_moist_nugget.getUnlocalizedName());
|
||||||
|
GameRegistry.registerItem(gun_dampfmaschine, gun_dampfmaschine.getUnlocalizedName());
|
||||||
|
|
||||||
//Ammo
|
//Ammo
|
||||||
GameRegistry.registerItem(gun_revolver_iron_ammo, gun_revolver_iron_ammo.getUnlocalizedName());
|
GameRegistry.registerItem(gun_revolver_iron_ammo, gun_revolver_iron_ammo.getUnlocalizedName());
|
||||||
|
|||||||
42
com/hbm/items/special/ItemTaintBlock.java
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package com.hbm.items.special;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.blocks.bomb.BlockTaint;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockColored;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemDye;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
public class ItemTaintBlock extends ItemBlock
|
||||||
|
{
|
||||||
|
private static final String __OBFID = "CL_00000075";
|
||||||
|
|
||||||
|
public ItemTaintBlock(Block p_i45358_1_)
|
||||||
|
{
|
||||||
|
super(p_i45358_1_);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets an icon index based on an item's damage value
|
||||||
|
*/
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIconFromDamage(int p_77617_1_)
|
||||||
|
{
|
||||||
|
return this.field_150939_a.func_149735_b(2, BlockTaint.func_150032_b(p_77617_1_));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the metadata of the block which this Item (ItemBlock) can place
|
||||||
|
*/
|
||||||
|
public int getMetadata(int p_77647_1_)
|
||||||
|
{
|
||||||
|
return p_77647_1_;
|
||||||
|
}
|
||||||
|
}
|
||||||
171
com/hbm/items/tool/ItemCassette.java
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
package com.hbm.items.tool;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||||
|
import com.hbm.tileentity.conductor.TileEntityFluidDuct;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.client.resources.I18n;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ItemCassette extends Item {
|
||||||
|
|
||||||
|
IIcon overlayIcon;
|
||||||
|
|
||||||
|
public enum TrackType {
|
||||||
|
|
||||||
|
NULL( " ", null, SoundType.SOUND, 0, 0),
|
||||||
|
HATCH( "Hatch Siren", new ResourceLocation("hbm:alarm.hatch"), SoundType.LOOP, 3358839, 250),
|
||||||
|
ATUOPILOT( "Autopilot Disconnected", new ResourceLocation("hbm:alarm.autopilot"), SoundType.LOOP, 11908533, 50),
|
||||||
|
AMS_SIREN( "AMS Siren", new ResourceLocation("hbm:alarm.amsSiren"), SoundType.LOOP, 15055698, 50),
|
||||||
|
APC_LOOP( "APC Siren", new ResourceLocation("hbm:alarm.apcLoop"), SoundType.LOOP, 3565216, 50),
|
||||||
|
BANK_ALARM( "Bank Alarm", new ResourceLocation("hbm:alarm.bankAlarm"), SoundType.LOOP, 3572962, 100),
|
||||||
|
BEEP_SIREN( "Beep Siren", new ResourceLocation("hbm:alarm.beepSiren"), SoundType.LOOP, 13882323, 100),
|
||||||
|
CONTAINER_ALARM( "Container Alarm", new ResourceLocation("hbm:alarm.containerAlarm"), SoundType.LOOP, 14727839, 100),
|
||||||
|
SWEEP_SIREN( "Sweep Siren", new ResourceLocation("hbm:alarm.sweepSiren"), SoundType.LOOP, 15592026, 500),
|
||||||
|
APC_PASS( "APC Pass", new ResourceLocation("hbm:alarm.apcPass"), SoundType.PASS, 3422163, 50),
|
||||||
|
RAZORTRAIN( "Razortrain Horn", new ResourceLocation("hbm:alarm.razortrainHorn"), SoundType.SOUND, 7819501, 250);
|
||||||
|
|
||||||
|
//Name of the track shown in GUI
|
||||||
|
private String title;
|
||||||
|
//Location of the sound
|
||||||
|
private ResourceLocation location;
|
||||||
|
//Sound type, whether the sound should be repeated or not
|
||||||
|
private SoundType type;
|
||||||
|
//Color of the cassette
|
||||||
|
private int color;
|
||||||
|
//Range where the sound can be heard
|
||||||
|
private int volume;
|
||||||
|
|
||||||
|
private TrackType(String name, ResourceLocation loc, SoundType sound, int msa, int intensity) {
|
||||||
|
title = name;
|
||||||
|
location = loc;
|
||||||
|
type = sound;
|
||||||
|
color = msa;
|
||||||
|
volume = intensity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTrackTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResourceLocation getSoundLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SoundType getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getColor() {
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getVolume() {
|
||||||
|
return volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TrackType getEnum(int i) {
|
||||||
|
if(i < TrackType.values().length)
|
||||||
|
return TrackType.values()[i];
|
||||||
|
else
|
||||||
|
return TrackType.NULL;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public enum SoundType {
|
||||||
|
LOOP,
|
||||||
|
PASS,
|
||||||
|
SOUND;
|
||||||
|
};
|
||||||
|
|
||||||
|
public ItemCassette()
|
||||||
|
{
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||||
|
{
|
||||||
|
for (int i = 1; i < TrackType.values().length; ++i)
|
||||||
|
{
|
||||||
|
list.add(new ItemStack(item, 1, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(!(stack.getItem() instanceof ItemCassette))
|
||||||
|
return;
|
||||||
|
|
||||||
|
list.add("Siren sound cassette:");
|
||||||
|
list.add(" Name: " + TrackType.getEnum(stack.getItemDamage()).getTrackTitle());
|
||||||
|
list.add(" Type: " + TrackType.getEnum(stack.getItemDamage()).getType().name());
|
||||||
|
list.add(" Volume: " + TrackType.getEnum(stack.getItemDamage()).getVolume());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TrackType getType(ItemStack stack) {
|
||||||
|
if(stack != null && stack.getItem() instanceof ItemCassette)
|
||||||
|
return TrackType.getEnum(stack.getItemDamage());
|
||||||
|
else
|
||||||
|
return TrackType.NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public boolean requiresMultipleRenderPasses()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister p_94581_1_)
|
||||||
|
{
|
||||||
|
super.registerIcons(p_94581_1_);
|
||||||
|
|
||||||
|
this.overlayIcon = p_94581_1_.registerIcon("hbm:cassette_overlay");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_)
|
||||||
|
{
|
||||||
|
return p_77618_2_ == 1 ? this.overlayIcon : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getColorFromItemStack(ItemStack stack, int p_82790_2_)
|
||||||
|
{
|
||||||
|
if (p_82790_2_ == 0)
|
||||||
|
{
|
||||||
|
return 16777215;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int j = TrackType.getEnum(stack.getItemDamage()).getColor();
|
||||||
|
|
||||||
|
if (j < 0)
|
||||||
|
{
|
||||||
|
j = 16777215;
|
||||||
|
}
|
||||||
|
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -29,6 +29,7 @@ public class ItemTemplateFolder extends Item {
|
|||||||
list.add("Machine Templates: Paper + Dye");
|
list.add("Machine Templates: Paper + Dye");
|
||||||
list.add("Fluid IDs: Iron Plate + Dye");
|
list.add("Fluid IDs: Iron Plate + Dye");
|
||||||
list.add("Press Stamps: Flat Stamp");
|
list.add("Press Stamps: Flat Stamp");
|
||||||
|
list.add("Siren Tracks: Insulator + Steel Plate");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
118
com/hbm/items/weapon/GunDampfmaschine.java
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
package com.hbm.items.weapon;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import com.google.common.collect.Multimap;
|
||||||
|
import com.hbm.entity.missile.EntityBombletSelena;
|
||||||
|
import com.hbm.entity.missile.EntityBombletTheta;
|
||||||
|
import com.hbm.entity.projectile.EntityBullet;
|
||||||
|
import com.hbm.entity.projectile.EntityRocket;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
|
||||||
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
|
import net.minecraft.entity.SharedMonsterAttributes;
|
||||||
|
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumAction;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||||
|
|
||||||
|
public class GunDampfmaschine extends Item {
|
||||||
|
|
||||||
|
Random rand = new Random();
|
||||||
|
|
||||||
|
public GunDampfmaschine()
|
||||||
|
{
|
||||||
|
this.maxStackSize = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
|
||||||
|
return EnumAction.bow;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxItemUseDuration(ItemStack p_77626_1_) {
|
||||||
|
return 72000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
|
||||||
|
ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_);
|
||||||
|
{
|
||||||
|
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
|
||||||
|
}
|
||||||
|
|
||||||
|
return p_77659_1_;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUsingTick(ItemStack stack, EntityPlayer player, int count)
|
||||||
|
{
|
||||||
|
World world = player.worldObj;
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
|
||||||
|
if(!player.isSneaking()) {
|
||||||
|
EntityRocket entitybullet = new EntityRocket(world, player, 3.0F);
|
||||||
|
|
||||||
|
world.playSoundAtEntity(player, "hbm:block.crateBreak", 10.0F, 0.9F + (rand.nextFloat() * 0.2F));
|
||||||
|
if(count == this.getMaxItemUseDuration(stack))
|
||||||
|
world.playSoundAtEntity(player, "hbm:alarm.autopilot", 100.0F, 1.0F);
|
||||||
|
|
||||||
|
if (!world.isRemote) {
|
||||||
|
world.spawnEntityInWorld(entitybullet);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
world.playSoundAtEntity(player, "mob.pig.say", 10.0F, 0.9F + (rand.nextFloat() * 0.2F));
|
||||||
|
|
||||||
|
if(count % 10 == 0) {
|
||||||
|
EntityBombletSelena bomb = new EntityBombletSelena(world);
|
||||||
|
bomb.posX = player.posX;
|
||||||
|
bomb.posY = player.posY + player.eyeHeight;
|
||||||
|
bomb.posZ = player.posZ;
|
||||||
|
bomb.motionX = player.getLookVec().xCoord * 5;
|
||||||
|
bomb.motionY = player.getLookVec().yCoord * 5;
|
||||||
|
bomb.motionZ = player.getLookVec().zCoord * 5;
|
||||||
|
if(count == this.getMaxItemUseDuration(stack))
|
||||||
|
world.playSoundAtEntity(player, "hbm:alarm.razortrainHorn", 10.0F, 1.0F);
|
||||||
|
|
||||||
|
if (!world.isRemote) {
|
||||||
|
world.spawnEntityInWorld(bomb);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemEnchantability() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
|
||||||
|
|
||||||
|
list.add("Sometimes, to do the right thing,");
|
||||||
|
list.add("you need to be the villain of");
|
||||||
|
list.add("the pl-I mean me too, thanks.");
|
||||||
|
list.add("");
|
||||||
|
list.add("oh sorry how did this get here i'm not good with computer can somebody tell me how i can get out of here oh fiddlesticks this is not good oh no please can anybody hear me i am afraid please for the love of god somebody get me out of here");
|
||||||
|
list.add("");
|
||||||
|
list.add("Ammo: orang");
|
||||||
|
list.add("Damage: aaaaaaaaa");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Multimap getItemAttributeModifiers() {
|
||||||
|
Multimap multimap = super.getItemAttributeModifiers();
|
||||||
|
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||||
|
new AttributeModifier(field_111210_e, "Weapon modifier", -2, 0));
|
||||||
|
return multimap;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1345,4 +1345,12 @@ public class Library {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getFirstNullIndex(int start, Object[] array) {
|
||||||
|
for(int i = start; i < array.length; i++) {
|
||||||
|
if(array[i] == null)
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,6 +32,7 @@ public class ModDamageSource extends DamageSource {
|
|||||||
public static DamageSource turbofan = (new DamageSource("blender")).setDamageIsAbsolute().setDamageBypassesArmor();
|
public static DamageSource turbofan = (new DamageSource("blender")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||||
public static DamageSource meteorite = (new DamageSource("meteorite")).setDamageIsAbsolute().setDamageBypassesArmor();
|
public static DamageSource meteorite = (new DamageSource("meteorite")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||||
public static DamageSource boxcar = (new DamageSource("boxcar")).setDamageIsAbsolute().setDamageBypassesArmor();
|
public static DamageSource boxcar = (new DamageSource("boxcar")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||||
|
public static DamageSource taint = (new DamageSource("taint")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||||
|
|
||||||
public ModDamageSource(String p_i1566_1_) {
|
public ModDamageSource(String p_i1566_1_) {
|
||||||
super(p_i1566_1_);
|
super(p_i1566_1_);
|
||||||
|
|||||||
@ -133,6 +133,8 @@ public class ClientProxy extends ServerProxy
|
|||||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.pole_top), new ItemRenderPoleTop());
|
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.pole_top), new ItemRenderPoleTop());
|
||||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.pole_satellite_receiver), new ItemRenderSatelliteReceiver());
|
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.pole_satellite_receiver), new ItemRenderSatelliteReceiver());
|
||||||
|
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTaint.class, new RenderTaint());
|
||||||
|
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver, new ItemRenderRevolver());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver, new ItemRenderRevolver());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_iron, new ItemRenderRevolverIron());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_iron, new ItemRenderRevolverIron());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_gold, new ItemRenderRevolverGold());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_gold, new ItemRenderRevolverGold());
|
||||||
@ -162,6 +164,7 @@ public class ClientProxy extends ServerProxy
|
|||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_dash, new ItemRenderOverkill());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_dash, new ItemRenderOverkill());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_twigun, new ItemRenderOverkill());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_twigun, new ItemRenderOverkill());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_pip, new ItemRenderOverkill());
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_pip, new ItemRenderOverkill());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.gun_dampfmaschine, new ItemRenderBullshit());
|
||||||
|
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_dig, new ItemRenderMultitool());
|
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_dig, new ItemRenderMultitool());
|
||||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_silk, new ItemRenderMultitool());
|
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_silk, new ItemRenderMultitool());
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import net.minecraft.item.Item;
|
|||||||
import net.minecraft.item.Item.ToolMaterial;
|
import net.minecraft.item.Item.ToolMaterial;
|
||||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.stats.Achievement;
|
import net.minecraft.stats.Achievement;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
@ -139,6 +140,7 @@ import com.hbm.lib.HbmWorld;
|
|||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
import com.hbm.potion.PotionEffectTaint;
|
||||||
import com.hbm.tileentity.bomb.TileEntityBombMulti;
|
import com.hbm.tileentity.bomb.TileEntityBombMulti;
|
||||||
import com.hbm.tileentity.bomb.TileEntityCrashedBomb;
|
import com.hbm.tileentity.bomb.TileEntityCrashedBomb;
|
||||||
import com.hbm.tileentity.bomb.TileEntityLaunchPad;
|
import com.hbm.tileentity.bomb.TileEntityLaunchPad;
|
||||||
@ -173,6 +175,7 @@ import com.hbm.tileentity.deco.TileEntityDecoSteelPoles;
|
|||||||
import com.hbm.tileentity.deco.TileEntityDecoTapeRecorder;
|
import com.hbm.tileentity.deco.TileEntityDecoTapeRecorder;
|
||||||
import com.hbm.tileentity.deco.TileEntityObjTester;
|
import com.hbm.tileentity.deco.TileEntityObjTester;
|
||||||
import com.hbm.tileentity.deco.TileEntityRotationTester;
|
import com.hbm.tileentity.deco.TileEntityRotationTester;
|
||||||
|
import com.hbm.tileentity.deco.TileEntityTaint;
|
||||||
import com.hbm.tileentity.deco.TileEntityTestContainer;
|
import com.hbm.tileentity.deco.TileEntityTestContainer;
|
||||||
import com.hbm.tileentity.deco.TileEntityTestRender;
|
import com.hbm.tileentity.deco.TileEntityTestRender;
|
||||||
import com.hbm.tileentity.deco.TileEntityYellowBarrel;
|
import com.hbm.tileentity.deco.TileEntityYellowBarrel;
|
||||||
@ -215,6 +218,7 @@ import com.hbm.tileentity.machine.TileEntityMachineReactor;
|
|||||||
import com.hbm.tileentity.machine.TileEntityMachineRefinery;
|
import com.hbm.tileentity.machine.TileEntityMachineRefinery;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineSchrabidiumTransmutator;
|
import com.hbm.tileentity.machine.TileEntityMachineSchrabidiumTransmutator;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineShredder;
|
import com.hbm.tileentity.machine.TileEntityMachineShredder;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSiren;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineTeleporter;
|
import com.hbm.tileentity.machine.TileEntityMachineTeleporter;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineUF6Tank;
|
import com.hbm.tileentity.machine.TileEntityMachineUF6Tank;
|
||||||
@ -529,6 +533,8 @@ public class MainRegistry
|
|||||||
GameRegistry.registerTileEntity(TileEntityAMSBase.class, "tileentity_ams_base");
|
GameRegistry.registerTileEntity(TileEntityAMSBase.class, "tileentity_ams_base");
|
||||||
GameRegistry.registerTileEntity(TileEntityAMSEmitter.class, "tileentity_ams_emitter");
|
GameRegistry.registerTileEntity(TileEntityAMSEmitter.class, "tileentity_ams_emitter");
|
||||||
GameRegistry.registerTileEntity(TileEntityAMSLimiter.class, "tileentity_ams_limiter");
|
GameRegistry.registerTileEntity(TileEntityAMSLimiter.class, "tileentity_ams_limiter");
|
||||||
|
GameRegistry.registerTileEntity(TileEntityMachineSiren.class, "tileentity_siren");
|
||||||
|
GameRegistry.registerTileEntity(TileEntityTaint.class, "tileentity_taint");
|
||||||
|
|
||||||
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
||||||
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.items.tool.ItemAssemblyTemplate;
|
import com.hbm.items.tool.ItemAssemblyTemplate;
|
||||||
|
import com.hbm.items.tool.ItemCassette;
|
||||||
import com.hbm.items.tool.ItemChemistryTemplate;
|
import com.hbm.items.tool.ItemChemistryTemplate;
|
||||||
import com.hbm.items.tool.ItemFluidIdentifier;
|
import com.hbm.items.tool.ItemFluidIdentifier;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
|
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
|
||||||
@ -85,6 +86,14 @@ public class ItemFolderPacket implements IMessage {
|
|||||||
p.dropPlayerItemWithRandomChoice(stack, true);
|
p.dropPlayerItemWithRandomChoice(stack, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(stack.getItem() instanceof ItemCassette) {
|
||||||
|
if(p.inventory.hasItem(ModItems.plate_polymer) && p.inventory.hasItem(ModItems.plate_steel)) {
|
||||||
|
p.inventory.consumeInventoryItem(ModItems.plate_polymer);
|
||||||
|
p.inventory.consumeInventoryItem(ModItems.plate_steel);
|
||||||
|
if(!p.inventory.addItemStackToInventory(stack.copy()))
|
||||||
|
p.dropPlayerItemWithRandomChoice(stack, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(stack.getItem() == ModItems.stamp_stone_plate ||
|
if(stack.getItem() == ModItems.stamp_stone_plate ||
|
||||||
stack.getItem() == ModItems.stamp_stone_wire ||
|
stack.getItem() == ModItems.stamp_stone_wire ||
|
||||||
stack.getItem() == ModItems.stamp_stone_circuit) {
|
stack.getItem() == ModItems.stamp_stone_circuit) {
|
||||||
|
|||||||
@ -53,6 +53,8 @@ public class PacketDispatcher {
|
|||||||
wrapper.registerMessage(AuxElectricityPacket.Handler.class, AuxElectricityPacket.class, i++, Side.CLIENT);
|
wrapper.registerMessage(AuxElectricityPacket.Handler.class, AuxElectricityPacket.class, i++, Side.CLIENT);
|
||||||
//Electricity gauge for GUI rendering
|
//Electricity gauge for GUI rendering
|
||||||
wrapper.registerMessage(AuxGaugePacket.Handler.class, AuxGaugePacket.class, i++, Side.CLIENT);
|
wrapper.registerMessage(AuxGaugePacket.Handler.class, AuxGaugePacket.class, i++, Side.CLIENT);
|
||||||
|
//Siren packet for looped sounds
|
||||||
|
wrapper.registerMessage(TESirenPacket.Handler.class, TESirenPacket.class, i++, Side.CLIENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
123
com/hbm/packet/TESirenPacket.java
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
package com.hbm.packet;
|
||||||
|
|
||||||
|
import com.hbm.items.tool.ItemCassette.SoundType;
|
||||||
|
import com.hbm.items.tool.ItemCassette.TrackType;
|
||||||
|
import com.hbm.sound.SoundLoopAssembler;
|
||||||
|
import com.hbm.sound.SoundLoopChemplant;
|
||||||
|
import com.hbm.sound.SoundLoopIGen;
|
||||||
|
import com.hbm.sound.SoundLoopMiner;
|
||||||
|
import com.hbm.sound.SoundLoopSiren;
|
||||||
|
import com.hbm.sound.SoundLoopTurbofan;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineIGenerator;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSiren;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
public class TESirenPacket implements IMessage {
|
||||||
|
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int z;
|
||||||
|
int id;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
|
public TESirenPacket()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public TESirenPacket(int x, int y, int z, int id, boolean active)
|
||||||
|
{
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.z = z;
|
||||||
|
this.id = id;
|
||||||
|
this.active = active;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fromBytes(ByteBuf buf) {
|
||||||
|
x = buf.readInt();
|
||||||
|
y = buf.readInt();
|
||||||
|
z = buf.readInt();
|
||||||
|
id = buf.readInt();
|
||||||
|
active = buf.readBoolean();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void toBytes(ByteBuf buf) {
|
||||||
|
buf.writeInt(x);
|
||||||
|
buf.writeInt(y);
|
||||||
|
buf.writeInt(z);
|
||||||
|
buf.writeInt(id);
|
||||||
|
buf.writeBoolean(active);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Handler implements IMessageHandler<TESirenPacket, IMessage> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IMessage onMessage(TESirenPacket m, MessageContext ctx) {
|
||||||
|
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
|
||||||
|
|
||||||
|
if (te != null && te instanceof TileEntityMachineSiren) {
|
||||||
|
|
||||||
|
SoundLoopSiren sound = null;
|
||||||
|
for(int i = 0; i < SoundLoopSiren.list.size(); i++) {
|
||||||
|
if(SoundLoopSiren.list.get(i).getTE() == te)
|
||||||
|
sound = SoundLoopSiren.list.get(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(m.active) {
|
||||||
|
|
||||||
|
if(sound == null) {
|
||||||
|
//Start sound
|
||||||
|
if(m.id > 0) {
|
||||||
|
boolean b = TrackType.getEnum(m.id).getType().name().equals(SoundType.LOOP.name());
|
||||||
|
SoundLoopSiren s = new SoundLoopSiren(TrackType.getEnum(m.id).getSoundLocation(), te, TrackType.getEnum(m.id).getType());
|
||||||
|
s.setRepeat(b);
|
||||||
|
s.intendedVolume = TrackType.getEnum(m.id).getVolume();
|
||||||
|
Minecraft.getMinecraft().getSoundHandler().playSound(s);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ResourceLocation loc = TrackType.getEnum(m.id).getSoundLocation();
|
||||||
|
|
||||||
|
if(loc != null) {
|
||||||
|
String path = loc.getResourceDomain() + ":" + loc.getResourcePath();
|
||||||
|
|
||||||
|
if(!sound.getPath().equals(path)) {
|
||||||
|
//Track switched, stop and restart
|
||||||
|
sound.endSound();
|
||||||
|
if(m.id > 0)
|
||||||
|
Minecraft.getMinecraft().getSoundHandler().playSound(new SoundLoopSiren(TrackType.getEnum(m.id).getSoundLocation(), te, TrackType.getEnum(m.id).getType()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sound.intendedVolume = TrackType.getEnum(m.id).getVolume();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if(sound != null) {
|
||||||
|
//Stop sound
|
||||||
|
sound.endSound();
|
||||||
|
SoundLoopSiren.list.remove(sound);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
61
com/hbm/potion/PotionEffectTaint.java
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
package com.hbm.potion;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.blocks.bomb.BlockTaint;
|
||||||
|
import com.hbm.lib.Library;
|
||||||
|
import com.hbm.lib.ModDamageSource;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
public class PotionEffectTaint extends Potion {
|
||||||
|
|
||||||
|
public static PotionEffectTaint instance = new PotionEffectTaint(Library.getFirstNullIndex(1, Potion.potionTypes), true, 8388736);
|
||||||
|
Random rand = new Random();
|
||||||
|
|
||||||
|
public PotionEffectTaint(int p_i1573_1_, boolean p_i1573_2_, int p_i1573_3_) {
|
||||||
|
super(p_i1573_1_, p_i1573_2_, p_i1573_3_);
|
||||||
|
this.setPotionName("potion.hbm_taint");
|
||||||
|
this.setIconIndex(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getStatusIconIndex() {
|
||||||
|
ResourceLocation loc = new ResourceLocation("hbm","textures/gui/potions.png");
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(loc);
|
||||||
|
return super.getStatusIconIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void performEffect(EntityLivingBase entity, int level)
|
||||||
|
{
|
||||||
|
entity.attackEntityFrom(ModDamageSource.taint, (level + 1) * 2.5F);
|
||||||
|
|
||||||
|
if(!entity.worldObj.isRemote) {
|
||||||
|
|
||||||
|
for(int i = 0; i < 15; i++) {
|
||||||
|
int a = rand.nextInt(5) + (int)entity.posX - 2;
|
||||||
|
int b = rand.nextInt(5) + (int)entity.posY - 2;
|
||||||
|
int c = rand.nextInt(5) + (int)entity.posZ - 2;
|
||||||
|
if(entity.worldObj.getBlock(a, b, c).isReplaceable(entity.worldObj, a, b, c) && BlockTaint.hasPosNeightbour(entity.worldObj, a, b, c))
|
||||||
|
entity.worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(16), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isReady(int par1, int par2)
|
||||||
|
{
|
||||||
|
int k = 40 >> par2;
|
||||||
|
return k > 0 ? par1 % k == 0 : true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
111
com/hbm/render/item/ItemRenderBullshit.java
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
package com.hbm.render.item;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.render.model.ModelBaleflare;
|
||||||
|
import com.hbm.render.model.ModelDash;
|
||||||
|
import com.hbm.render.model.ModelDefabricator;
|
||||||
|
import com.hbm.render.model.ModelEuthanasia;
|
||||||
|
import com.hbm.render.model.ModelHP;
|
||||||
|
import com.hbm.render.model.ModelJack;
|
||||||
|
import com.hbm.render.model.ModelMP40;
|
||||||
|
import com.hbm.render.model.ModelPip;
|
||||||
|
import com.hbm.render.model.ModelSpark;
|
||||||
|
import com.hbm.render.model.ModelTwiGun;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.client.IItemRenderer;
|
||||||
|
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
||||||
|
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
|
||||||
|
|
||||||
|
public class ItemRenderBullshit implements IItemRenderer {
|
||||||
|
|
||||||
|
protected ModelSpark sparkPlug;
|
||||||
|
protected ModelPip pip;
|
||||||
|
protected ModelMP40 mp40;
|
||||||
|
protected ModelBaleflare bomb;
|
||||||
|
|
||||||
|
public ItemRenderBullshit() {
|
||||||
|
sparkPlug = new ModelSpark();
|
||||||
|
pip = new ModelPip();
|
||||||
|
mp40 = new ModelMP40();
|
||||||
|
bomb = new ModelBaleflare();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||||
|
switch(type) {
|
||||||
|
case EQUIPPED:
|
||||||
|
case EQUIPPED_FIRST_PERSON:
|
||||||
|
case ENTITY:
|
||||||
|
return true;
|
||||||
|
default: return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||||
|
switch(type) {
|
||||||
|
case EQUIPPED_FIRST_PERSON:
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||||
|
|
||||||
|
GL11.glRotatef(-135.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
GL11.glTranslatef(-0.5F, 0.0F, -0.2F);
|
||||||
|
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||||
|
GL11.glTranslatef(-0.2F, -0.1F, -0.1F);
|
||||||
|
|
||||||
|
renderWhatever(type, item, data);
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
break;
|
||||||
|
case EQUIPPED:
|
||||||
|
case ENTITY:
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||||
|
|
||||||
|
GL11.glRotatef(-200.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
GL11.glRotatef(75.0F, 0.0F, 1.0F, 0.0F);
|
||||||
|
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
|
||||||
|
GL11.glTranslatef(0.0F, -0.2F, -0.5F);
|
||||||
|
GL11.glRotatef(-5.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
GL11.glTranslatef(0.5F, -0.2F, 0.0F);
|
||||||
|
//GL11.glScalef(0.75F, 0.75F, 0.75F);
|
||||||
|
GL11.glTranslatef(-1.4F, 0.0F, 0.0F);
|
||||||
|
|
||||||
|
renderWhatever(type, item, data);
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderWhatever(ItemRenderType type, ItemStack item, Object... data) {
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelMP40.png"));
|
||||||
|
GL11.glScalef(0.75F, 0.75F, 0.75F);
|
||||||
|
mp40.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelSpark.png"));
|
||||||
|
GL11.glScalef(4/3F, 4/3F, 4/3F);
|
||||||
|
GL11.glTranslatef(-0.5F, 0.0F, 0.0F);
|
||||||
|
sparkPlug.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelPip.png"));
|
||||||
|
GL11.glTranslatef(0.0F, 0.2F, 0.0F);
|
||||||
|
GL11.glTranslatef(0.5F, 0.0F, 0.0F);
|
||||||
|
GL11.glScalef(0.75F, 0.75F, 0.75F);
|
||||||
|
pip.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/BaleFlare.png"));
|
||||||
|
GL11.glScalef(4/3F, 4/3F, 4/3F);
|
||||||
|
GL11.glTranslatef(-1.5F, 0.0F, 0.0F);
|
||||||
|
bomb.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||||
|
}
|
||||||
|
}
|
||||||
126
com/hbm/render/tileentity/RenderTaint.java
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
package com.hbm.render.tileentity;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.hbm.render.util.RUVertice;
|
||||||
|
import com.hbm.tileentity.deco.TileEntityTaint;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
|
||||||
|
public class RenderTaint extends TileEntitySpecialRenderer
|
||||||
|
{
|
||||||
|
float s = 0.5F;
|
||||||
|
|
||||||
|
RUVertice v1 = new RUVertice(s, s, s);
|
||||||
|
RUVertice v2 = new RUVertice(s, s, -s);
|
||||||
|
RUVertice v3 = new RUVertice(-s, s, -s);
|
||||||
|
RUVertice v4 = new RUVertice(-s, s, s);
|
||||||
|
|
||||||
|
RUVertice v5 = new RUVertice(s, -s, s);
|
||||||
|
RUVertice v6 = new RUVertice(s, -s, -s);
|
||||||
|
RUVertice v7 = new RUVertice(-s, -s, -s);
|
||||||
|
RUVertice v8 = new RUVertice(-s, -s, s);
|
||||||
|
|
||||||
|
public void renderAModelAt(TileEntityTaint tile, double x, double y, double z, float f)
|
||||||
|
{
|
||||||
|
World world = tile.getWorldObj();
|
||||||
|
|
||||||
|
boolean ceil = world.isBlockNormalCubeDefault(tile.xCoord, tile.yCoord + 1, tile.zCoord, false);
|
||||||
|
boolean floor = world.isBlockNormalCubeDefault(tile.xCoord, tile.yCoord - 1, tile.zCoord, false);
|
||||||
|
boolean side1 = world.isBlockNormalCubeDefault(tile.xCoord, tile.yCoord, tile.zCoord + 1, false);
|
||||||
|
boolean side2 = world.isBlockNormalCubeDefault(tile.xCoord - 1, tile.yCoord, tile.zCoord, false);
|
||||||
|
boolean side3 = world.isBlockNormalCubeDefault(tile.xCoord, tile.yCoord, tile.zCoord - 1, false);
|
||||||
|
boolean side4 = world.isBlockNormalCubeDefault(tile.xCoord + 1, tile.yCoord, tile.zCoord, false);
|
||||||
|
|
||||||
|
int meta = tile.getBlockMetadata();
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F);
|
||||||
|
|
||||||
|
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("hbm:textures/blocks/taint_" + meta + ".png"));
|
||||||
|
|
||||||
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
|
if (side1)
|
||||||
|
{
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
addVertex(v1, 0, 0, true);
|
||||||
|
addVertex(v5, 1, 0, true);
|
||||||
|
addVertex(v8, 1, 1, true);
|
||||||
|
addVertex(v4, 0, 1, true);
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side2)
|
||||||
|
{
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
addVertex(v4, 0, 0, true);
|
||||||
|
addVertex(v8, 1, 0, true);
|
||||||
|
addVertex(v7, 1, 1, true);
|
||||||
|
addVertex(v3, 0, 1, true);
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side3)
|
||||||
|
{
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
addVertex(v3, 0, 0, true);
|
||||||
|
addVertex(v7, 1, 0, true);
|
||||||
|
addVertex(v6, 1, 1, true);
|
||||||
|
addVertex(v2, 0, 1, true);
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side4)
|
||||||
|
{
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
addVertex(v2, 0, 0, true);
|
||||||
|
addVertex(v6, 1, 0, true);
|
||||||
|
addVertex(v5, 1, 1, true);
|
||||||
|
addVertex(v1, 0, 1, true);
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ceil)
|
||||||
|
{
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
addVertex(v4, 0, 0, true);
|
||||||
|
addVertex(v3, 1, 0, true);
|
||||||
|
addVertex(v2, 1, 1, true);
|
||||||
|
addVertex(v1, 0, 1, true);
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (floor)
|
||||||
|
{
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
addVertex(v5, 0, 0, true);
|
||||||
|
addVertex(v6, 1, 0, true);
|
||||||
|
addVertex(v7, 1, 1, true);
|
||||||
|
addVertex(v8, 0, 1, true);
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f)
|
||||||
|
{
|
||||||
|
renderAModelAt((TileEntityTaint) tileentity, d, d1, d2, f);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addVertex(RUVertice v, double t, double t2, boolean offset)
|
||||||
|
{
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
tessellator.addVertexWithUV(v.x * 0.99, v.y * 0.99, v.z * 0.99, t, t2);
|
||||||
|
}
|
||||||
|
}
|
||||||
22
com/hbm/render/util/RUVertice.java
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package com.hbm.render.util;
|
||||||
|
|
||||||
|
public class RUVertice {
|
||||||
|
|
||||||
|
public float x;
|
||||||
|
public float y;
|
||||||
|
public float z;
|
||||||
|
|
||||||
|
public RUVertice(float X, float Y, float Z) {
|
||||||
|
x = X;
|
||||||
|
y = Y;
|
||||||
|
z = Z;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RUVertice normalize() {
|
||||||
|
float l = (float) Math.sqrt(x * x + y * y + z * z);
|
||||||
|
x /= l;
|
||||||
|
y /= l;
|
||||||
|
z /= l;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
78
com/hbm/sound/SoundLoopSiren.java
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
package com.hbm.sound;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.items.tool.ItemCassette.SoundType;
|
||||||
|
import com.hbm.items.tool.ItemCassette.TrackType;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSiren;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.audio.ISound;
|
||||||
|
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||||
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
public class SoundLoopSiren extends SoundLoopMachine {
|
||||||
|
|
||||||
|
public static List<SoundLoopSiren> list = new ArrayList<SoundLoopSiren>();
|
||||||
|
public float intendedVolume;
|
||||||
|
public SoundType type;
|
||||||
|
|
||||||
|
public SoundLoopSiren(ResourceLocation path, TileEntity te, SoundType type) {
|
||||||
|
super(path, te);
|
||||||
|
list.add(this);
|
||||||
|
intendedVolume = 10.0F;
|
||||||
|
this.field_147666_i = ISound.AttenuationType.NONE;
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update() {
|
||||||
|
super.update();
|
||||||
|
|
||||||
|
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||||
|
float f = 0;
|
||||||
|
|
||||||
|
if(player != null) {
|
||||||
|
f = (float)Math.sqrt(Math.pow(xPosF - player.posX, 2) + Math.pow(yPosF - player.posY, 2) + Math.pow(zPosF - player.posZ, 2));
|
||||||
|
volume = func(f, intendedVolume);
|
||||||
|
} else {
|
||||||
|
volume = intendedVolume;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(te instanceof TileEntityMachineSiren) {
|
||||||
|
this.setRepeat(type.name().equals(SoundType.LOOP.name()));
|
||||||
|
} else {
|
||||||
|
this.donePlaying = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public TileEntity getTE() {
|
||||||
|
return te;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void endSound() {
|
||||||
|
this.donePlaying = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
return this.field_147664_a.getResourceDomain() + ":" + this.field_147664_a.getResourcePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepeat(boolean b) {
|
||||||
|
this.repeat = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepeatDelay(int i) {
|
||||||
|
this.field_147665_h = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float func(float f, float v) {
|
||||||
|
return (f / v) * -2 + 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
16
com/hbm/tileentity/deco/TileEntityTaint.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package com.hbm.tileentity.deco;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
public class TileEntityTaint extends TileEntity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public double getMaxRenderDistanceSquared()
|
||||||
|
{
|
||||||
|
return 65536.0D;
|
||||||
|
}
|
||||||
|
}
|
||||||
224
com/hbm/tileentity/machine/TileEntityMachineSiren.java
Normal file
@ -0,0 +1,224 @@
|
|||||||
|
package com.hbm.tileentity.machine;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.interfaces.IConsumer;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.items.tool.ItemCassette;
|
||||||
|
import com.hbm.items.tool.ItemCassette.SoundType;
|
||||||
|
import com.hbm.items.tool.ItemCassette.TrackType;
|
||||||
|
import com.hbm.packet.AuxElectricityPacket;
|
||||||
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
import com.hbm.packet.TESirenPacket;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.nbt.NBTTagList;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
public class TileEntityMachineSiren extends TileEntity implements ISidedInventory {
|
||||||
|
|
||||||
|
private ItemStack slots[];
|
||||||
|
|
||||||
|
private static final int[] slots_top = new int[] { 0 };
|
||||||
|
private static final int[] slots_bottom = new int[] { 0 };
|
||||||
|
private static final int[] slots_side = new int[] { 0 };
|
||||||
|
|
||||||
|
public boolean lock = false;
|
||||||
|
|
||||||
|
private String customName;
|
||||||
|
|
||||||
|
public TileEntityMachineSiren() {
|
||||||
|
slots = new ItemStack[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
@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.siren";
|
||||||
|
}
|
||||||
|
|
||||||
|
@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 itemStack) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@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 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_)
|
||||||
|
{
|
||||||
|
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||||
|
return this.isItemValidForSlot(i, itemStack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateEntity() {
|
||||||
|
|
||||||
|
if(!worldObj.isRemote) {
|
||||||
|
int id = Arrays.asList(TrackType.values()).indexOf(getCurrentType());
|
||||||
|
|
||||||
|
if(getCurrentType().name().equals(TrackType.NULL.name())) {
|
||||||
|
PacketDispatcher.wrapper.sendToAll(new TESirenPacket(xCoord, yCoord, zCoord, id, false));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean active = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
|
||||||
|
|
||||||
|
if(getCurrentType().getType().name().equals(SoundType.LOOP.name())) {
|
||||||
|
|
||||||
|
PacketDispatcher.wrapper.sendToAll(new TESirenPacket(xCoord, yCoord, zCoord, id, active));
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if(!lock && active) {
|
||||||
|
lock = true;
|
||||||
|
PacketDispatcher.wrapper.sendToAll(new TESirenPacket(xCoord, yCoord, zCoord, id, false));
|
||||||
|
PacketDispatcher.wrapper.sendToAll(new TESirenPacket(xCoord, yCoord, zCoord, id, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(lock && !active) {
|
||||||
|
lock = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public TrackType getCurrentType() {
|
||||||
|
if(slots[0] != null && slots[0].getItem() instanceof ItemCassette) {
|
||||||
|
return TrackType.getEnum(slots[0].getItemDamage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return TrackType.NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||