@ -603,6 +603,7 @@ public class ModBlocks {
|
||||
|
||||
public static Block vault_door;
|
||||
public static Block blast_door;
|
||||
public static Block sliding_blast_door;
|
||||
public static Block fire_door;
|
||||
public static Block transition_seal;
|
||||
|
||||
@ -2067,6 +2068,9 @@ public class ModBlocks {
|
||||
|
||||
vault_door = new VaultDoor(Material.iron).setBlockName("vault_door").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":vault_door");
|
||||
blast_door = new BlastDoor(Material.iron).setBlockName("blast_door").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":blast_door");
|
||||
|
||||
sliding_blast_door = new BlockDoorGeneric(Material.iron, DoorDecl.SLIDE_DOOR).setBlockName("sliding_blast_door").setHardness(150.0F).setResistance(7500.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":sliding_blast_door");
|
||||
|
||||
fire_door = new BlockDoorGeneric(Material.iron, DoorDecl.FIRE_DOOR).setBlockName("fire_door").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fire_door");
|
||||
transition_seal = new BlockDoorGeneric(Material.iron, DoorDecl.TRANSITION_SEAL).setBlockName("transition_seal").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":transition_seal");
|
||||
|
||||
@ -2991,7 +2995,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(blast_door, blast_door.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fire_door, fire_door.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(transition_seal, transition_seal.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(sliding_blast_door, sliding_blast_door.getUnlocalizedName());
|
||||
|
||||
//Doors
|
||||
GameRegistry.registerBlock(door_metal, door_metal.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(door_office, door_office.getUnlocalizedName());
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.blocks.generic;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.items.special.ItemDoorSkin;
|
||||
import com.hbm.tileentity.DoorDecl;
|
||||
import com.hbm.tileentity.TileEntityDoorGeneric;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
@ -54,12 +55,14 @@ public class BlockDoorGeneric extends BlockDummyable {
|
||||
TileEntityDoorGeneric door = (TileEntityDoorGeneric) world.getTileEntity(pos1[0], pos1[1], pos1[2]);
|
||||
|
||||
if(door != null) {
|
||||
return door.tryToggle(playerIn);
|
||||
if(playerIn.getHeldItem() != null && playerIn.getHeldItem().getItem() instanceof ItemDoorSkin) {
|
||||
return door.setSkinIndex((byte) playerIn.getHeldItem().getItemDamage());
|
||||
} else {
|
||||
return door.tryToggle(playerIn);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!playerIn.isSneaking())
|
||||
return true;
|
||||
return false;
|
||||
return !playerIn.isSneaking();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -201,7 +201,8 @@ public class ConsumableRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gas_tester, 1), new Object[] { "G", "C", "I", 'G', GOLD.plate(), 'C', ModItems.circuit_aluminium, 'I', IRON.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.defuser_gold, 1), new Object[] { "GPG", "PRP", "GPG", 'G', Items.gunpowder, 'P', GOLD.plate(), 'R', "record" });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ballistic_gauntlet, 1), new Object[] { " WS", "WRS", " RS", 'W', ModItems.wire_copper, 'R', ModItems.ring_starmetal, 'S', STEEL.plate() });
|
||||
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.night_vision, 1), "P P", "GCG", 'P', ANY_PLASTIC.ingot(), 'G', KEY_ANYGLASS, 'C', ModItems.circuit_gold);
|
||||
|
||||
//Stealth boy
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.stealth_boy, 1), new Object[] { " B", "LI", "LC", 'B', Blocks.stone_button, 'L', Items.leather, 'I', STEEL.ingot(), 'C', ModItems.circuit_red_copper });
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.crafting;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.OreDictManager;
|
||||
import com.hbm.inventory.RecipesCommon;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
@ -16,6 +17,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
/**
|
||||
* For guns, ammo and the like
|
||||
@ -345,7 +347,7 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_pink_cloud), new Object[] { " S ", "ECE", " E ", 'S', ModItems.powder_spark_mix, 'E', ModItems.powder_magic, 'C', ModItems.grenade_cloud });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.nuclear_waste_pearl), new Object[] { "WWW", "WFW", "WWW", 'W', ModItems.nuclear_waste_tiny, 'F', ModBlocks.block_fallout });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.grenade_kyiv), new Object[] { ModItems.canister_napalm, ModItems.bottle2_empty, ModItems.rag });
|
||||
|
||||
|
||||
//Sticks of explosives
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.stick_dynamite, 4), new Object[] { " S ", "PDP", "PDP", 'S', ModItems.safety_fuse, 'P', Items.paper, 'D', ModItems.ball_dynamite });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.stick_dynamite_fishing, 1), new Object[] { ModItems.stick_dynamite, ModItems.stick_dynamite, ModItems.stick_dynamite, Items.paper, ANY_TAR.any() });
|
||||
|
||||
@ -10,11 +10,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityMinerRocket extends Entity {
|
||||
|
||||
//0 landing, 1 unloading, 2 lifting
|
||||
public int timer = 0;
|
||||
//0 asteroid, 1 moon
|
||||
public String satelliteClassName = "com.hbm.saveddata.satellites.SatelliteMiner";
|
||||
|
||||
public EntityMinerRocket(World p_i1582_1_) {
|
||||
super(p_i1582_1_);
|
||||
@ -24,13 +21,12 @@ public class EntityMinerRocket extends Entity {
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
this.dataWatcher.addObject(16, Integer.valueOf(0));
|
||||
this.dataWatcher.addObject(17, Integer.valueOf(0));
|
||||
this.dataWatcher.addObject(16, 0);
|
||||
this.dataWatcher.addObject(17, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
if(dataWatcher.getWatchableObjectInt(16) == 0)
|
||||
motionY = -0.75;
|
||||
if(dataWatcher.getWatchableObjectInt(16) == 1)
|
||||
@ -43,7 +39,6 @@ public class EntityMinerRocket extends Entity {
|
||||
|
||||
this.setPositionAndRotation(posX + motionX, posY + motionY, posZ + motionZ, 0.0F, 0.0F);
|
||||
|
||||
|
||||
if(dataWatcher.getWatchableObjectInt(16) == 0 && worldObj.getBlock((int)(posX - 0.5), (int)(posY - 0.5), (int)(posZ - 0.5)) == ModBlocks.sat_dock) {
|
||||
dataWatcher.updateObject(16, 1);
|
||||
motionY = 0;
|
||||
@ -55,7 +50,6 @@ public class EntityMinerRocket extends Entity {
|
||||
}
|
||||
|
||||
if(dataWatcher.getWatchableObjectInt(16) == 1) {
|
||||
|
||||
if(!worldObj.isRemote && ticksExisted % 4 == 0)
|
||||
ExplosionLarge.spawnShock(worldObj, posX, posY, posZ, 1 + rand.nextInt(3), 1 + rand.nextGaussian());
|
||||
|
||||
@ -79,7 +73,6 @@ public class EntityMinerRocket extends Entity {
|
||||
dataWatcher.updateObject(16, nbt.getInteger("mode"));
|
||||
dataWatcher.updateObject(17, nbt.getInteger("sat"));
|
||||
timer = nbt.getInteger("timer");
|
||||
satelliteClassName = nbt.getString("type");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -87,7 +80,5 @@ public class EntityMinerRocket extends Entity {
|
||||
nbt.setInteger("mode", dataWatcher.getWatchableObjectInt(16));
|
||||
nbt.setInteger("sat", dataWatcher.getWatchableObjectInt(17));
|
||||
nbt.setInteger("timer", timer);
|
||||
nbt.setString("type", satelliteClassName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,19 +2,23 @@ package com.hbm.interfaces;
|
||||
|
||||
public interface IDoor {
|
||||
|
||||
public void open();
|
||||
public void close();
|
||||
public DoorState getState();
|
||||
public void toggle();
|
||||
public default boolean setTexture(String tex) {
|
||||
void open();
|
||||
void close();
|
||||
DoorState getState();
|
||||
void toggle();
|
||||
default boolean setTexture(String tex) {
|
||||
return false;
|
||||
}
|
||||
default void setTextureState(byte tex) { }
|
||||
|
||||
default boolean setSkinIndex(byte skinIndex) {
|
||||
return false;
|
||||
}
|
||||
public default void setTextureState(byte tex) { };
|
||||
|
||||
public enum DoorState {
|
||||
enum DoorState {
|
||||
CLOSED,
|
||||
OPEN,
|
||||
CLOSING,
|
||||
OPENING;
|
||||
OPENING
|
||||
}
|
||||
}
|
||||
|
||||
@ -1190,6 +1190,15 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.bolt_dura_steel, 12),
|
||||
new OreDictStack(KEY_YELLOW, 4)
|
||||
}, 1200);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.sliding_blast_door, 1), new AStack[] {
|
||||
new OreDictStack(STEEL.plate(), 16),
|
||||
new OreDictStack(W.ingot(), 8),
|
||||
new ComparableStack(ModBlocks.reinforced_glass, 4),
|
||||
new ComparableStack(ModItems.plate_polymer, 4),
|
||||
new ComparableStack(ModItems.bolt_dura_steel, 8),
|
||||
new ComparableStack(ModItems.motor, 2)
|
||||
}, 200);
|
||||
|
||||
if(Loader.isModLoaded("Mekanism")) {
|
||||
|
||||
|
||||
@ -1673,7 +1673,7 @@ public class ModItems {
|
||||
public static Item grenade_mirv;
|
||||
public static Item grenade_breach;
|
||||
public static Item grenade_burst;
|
||||
|
||||
|
||||
public static Item nuclear_waste_pearl;
|
||||
|
||||
public static Item weaponized_starblaster_cell;
|
||||
@ -2173,6 +2173,7 @@ public class ModItems {
|
||||
public static Item gas_tester;
|
||||
public static Item defuser_gold;
|
||||
public static Item ballistic_gauntlet;
|
||||
public static Item night_vision;
|
||||
|
||||
public static Item hazmat_helmet;
|
||||
public static Item hazmat_plate;
|
||||
@ -2325,7 +2326,9 @@ public class ModItems {
|
||||
public static Item door_metal;
|
||||
public static Item door_office;
|
||||
public static Item door_bunker;
|
||||
|
||||
|
||||
public static Item sliding_blast_door_skin;
|
||||
|
||||
public static Item record_lc;
|
||||
public static Item record_ss;
|
||||
public static Item record_vc;
|
||||
@ -3405,6 +3408,7 @@ public class ModItems {
|
||||
gas_tester = new ItemModSensor().setUnlocalizedName("gas_tester").setTextureName(RefStrings.MODID + ":gas_tester");
|
||||
defuser_gold = new ItemModDefuser().setUnlocalizedName("defuser_gold").setTextureName(RefStrings.MODID + ":defuser_gold");
|
||||
ballistic_gauntlet = new ItemModTwoKick().setUnlocalizedName("ballistic_gauntlet").setTextureName(RefStrings.MODID + ":ballistic_gauntlet");
|
||||
night_vision = new ItemModNightVision().setUnlocalizedName("night_vision").setTextureName(RefStrings.MODID + ":night_vision");
|
||||
|
||||
cap_nuka = new Item().setUnlocalizedName("cap_nuka").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_nuka");
|
||||
cap_quantum = new Item().setUnlocalizedName("cap_quantum").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_quantum");
|
||||
@ -5357,6 +5361,8 @@ public class ModItems {
|
||||
door_office = new ItemModDoor().setUnlocalizedName("door_office").setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":door_office");
|
||||
door_bunker = new ItemModDoor().setUnlocalizedName("door_bunker").setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":door_bunker");
|
||||
|
||||
sliding_blast_door_skin = new ItemSlidingBlastDoorSkin().setUnlocalizedName("sliding_blast_door_skin").setCreativeTab(CreativeTabs.tabMisc).setTextureName(RefStrings.MODID + ":sliding_blast_door_default");
|
||||
|
||||
record_lc = new ItemModRecord("lc").setUnlocalizedName("record_lc").setCreativeTab(CreativeTabs.tabMisc).setTextureName(RefStrings.MODID + ":record_lc");
|
||||
record_ss = new ItemModRecord("ss").setUnlocalizedName("record_ss").setCreativeTab(CreativeTabs.tabMisc).setTextureName(RefStrings.MODID + ":record_ss");
|
||||
record_vc = new ItemModRecord("vc").setUnlocalizedName("record_vc").setCreativeTab(CreativeTabs.tabMisc).setTextureName(RefStrings.MODID + ":record_vc");
|
||||
@ -7623,7 +7629,8 @@ public class ModItems {
|
||||
GameRegistry.registerItem(gas_tester, gas_tester.getUnlocalizedName());
|
||||
GameRegistry.registerItem(defuser_gold, defuser_gold.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ballistic_gauntlet, ballistic_gauntlet.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerItem(night_vision, night_vision.getUnlocalizedName());
|
||||
|
||||
//Chaos
|
||||
GameRegistry.registerItem(chocolate_milk, chocolate_milk.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cbt_device, cbt_device.getUnlocalizedName());
|
||||
@ -7974,7 +7981,8 @@ public class ModItems {
|
||||
GameRegistry.registerItem(door_metal, door_metal.getUnlocalizedName());
|
||||
GameRegistry.registerItem(door_office, door_office.getUnlocalizedName());
|
||||
GameRegistry.registerItem(door_bunker, door_bunker.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerItem(sliding_blast_door_skin, sliding_blast_door_skin.getUnlocalizedName());
|
||||
|
||||
//Records
|
||||
GameRegistry.registerItem(record_lc, record_lc.getUnlocalizedName());
|
||||
GameRegistry.registerItem(record_ss, record_ss.getUnlocalizedName());
|
||||
|
||||
41
src/main/java/com/hbm/items/armor/ItemModNightVision.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemModNightVision extends ItemArmorMod {
|
||||
public ItemModNightVision() {
|
||||
super(ArmorModHandler.helmet_only, true, false, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
|
||||
list.add(EnumChatFormatting.AQUA + I18n.format("item.night_vision.description.item"));
|
||||
list.add("");
|
||||
super.addInformation(itemstack, player, list, bool);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDesc(List list, ItemStack stack, ItemStack armor) {
|
||||
list.add(EnumChatFormatting.YELLOW + I18n.format("item.night_vision.description.in_armor", stack.getDisplayName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modUpdate(EntityLivingBase entity, ItemStack armor) {
|
||||
if(!entity.worldObj.isRemote && entity instanceof EntityPlayer && armor.getItem() instanceof ArmorFSBPowered && ArmorFSBPowered.hasFSBArmor((EntityPlayer)entity)) {
|
||||
entity.addPotionEffect(new PotionEffect(Potion.nightVision.id, 15 * 20, 0));
|
||||
|
||||
if(entity.getRNG().nextInt(50) == 0) {
|
||||
armor.damageItem(1, entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
36
src/main/java/com/hbm/items/special/ItemDoorSkin.java
Normal file
@ -0,0 +1,36 @@
|
||||
package com.hbm.items.special;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemDoorSkin extends Item {
|
||||
protected final IIcon[] icons;
|
||||
|
||||
public ItemDoorSkin(int skinCount) {
|
||||
setMaxStackSize(1);
|
||||
icons = new IIcon[skinCount];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getHasSubtypes() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
|
||||
for(int i = 0; i < icons.length; i++) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
return icons[meta];
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.hbm.items.special;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemSlidingBlastDoorSkin extends ItemDoorSkin {
|
||||
public ItemSlidingBlastDoorSkin() {
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister reg) {
|
||||
this.itemIcon = reg.registerIcon(this.getIconString());
|
||||
|
||||
this.icons[0] = reg.registerIcon(RefStrings.MODID + ":sliding_blast_door_default");
|
||||
this.icons[1] = reg.registerIcon(RefStrings.MODID + ":sliding_blast_door_variant1");
|
||||
this.icons[2] = reg.registerIcon(RefStrings.MODID + ":sliding_blast_door_variant2");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return super.getUnlocalizedName(stack) + "." + stack.getItemDamage();
|
||||
}
|
||||
}
|
||||
@ -2,49 +2,7 @@ package com.hbm.items.weapon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.grenade.EntityGrenadeASchrab;
|
||||
import com.hbm.entity.grenade.EntityGrenadeBlackHole;
|
||||
import com.hbm.entity.grenade.EntityGrenadeBreach;
|
||||
import com.hbm.entity.grenade.EntityGrenadeBurst;
|
||||
import com.hbm.entity.grenade.EntityGrenadeCloud;
|
||||
import com.hbm.entity.grenade.EntityGrenadeCluster;
|
||||
import com.hbm.entity.grenade.EntityGrenadeDynamite;
|
||||
import com.hbm.entity.grenade.EntityGrenadeElectric;
|
||||
import com.hbm.entity.grenade.EntityGrenadeFire;
|
||||
import com.hbm.entity.grenade.EntityGrenadeFlare;
|
||||
import com.hbm.entity.grenade.EntityGrenadeFrag;
|
||||
import com.hbm.entity.grenade.EntityGrenadeGas;
|
||||
import com.hbm.entity.grenade.EntityGrenadeGascan;
|
||||
import com.hbm.entity.grenade.EntityGrenadeGeneric;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFBouncy;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFBrimstone;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFConcussion;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFGeneric;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFHE;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFHopwire;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFImpact;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFIncendiary;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFMystery;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFNull;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFSpark;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFSticky;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFToxic;
|
||||
import com.hbm.entity.grenade.EntityGrenadeLemon;
|
||||
import com.hbm.entity.grenade.EntityGrenadeMIRV;
|
||||
import com.hbm.entity.grenade.EntityGrenadeMk2;
|
||||
import com.hbm.entity.grenade.EntityGrenadeNuclear;
|
||||
import com.hbm.entity.grenade.EntityGrenadeNuke;
|
||||
import com.hbm.entity.grenade.EntityGrenadePC;
|
||||
import com.hbm.entity.grenade.EntityGrenadePlasma;
|
||||
import com.hbm.entity.grenade.EntityGrenadePoison;
|
||||
import com.hbm.entity.grenade.EntityGrenadePulse;
|
||||
import com.hbm.entity.grenade.EntityGrenadeSchrabidium;
|
||||
import com.hbm.entity.grenade.EntityGrenadeShrapnel;
|
||||
import com.hbm.entity.grenade.EntityGrenadeSmart;
|
||||
import com.hbm.entity.grenade.EntityGrenadeStrong;
|
||||
import com.hbm.entity.grenade.EntityGrenadeTau;
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
import com.hbm.entity.grenade.EntityWastePearl;
|
||||
import com.hbm.entity.grenade.*;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@ -1087,6 +1087,11 @@ public class CraftingManager {
|
||||
ModItems.circuit_star_piece.stackFromEnum(ScrapType.BOARD_TRANSISTOR),
|
||||
ModItems.circuit_star_piece.stackFromEnum(ScrapType.BOARD_BLANK)
|
||||
});
|
||||
|
||||
addRecipeAuto(new ItemStack(ModItems.sliding_blast_door_skin), "SPS", "DPD", "SPS", 'P', Items.paper, 'D', "dye", 'S', STEEL.plate());
|
||||
addShapelessAuto(new ItemStack(ModItems.sliding_blast_door_skin, 1, 1), new ItemStack(ModItems.sliding_blast_door_skin, 1, 0));
|
||||
addShapelessAuto(new ItemStack(ModItems.sliding_blast_door_skin, 1, 2), new ItemStack(ModItems.sliding_blast_door_skin, 1, 1));
|
||||
addShapelessAuto(new ItemStack(ModItems.sliding_blast_door_skin), new ItemStack(ModItems.sliding_blast_door_skin, 1, 2));
|
||||
}
|
||||
|
||||
public static void crumple() {
|
||||
|
||||
@ -932,6 +932,7 @@ public class MainRegistry {
|
||||
if(GeneralConfig.enableStatReRegistering) {
|
||||
logger.info("Attempting to re-register item stats...");
|
||||
StatHelper.resetStatShitFuck(); //shit yourself
|
||||
logger.info("Item stats re-registered");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -291,7 +291,15 @@ public class ResourceManager {
|
||||
public static final IModelCustom blast_door_tooth = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blast_door_tooth.obj"));
|
||||
public static final IModelCustom blast_door_slider = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blast_door_slider.obj"));
|
||||
public static final IModelCustom blast_door_block = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blast_door_block.obj"));
|
||||
|
||||
|
||||
//Sliding Blast Door
|
||||
public static final ResourceLocation sliding_blast_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/sliding_blast_door.png");
|
||||
public static final ResourceLocation sliding_blast_door_variant1_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/sliding_blast_door_variant1.png");
|
||||
public static final ResourceLocation sliding_blast_door_variant2_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/sliding_blast_door_variant2.png");
|
||||
|
||||
public static AnimatedModel sliding_blast_door;
|
||||
public static Animation sliding_blast_door_anim;
|
||||
|
||||
//Doors
|
||||
public static AnimatedModel transition_seal;
|
||||
public static Animation transition_seal_anim;
|
||||
@ -1369,5 +1377,8 @@ public class ResourceManager {
|
||||
public static void loadAnimatedModels(){
|
||||
transition_seal = ColladaLoader.load(new ResourceLocation(RefStrings.MODID, "models/doors/seal.dae"), true);
|
||||
transition_seal_anim = ColladaLoader.loadAnim(24040, new ResourceLocation(RefStrings.MODID, "models/doors/seal.dae"));
|
||||
|
||||
sliding_blast_door = ColladaLoader.load(new ResourceLocation(RefStrings.MODID, "models/doors/sliding_blast_door.dae"));
|
||||
sliding_blast_door_anim = ColladaLoader.loadAnim(1200, new ResourceLocation(RefStrings.MODID, "models/doors/sliding_blast_door.dae"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,20 +15,22 @@ public class TEDoorAnimationPacket implements IMessage {
|
||||
|
||||
public int x, y, z;
|
||||
public byte state;
|
||||
public byte skinIndex;
|
||||
public byte texture;
|
||||
|
||||
public TEDoorAnimationPacket() {
|
||||
}
|
||||
|
||||
public TEDoorAnimationPacket(int x, int y, int z, byte state) {
|
||||
this(x, y, z, state, (byte) -1);
|
||||
this(x, y, z, state, (byte) 0, (byte) -1);
|
||||
}
|
||||
|
||||
public TEDoorAnimationPacket(int x, int y, int z, byte state, byte tex) {
|
||||
public TEDoorAnimationPacket(int x, int y, int z, byte state, byte skinIndex, byte tex) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.state = state;
|
||||
this.skinIndex = skinIndex;
|
||||
this.texture = tex;
|
||||
}
|
||||
|
||||
@ -38,6 +40,7 @@ public class TEDoorAnimationPacket implements IMessage {
|
||||
y = buf.readInt();
|
||||
z = buf.readInt();
|
||||
state = buf.readByte();
|
||||
skinIndex = buf.readByte();
|
||||
if(buf.readableBytes() == 1){
|
||||
texture = buf.readByte();
|
||||
}
|
||||
@ -49,6 +52,7 @@ public class TEDoorAnimationPacket implements IMessage {
|
||||
buf.writeInt(y);
|
||||
buf.writeInt(z);
|
||||
buf.writeByte(state);
|
||||
buf.writeByte(skinIndex);
|
||||
if(texture != -1){
|
||||
buf.writeByte(texture);
|
||||
}
|
||||
@ -63,6 +67,7 @@ public class TEDoorAnimationPacket implements IMessage {
|
||||
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
|
||||
if(te instanceof IAnimatedDoor){
|
||||
((IAnimatedDoor) te).handleNewState(m.state);
|
||||
((IAnimatedDoor) te).setSkinIndex(m.skinIndex);
|
||||
((IAnimatedDoor) te).setTextureState(m.texture);
|
||||
}
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ public class RenderDoorGeneric extends TileEntitySpecialRenderer {
|
||||
AnimatedModel animModel = door.getAnimatedModel();
|
||||
if(animModel != null){
|
||||
Animation anim = door.getAnim();
|
||||
bindTexture(door.getTextureForPart(""));
|
||||
bindTexture(door.getTextureForPart(te.getSkinIndex(), ""));
|
||||
long time = System.currentTimeMillis();
|
||||
long startTime = te.state > 1 ? te.animStartTime : time;
|
||||
boolean reverse = te.state == 1 || te.state == 2;
|
||||
@ -83,14 +83,14 @@ public class RenderDoorGeneric extends TileEntitySpecialRenderer {
|
||||
if(!door.doesRender(p.getLeft(), false))
|
||||
continue;
|
||||
GL11.glPushMatrix();
|
||||
bindTexture(door.getTextureForPart(p.getLeft()));
|
||||
bindTexture(door.getTextureForPart(te.getSkinIndex(), p.getLeft()));
|
||||
doPartTransform(door, p.getLeft(), openTicks, false);
|
||||
GL11.glCallList(p.getRight());
|
||||
for(String name : door.getChildren(p.getLeft())){
|
||||
if(!door.doesRender(name, true))
|
||||
continue;
|
||||
GL11.glPushMatrix();
|
||||
bindTexture(door.getTextureForPart(name));
|
||||
bindTexture(door.getTextureForPart(te.getSkinIndex(), name));
|
||||
doPartTransform(door, name, openTicks, true);
|
||||
model.renderPart(name);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@ -1,3 +1,20 @@
|
||||
package com.hbm.saveddata.satellites;
|
||||
|
||||
public class SatelliteLunarMiner extends SatelliteMiner { }
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.util.WeightedRandomObject;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class SatelliteLunarMiner extends SatelliteMiner {
|
||||
static {
|
||||
registerCargo(new WeightedRandomObject[] {
|
||||
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 48), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 32), 7),
|
||||
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 16), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_lithium, 3), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_iron, 3), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_iron, 1), 1),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_lithium, 1), 1)
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,46 @@
|
||||
package com.hbm.saveddata.satellites;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.util.WeightedRandomObject;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class SatelliteMiner extends Satellite {
|
||||
|
||||
/**
|
||||
* {@link WeightedRandomObject} array with loot the satellite will deliver.
|
||||
*/
|
||||
private static WeightedRandomObject[] CARGO = new WeightedRandomObject[] {
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_aluminium, 3), 10),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_iron, 3), 10),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_titanium, 2), 8),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_tungsten, 2), 7),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_coal, 4), 15),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_uranium, 2), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_plutonium, 1), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_thorium, 2), 7),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_desh_mix, 3), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_diamond, 2), 7),
|
||||
new WeightedRandomObject(new ItemStack(Items.redstone, 5), 15),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_nitan_mix, 2), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_power, 2), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_copper, 5), 15),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_lead, 3), 10),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.fluorite, 4), 15),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_lapis, 4), 10),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_combine_steel, 1), 1),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_aluminium, 1), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_gold, 1), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_phosphorus, 1), 10),
|
||||
new WeightedRandomObject(new ItemStack(ModBlocks.gravel_diamond, 1), 3),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_uranium, 1), 3),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_plutonium, 1), 3),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_trixite, 1), 1),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_starmetal, 1), 1),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_lithium, 2), 4)
|
||||
};
|
||||
|
||||
public long lastOp;
|
||||
|
||||
public SatelliteMiner() {
|
||||
@ -17,4 +54,20 @@ public class SatelliteMiner extends Satellite {
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
lastOp = nbt.getLong("lastOp");
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces cargo of the satellite.
|
||||
* @param cargo - Array of {@link WeightedRandomObject} representing the loot that will be delivered.
|
||||
*/
|
||||
public static void registerCargo(WeightedRandomObject[] cargo) {
|
||||
CARGO = cargo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets items the satellite can deliver.
|
||||
* @return - Array of {@link WeightedRandomObject} of satellite loot.
|
||||
*/
|
||||
public WeightedRandomObject[] getCargo() {
|
||||
return CARGO;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,82 +0,0 @@
|
||||
package com.hbm.saveddata.satellites;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.util.WeightedRandomObject;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class SatelliteMinerCargoRegistry {
|
||||
private static final HashMap<String, WeightedRandomObject[]> cargo = new HashMap<String, WeightedRandomObject[]>() {{
|
||||
put(SatelliteMiner.class.getName(), new WeightedRandomObject[] {
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_aluminium, 3), 10),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_iron, 3), 10),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_titanium, 2), 8),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_tungsten, 2), 7),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_coal, 4), 15),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_uranium, 2), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_plutonium, 1), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_thorium, 2), 7),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_desh_mix, 3), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_diamond, 2), 7),
|
||||
new WeightedRandomObject(new ItemStack(Items.redstone, 5), 15),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_nitan_mix, 2), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_power, 2), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_copper, 5), 15),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_lead, 3), 10),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.fluorite, 4), 15),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_lapis, 4), 10),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_combine_steel, 1), 1),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_aluminium, 1), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_gold, 1), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_phosphorus, 1), 10),
|
||||
new WeightedRandomObject(new ItemStack(ModBlocks.gravel_diamond, 1), 3),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_uranium, 1), 3),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_plutonium, 1), 3),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_trixite, 1), 1),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_starmetal, 1), 1),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_lithium, 2), 4)
|
||||
});
|
||||
put(SatelliteLunarMiner.class.getName(), new WeightedRandomObject[] {
|
||||
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 48), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 32), 7),
|
||||
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 16), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_lithium, 3), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.powder_iron, 3), 5),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_iron, 1), 1),
|
||||
new WeightedRandomObject(new ItemStack(ModItems.crystal_lithium, 1), 1),
|
||||
});
|
||||
}};
|
||||
|
||||
/**
|
||||
* Register cargo for specified satellite object
|
||||
* @param o - Satellite object
|
||||
* @param cargo - WeightedRandomObject array with loot
|
||||
*/
|
||||
public static void register(Object o, WeightedRandomObject[] cargo) {
|
||||
SatelliteMinerCargoRegistry.cargo.put(o.getClass().getName(), cargo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register cargo for specified satellite class
|
||||
* @param c - Satellite class
|
||||
* @param cargo - WeightedRandomObject array with loot
|
||||
*/
|
||||
public static void register(Class<?> c, WeightedRandomObject[] cargo) {
|
||||
SatelliteMinerCargoRegistry.cargo.put(c.getName(), cargo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get loot by satellite class name
|
||||
* @param satelliteName - Satellite class name, like com.hbm.saveddata.satellites.SatelliteMiner
|
||||
* @return - WeightedRandomObject array with loot
|
||||
*/
|
||||
public static WeightedRandomObject[] getCargo(String satelliteName) {
|
||||
if(cargo.containsKey(satelliteName)) {
|
||||
return cargo.get(satelliteName);
|
||||
}
|
||||
return new WeightedRandomObject[0];
|
||||
}
|
||||
}
|
||||
@ -1,306 +1,423 @@
|
||||
package com.hbm.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.animloader.AnimatedModel;
|
||||
import com.hbm.animloader.Animation;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.loader.WavefrontObjDisplayList;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public abstract class DoorDecl {
|
||||
|
||||
public static final DoorDecl TRANSITION_SEAL = new DoorDecl(){
|
||||
|
||||
@Override
|
||||
public String getOpenSoundStart() {
|
||||
return "hbm:door.TransitionSealOpen";
|
||||
};
|
||||
|
||||
@Override
|
||||
public float getSoundVolume(){
|
||||
return 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
|
||||
if(!partName.equals("base")){
|
||||
set(trans, 0, 3.5F*getNormTime(openTicks), 0);
|
||||
} else {
|
||||
super.getTranslation(partName, openTicks, child, trans);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform() {
|
||||
GL11.glTranslated(0, 0, 0.5);
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double[][] getClippingPlanes() {
|
||||
return super.getClippingPlanes();
|
||||
};
|
||||
|
||||
@Override
|
||||
public int timeToOpen() {
|
||||
return 480;
|
||||
};
|
||||
|
||||
@Override
|
||||
public int[][] getDoorOpenRanges(){
|
||||
//3 is tall
|
||||
//4 is wide
|
||||
return new int[][]{{-9, 2, 0, 20, 20, 1}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions(){
|
||||
return new int[]{23, 0, 0, 0, 13, 12};
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open) {
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
};
|
||||
public static final DoorDecl TRANSITION_SEAL = new DoorDecl() {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(String partName){
|
||||
return ResourceManager.transition_seal_tex;
|
||||
}
|
||||
@Override
|
||||
public String getOpenSoundStart() {
|
||||
return "hbm:door.TransitionSealOpen";
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Animation getAnim() {
|
||||
return ResourceManager.transition_seal_anim;
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AnimatedModel getAnimatedModel() {
|
||||
return ResourceManager.transition_seal;
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public WavefrontObjDisplayList getModel(){
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
public static final DoorDecl FIRE_DOOR = new DoorDecl(){
|
||||
|
||||
@Override
|
||||
public String getOpenSoundEnd() {
|
||||
return "hbm:door.wghStop";
|
||||
};
|
||||
@Override
|
||||
public String getOpenSoundLoop() {
|
||||
return "hbm:door.wghStart";
|
||||
};
|
||||
@Override
|
||||
public String getSoundLoop2() {
|
||||
return "hbm:door.alarm6";
|
||||
};
|
||||
|
||||
@Override
|
||||
public float getSoundVolume(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
|
||||
if(!partName.equals("frame")){
|
||||
set(trans, 0, 3*getNormTime(openTicks), 0);
|
||||
} else {
|
||||
super.getTranslation(partName, openTicks, child, trans);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform() {
|
||||
GL11.glTranslated(0, 0, 0.5);
|
||||
};
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double[][] getClippingPlanes() {
|
||||
return new double[][]{{0, -1, 0, 3.0001}};
|
||||
};
|
||||
|
||||
@Override
|
||||
public int timeToOpen() {
|
||||
return 160;
|
||||
};
|
||||
|
||||
@Override
|
||||
public int[][] getDoorOpenRanges(){
|
||||
return new int[][]{{-1, 0, 0, 3, 4, 1}};
|
||||
}
|
||||
@Override
|
||||
public float getSoundVolume() {
|
||||
return 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions(){
|
||||
return new int[]{2, 0, 0, 0, 2, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open) {
|
||||
if(!open)
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 1, 1);
|
||||
if(z == 1){
|
||||
return AxisAlignedBB.getBoundingBox(0.5, 0, 0, 1, 1, 1);
|
||||
} else if(z == -2){
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0, 0.5, 1, 1);
|
||||
} else if(y > 1){
|
||||
return AxisAlignedBB.getBoundingBox(0, 0.75, 0, 1, 1, 1);
|
||||
} else if(y == 0) {
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 0.1, 1);
|
||||
} else {
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
}
|
||||
};
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
|
||||
if (!partName.equals("base")) {
|
||||
set(trans, 0, 3.5F * getNormTime(openTicks), 0);
|
||||
} else {
|
||||
super.getTranslation(partName, openTicks, child, trans);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(String partName){
|
||||
return ResourceManager.fire_door_tex;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform() {
|
||||
GL11.glTranslated(0, 0, 0.5);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public WavefrontObjDisplayList getModel(){
|
||||
return ResourceManager.fire_door;
|
||||
}
|
||||
};
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double[][] getClippingPlanes() {
|
||||
return super.getClippingPlanes();
|
||||
}
|
||||
|
||||
//Format: x, y, z, tangent amount 1 (how long the door would be if it moved up), tangent amount 2 (door places blocks in this direction), axis (0-x, 1-y, 2-z)
|
||||
public abstract int[][] getDoorOpenRanges();
|
||||
|
||||
public abstract int[] getDimensions();
|
||||
|
||||
public float getDoorRangeOpenTime(int ticks, int idx){
|
||||
return getNormTime(ticks);
|
||||
}
|
||||
|
||||
public int timeToOpen(){
|
||||
return 20;
|
||||
}
|
||||
|
||||
public float getNormTime(float time){
|
||||
return getNormTime(time, 0, timeToOpen());
|
||||
}
|
||||
|
||||
public float getNormTime(float time, float min, float max){
|
||||
return BobMathUtil.remap01_clamp(time, min, max);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract ResourceLocation getTextureForPart(String partName);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract WavefrontObjDisplayList getModel();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AnimatedModel getAnimatedModel(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Animation getAnim(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans){
|
||||
set(trans, 0, 0, 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getRotation(String partName, float openTicks, float[] rot){
|
||||
set(rot, 0, 0, 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getOrigin(String partName, float[] orig){
|
||||
set(orig, 0, 0, 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean doesRender(String partName, boolean child){
|
||||
return true;
|
||||
}
|
||||
|
||||
private static final String[] nothing = new String[]{};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String[] getChildren(String partName){
|
||||
return nothing;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double[][] getClippingPlanes(){
|
||||
return new double[][]{};
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform(){
|
||||
}
|
||||
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open){
|
||||
return open ? AxisAlignedBB.getBoundingBox(0, 0, 0, 0, 0, 0) : AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 1, 1);
|
||||
}
|
||||
|
||||
public boolean isLadder(boolean open){
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getOpenSoundLoop(){
|
||||
return null;
|
||||
}
|
||||
|
||||
//Hack
|
||||
public String getSoundLoop2(){
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getCloseSoundLoop(){
|
||||
return getOpenSoundLoop();
|
||||
}
|
||||
|
||||
public String getOpenSoundStart(){
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getCloseSoundStart(){
|
||||
return getOpenSoundStart();
|
||||
}
|
||||
|
||||
public String getOpenSoundEnd(){
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getCloseSoundEnd(){
|
||||
return getOpenSoundEnd();
|
||||
}
|
||||
|
||||
public float getSoundVolume(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
public float[] set(float[] f, float x, float y, float z){
|
||||
f[0] = x;
|
||||
f[1] = y;
|
||||
f[2] = z;
|
||||
return f;
|
||||
};
|
||||
@Override
|
||||
public int timeToOpen() {
|
||||
return 480;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[][] getDoorOpenRanges() {
|
||||
//3 is tall
|
||||
//4 is wide
|
||||
return new int[][]{{-9, 2, 0, 20, 20, 1}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[]{23, 0, 0, 0, 13, 12};
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open) {
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(int skinIndex, String partName) {
|
||||
return ResourceManager.transition_seal_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Animation getAnim() {
|
||||
return ResourceManager.transition_seal_anim;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AnimatedModel getAnimatedModel() {
|
||||
return ResourceManager.transition_seal;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public WavefrontObjDisplayList getModel() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
public static final DoorDecl FIRE_DOOR = new DoorDecl() {
|
||||
|
||||
@Override
|
||||
public String getOpenSoundEnd() {
|
||||
return "hbm:door.wghStop";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOpenSoundLoop() {
|
||||
return "hbm:door.wghStart";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSoundLoop2() {
|
||||
return "hbm:door.alarm6";
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSoundVolume() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
|
||||
if (!partName.equals("frame")) {
|
||||
set(trans, 0, 3 * getNormTime(openTicks), 0);
|
||||
} else {
|
||||
super.getTranslation(partName, openTicks, child, trans);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform() {
|
||||
GL11.glTranslated(0, 0, 0.5);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double[][] getClippingPlanes() {
|
||||
return new double[][]{{0, -1, 0, 3.0001}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int timeToOpen() {
|
||||
return 160;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[][] getDoorOpenRanges() {
|
||||
return new int[][]{{-1, 0, 0, 3, 4, 1}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[]{2, 0, 0, 0, 2, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open) {
|
||||
if (!open)
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 1, 1);
|
||||
if (z == 1) {
|
||||
return AxisAlignedBB.getBoundingBox(0.5, 0, 0, 1, 1, 1);
|
||||
} else if (z == -2) {
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0, 0.5, 1, 1);
|
||||
} else if (y > 1) {
|
||||
return AxisAlignedBB.getBoundingBox(0, 0.75, 0, 1, 1, 1);
|
||||
} else if (y == 0) {
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 0.1, 1);
|
||||
} else {
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(int skinIndex, String partName) {
|
||||
return ResourceManager.fire_door_tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public WavefrontObjDisplayList getModel() {
|
||||
return ResourceManager.fire_door;
|
||||
}
|
||||
};
|
||||
|
||||
public static final DoorDecl SLIDE_DOOR = new DoorDecl() {
|
||||
@Override
|
||||
public String getOpenSoundEnd() {
|
||||
return "hbm:door.sliding_door_opened";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCloseSoundEnd() {
|
||||
return "hbm:door.sliding_door_shut";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOpenSoundLoop() {
|
||||
return "hbm:door.sliding_door_opening";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSoundLoop2() {
|
||||
return "hbm:door.sliding_door_opening";
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSoundVolume() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform() {
|
||||
GL11.glRotated(-90, 0, 1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double[][] getClippingPlanes() {
|
||||
return new double[][]{
|
||||
{-1, 0, 0, 3.50001},
|
||||
{1, 0, 0, 3.50001}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int timeToOpen() {
|
||||
return 24;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[][] getDoorOpenRanges() {
|
||||
return new int[][]{{-2, 0, 0, 4, 5, 1}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[]{3, 0, 0, 0, 3, 3};
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open) {
|
||||
if (open) {
|
||||
if (y == 3) {
|
||||
return AxisAlignedBB.getBoundingBox(0, 0.5, 0, 1, 1, 1);
|
||||
} else if (y == 0) {
|
||||
return AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 0.08, 1);
|
||||
}
|
||||
}
|
||||
return super.getBlockBound(x, y, z, open);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSkins() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSkinCount() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(int skinIndex, String partName) {
|
||||
return new ResourceLocation[] {
|
||||
ResourceManager.sliding_blast_door_tex,
|
||||
ResourceManager.sliding_blast_door_variant1_tex,
|
||||
ResourceManager.sliding_blast_door_variant2_tex
|
||||
}[skinIndex];
|
||||
}
|
||||
|
||||
@Override
|
||||
public WavefrontObjDisplayList getModel() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Animation getAnim() {
|
||||
return ResourceManager.sliding_blast_door_anim;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnimatedModel getAnimatedModel() {
|
||||
return ResourceManager.sliding_blast_door;
|
||||
}
|
||||
};
|
||||
|
||||
//Format: x, y, z, tangent amount 1 (how long the door would be if it moved up), tangent amount 2 (door places blocks in this direction), axis (0-x, 1-y, 2-z)
|
||||
public abstract int[][] getDoorOpenRanges();
|
||||
|
||||
public abstract int[] getDimensions();
|
||||
|
||||
public float getDoorRangeOpenTime(int ticks, int idx) {
|
||||
return getNormTime(ticks);
|
||||
}
|
||||
|
||||
public int timeToOpen() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
public float getNormTime(float time) {
|
||||
return getNormTime(time, 0, timeToOpen());
|
||||
}
|
||||
|
||||
public float getNormTime(float time, float min, float max) {
|
||||
return BobMathUtil.remap01_clamp(time, min, max);
|
||||
}
|
||||
|
||||
public boolean hasSkins() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getSkinCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTextureForPart(String partName) {
|
||||
return getTextureForPart(0, partName);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract ResourceLocation getTextureForPart(int skinIndex, String partName);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract WavefrontObjDisplayList getModel();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AnimatedModel getAnimatedModel() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Animation getAnim() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
|
||||
set(trans, 0, 0, 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getRotation(String partName, float openTicks, float[] rot) {
|
||||
set(rot, 0, 0, 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getOrigin(String partName, float[] orig) {
|
||||
set(orig, 0, 0, 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean doesRender(String partName, boolean child) {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static final String[] nothing = new String[]{};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String[] getChildren(String partName) {
|
||||
return nothing;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double[][] getClippingPlanes() {
|
||||
return new double[][]{};
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void doOffsetTransform() {
|
||||
}
|
||||
|
||||
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open) {
|
||||
return open ? AxisAlignedBB.getBoundingBox(0, 0, 0, 0, 0, 0) : AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 1, 1);
|
||||
}
|
||||
|
||||
public boolean isLadder(boolean open) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getOpenSoundLoop() {
|
||||
return null;
|
||||
}
|
||||
|
||||
//Hack
|
||||
public String getSoundLoop2() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getCloseSoundLoop() {
|
||||
return getOpenSoundLoop();
|
||||
}
|
||||
|
||||
public String getOpenSoundStart() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getCloseSoundStart() {
|
||||
return getOpenSoundStart();
|
||||
}
|
||||
|
||||
public String getOpenSoundEnd() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getCloseSoundEnd() {
|
||||
return getOpenSoundEnd();
|
||||
}
|
||||
|
||||
public float getSoundVolume() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public float[] set(float[] f, float x, float y, float z) {
|
||||
f[0] = x;
|
||||
f[1] = y;
|
||||
f[2] = z;
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,6 +33,8 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn
|
||||
public long animStartTime = 0;
|
||||
public int redstonePower;
|
||||
public boolean shouldUseBB = false;
|
||||
private byte skinIndex = 0;
|
||||
|
||||
public Set<BlockPos> activatedBlocks = new HashSet<>(4);
|
||||
|
||||
private AudioWrapper audio;
|
||||
@ -52,9 +54,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn
|
||||
}
|
||||
}
|
||||
|
||||
if(worldObj.isRemote) {
|
||||
|
||||
} else {
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
BlockPos pos = new BlockPos(this);
|
||||
|
||||
@ -140,7 +140,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn
|
||||
if(state == 2 && openTicks == 0) {
|
||||
state = 0;
|
||||
}
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEDoorAnimationPacket(xCoord, yCoord, zCoord, state, (byte)(shouldUseBB ? 1 : 0)), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 100));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEDoorAnimationPacket(xCoord, yCoord, zCoord, state, skinIndex, (byte)(shouldUseBB ? 1 : 0)), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 100));
|
||||
|
||||
if(redstonePower == -1 && state == 0){
|
||||
tryToggle(-1);
|
||||
@ -282,10 +282,22 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn
|
||||
//Ah yes piggy backing on this packet
|
||||
@Override
|
||||
public void setTextureState(byte tex){
|
||||
if(tex > 0)
|
||||
shouldUseBB = true;
|
||||
else
|
||||
shouldUseBB = false;
|
||||
shouldUseBB = tex > 0;
|
||||
}
|
||||
|
||||
public int getSkinIndex() {
|
||||
return skinIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setSkinIndex(byte skinIndex) {
|
||||
if(!getDoorType().hasSkins())
|
||||
return false;
|
||||
if(getDoorType().getSkinCount() < skinIndex) {
|
||||
return false;
|
||||
}
|
||||
this.skinIndex = skinIndex;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -305,6 +317,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn
|
||||
this.animStartTime = tag.getInteger("animStartTime");
|
||||
this.redstonePower = tag.getInteger("redstoned");
|
||||
this.shouldUseBB = tag.getBoolean("shouldUseBB");
|
||||
this.skinIndex = tag.getByte("skin");
|
||||
NBTTagCompound activatedBlocks = tag.getCompoundTag("activatedBlocks");
|
||||
this.activatedBlocks.clear();
|
||||
for(int i = 0; i < activatedBlocks.func_150296_c().size()/3; i ++){
|
||||
@ -322,6 +335,8 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn
|
||||
tag.setLong("animStartTime", animStartTime);
|
||||
tag.setInteger("redstoned", redstonePower);
|
||||
tag.setBoolean("shouldUseBB", shouldUseBB);
|
||||
if(getDoorType().hasSkins())
|
||||
tag.setByte("skin", skinIndex);
|
||||
NBTTagCompound activatedBlocks = new NBTTagCompound();
|
||||
int i = 0;
|
||||
for(BlockPos p : this.activatedBlocks){
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.entity.missile.EntityMinerRocket;
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
import com.hbm.inventory.container.ContainerSatDock;
|
||||
@ -11,10 +8,8 @@ import com.hbm.items.ISatChip;
|
||||
import com.hbm.saveddata.SatelliteSavedData;
|
||||
import com.hbm.saveddata.satellites.Satellite;
|
||||
import com.hbm.saveddata.satellites.SatelliteMiner;
|
||||
import com.hbm.saveddata.satellites.SatelliteMinerCargoRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.util.WeightedRandomObject;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@ -31,355 +26,334 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityMachineSatDock extends TileEntity implements ISidedInventory, IGUIProvider {
|
||||
private ItemStack[] slots;
|
||||
|
||||
private ItemStack[] slots;
|
||||
|
||||
private static final int[] access = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityMachineSatDock() {
|
||||
slots = new ItemStack[16];
|
||||
private static final int[] access = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityMachineSatDock() {
|
||||
slots = new ItemStack[16];
|
||||
}
|
||||
|
||||
@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.satDock";
|
||||
}
|
||||
|
||||
@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 i != 2 && i != 3 && i != 4 && i != 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return slots.length;
|
||||
}
|
||||
@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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return slots[i];
|
||||
}
|
||||
return itemStack1;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@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 readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemStack) {
|
||||
slots[i] = itemStack;
|
||||
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit()) {
|
||||
itemStack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
slots = new ItemStack[getSizeInventory()];
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return this.hasCustomInventoryName() ? this.customName : "container.satDock";
|
||||
}
|
||||
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 boolean hasCustomInventoryName() {
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomName(String name) {
|
||||
this.customName = name;
|
||||
}
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
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 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 int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return access;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i == 2 || i == 3 || i == 4 || i == 5) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
return this.isItemValidForSlot(i, itemStack);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if(slots[i] != null) {
|
||||
if(slots[i].stackSize <= j) {
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
}
|
||||
ItemStack itemStack1 = slots[i].splitStack(j);
|
||||
if(slots[i].stackSize == 0) {
|
||||
slots[i] = null;
|
||||
}
|
||||
SatelliteSavedData data = null;
|
||||
|
||||
return itemStack1;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!worldObj.isRemote) {
|
||||
if (data == null)
|
||||
data = (SatelliteSavedData) worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
|
||||
|
||||
slots = new ItemStack[getSizeInventory()];
|
||||
if (data == null) {
|
||||
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData());
|
||||
data = (SatelliteSavedData) worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
|
||||
}
|
||||
data.markDirty();
|
||||
|
||||
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();
|
||||
if (data != null && slots[15] != null) {
|
||||
int freq = ISatChip.getFreqS(slots[15]);
|
||||
|
||||
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 access;
|
||||
}
|
||||
Satellite sat = data.getSatFromFreq(freq);
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
return this.isItemValidForSlot(i, itemStack);
|
||||
}
|
||||
int delay = 10 * 60 * 1000;
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return true;
|
||||
}
|
||||
|
||||
SatelliteSavedData data = null;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (sat instanceof SatelliteMiner) {
|
||||
SatelliteMiner miner = (SatelliteMiner) sat;
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if (miner.lastOp + delay < System.currentTimeMillis()) {
|
||||
EntityMinerRocket rocket = new EntityMinerRocket(worldObj);
|
||||
rocket.posX = xCoord + 0.5;
|
||||
rocket.posY = 300;
|
||||
rocket.posZ = zCoord + 0.5;
|
||||
|
||||
if(data == null)
|
||||
data = (SatelliteSavedData) worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
|
||||
rocket.getDataWatcher().updateObject(17, freq);
|
||||
worldObj.spawnEntityInWorld(rocket);
|
||||
miner.lastOp = System.currentTimeMillis();
|
||||
data.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(data == null) {
|
||||
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData());
|
||||
data = (SatelliteSavedData) worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
|
||||
}
|
||||
data.markDirty();
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord - 0.25 + 0.5, yCoord + 0.75, zCoord - 0.25 + 0.5, xCoord + 0.25 + 0.5, yCoord + 2, zCoord + 0.25 + 0.5));
|
||||
|
||||
if(data != null && slots[15] != null) {
|
||||
int freq = ISatChip.getFreqS(slots[15]);
|
||||
for (Entity e : list) {
|
||||
if (e instanceof EntityMinerRocket) {
|
||||
EntityMinerRocket rocket = (EntityMinerRocket) e;
|
||||
|
||||
Satellite sat = data.getSatFromFreq(freq);
|
||||
if (slots[15] != null && ISatChip.getFreqS(slots[15]) != rocket.getDataWatcher().getWatchableObjectInt(17)) {
|
||||
rocket.setDead();
|
||||
ExplosionNukeSmall.explode(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, ExplosionNukeSmall.PARAMS_TOTS);
|
||||
break;
|
||||
}
|
||||
|
||||
int delay = 10 * 60 * 1000;
|
||||
if (rocket.getDataWatcher().getWatchableObjectInt(16) == 1 && rocket.timer == 50) {
|
||||
Satellite sat = data.getSatFromFreq(ISatChip.getFreqS(slots[15]));
|
||||
unloadCargo((SatelliteMiner) sat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(sat instanceof SatelliteMiner) {
|
||||
ejectInto(xCoord + 2, yCoord, zCoord);
|
||||
ejectInto(xCoord - 2, yCoord, zCoord);
|
||||
ejectInto(xCoord, yCoord, zCoord + 2);
|
||||
ejectInto(xCoord, yCoord, zCoord - 2);
|
||||
}
|
||||
}
|
||||
|
||||
SatelliteMiner miner = (SatelliteMiner) sat;
|
||||
static final Random rand = new Random();
|
||||
|
||||
if(miner.lastOp + delay < System.currentTimeMillis()) {
|
||||
private void unloadCargo(SatelliteMiner satellite) {
|
||||
int items = rand.nextInt(6) + 10;
|
||||
|
||||
EntityMinerRocket rocket = new EntityMinerRocket(worldObj);
|
||||
rocket.posX = xCoord + 0.5;
|
||||
rocket.posY = 300;
|
||||
rocket.posZ = zCoord + 0.5;
|
||||
WeightedRandomObject[] cargo = satellite.getCargo();
|
||||
|
||||
rocket.satelliteClassName = miner.getClass().getName();
|
||||
for (int i = 0; i < items; i++) {
|
||||
ItemStack stack = ((WeightedRandomObject) WeightedRandom.getRandomItem(rand, cargo)).asStack();
|
||||
addToInv(stack.copy());
|
||||
}
|
||||
}
|
||||
|
||||
rocket.getDataWatcher().updateObject(17, freq);
|
||||
worldObj.spawnEntityInWorld(rocket);
|
||||
miner.lastOp = System.currentTimeMillis();
|
||||
data.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void addToInv(ItemStack stack) {
|
||||
for (int i = 0; i < 15; i++) {
|
||||
if (slots[i] != null && slots[i].getItem() == stack.getItem() && slots[i].getItemDamage() == stack.getItemDamage() && slots[i].stackSize < slots[i].getMaxStackSize()) {
|
||||
int toAdd = Math.min(slots[i].getMaxStackSize() - slots[i].stackSize, stack.stackSize);
|
||||
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord - 0.25 + 0.5, yCoord + 0.75, zCoord - 0.25 + 0.5, xCoord + 0.25 + 0.5, yCoord + 2, zCoord + 0.25 + 0.5));
|
||||
slots[i].stackSize += toAdd;
|
||||
stack.stackSize -= toAdd;
|
||||
|
||||
for(Entity e : list) {
|
||||
if (stack.stackSize <= 0) return;
|
||||
}
|
||||
}
|
||||
|
||||
if(e instanceof EntityMinerRocket) {
|
||||
for (int i = 0; i < 15; i++) {
|
||||
if (slots[i] == null) {
|
||||
slots[i] = new ItemStack(stack.getItem(), 1, stack.getItemDamage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EntityMinerRocket rocket = (EntityMinerRocket) e;
|
||||
private void ejectInto(int x, int y, int z) {
|
||||
TileEntity te = worldObj.getTileEntity(x, y, z);
|
||||
|
||||
if(slots[15] != null && ISatChip.getFreqS(slots[15]) != rocket.getDataWatcher().getWatchableObjectInt(17)) {
|
||||
rocket.setDead();
|
||||
ExplosionNukeSmall.explode(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, ExplosionNukeSmall.PARAMS_TOTS);
|
||||
break;
|
||||
}
|
||||
if (te instanceof IInventory) {
|
||||
IInventory chest = (IInventory) te;
|
||||
|
||||
if(rocket.getDataWatcher().getWatchableObjectInt(16) == 1 && rocket.timer == 50) {
|
||||
unloadCargo(rocket.satelliteClassName);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 15; i++) {
|
||||
if (slots[i] != null) {
|
||||
for (int j = 0; j < chest.getSizeInventory(); j++) {
|
||||
ItemStack sta = slots[i].copy();
|
||||
sta.stackSize = 1;
|
||||
|
||||
ejectInto(xCoord + 2, yCoord, zCoord);
|
||||
ejectInto(xCoord - 2, yCoord, zCoord);
|
||||
ejectInto(xCoord, yCoord, zCoord + 2);
|
||||
ejectInto(xCoord, yCoord, zCoord - 2);
|
||||
}
|
||||
}
|
||||
|
||||
static Random rand = new Random();
|
||||
|
||||
private void unloadCargo(String satelliteClassName) {
|
||||
int items = rand.nextInt(6) + 10;
|
||||
if (chest.getStackInSlot(j) != null && chest.getStackInSlot(j).isItemEqual(slots[i]) && ItemStack.areItemStackTagsEqual(chest.getStackInSlot(j), slots[i]) &&
|
||||
chest.getStackInSlot(j).stackSize < chest.getStackInSlot(j).getMaxStackSize()) {
|
||||
|
||||
WeightedRandomObject[] cargo = SatelliteMinerCargoRegistry.getCargo(satelliteClassName);
|
||||
slots[i].stackSize--;
|
||||
|
||||
for(int i = 0; i < items; i++) {
|
||||
if (slots[i].stackSize <= 0)
|
||||
slots[i] = null;
|
||||
|
||||
ItemStack stack = ((WeightedRandomObject)WeightedRandom.getRandomItem(rand, cargo)).asStack();
|
||||
addToInv(stack.copy());
|
||||
}
|
||||
}
|
||||
|
||||
private void addToInv(ItemStack stack) {
|
||||
|
||||
for(int i = 0; i < 15; i++) {
|
||||
|
||||
if(slots[i] != null && slots[i].getItem() == stack.getItem() && slots[i].getItemDamage() == stack.getItemDamage() && slots[i].stackSize < slots[i].getMaxStackSize()) {
|
||||
|
||||
int toAdd = Math.min(slots[i].getMaxStackSize() - slots[i].stackSize, stack.stackSize);
|
||||
|
||||
slots[i].stackSize += toAdd;
|
||||
stack.stackSize -= toAdd;
|
||||
|
||||
if(stack.stackSize <= 0) return;
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 15; i++) {
|
||||
|
||||
if(slots[i] == null) {
|
||||
slots[i] = new ItemStack(stack.getItem(), 1, stack.getItemDamage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ejectInto(int x, int y, int z) {
|
||||
chest.getStackInSlot(j).stackSize++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TileEntity te = worldObj.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof IInventory) {
|
||||
|
||||
IInventory chest = (IInventory)te;
|
||||
|
||||
for(int i = 0; i < 15; i++) {
|
||||
|
||||
if(slots[i] != null) {
|
||||
|
||||
for(int j = 0; j < chest.getSizeInventory(); j++) {
|
||||
|
||||
ItemStack sta = slots[i].copy();
|
||||
sta.stackSize = 1;
|
||||
|
||||
if(chest.getStackInSlot(j) != null && chest.getStackInSlot(j).isItemEqual(slots[i]) && ItemStack.areItemStackTagsEqual(chest.getStackInSlot(j), slots[i]) &&
|
||||
chest.getStackInSlot(j).stackSize < chest.getStackInSlot(j).getMaxStackSize()) {
|
||||
|
||||
slots[i].stackSize--;
|
||||
|
||||
if(slots[i].stackSize <= 0)
|
||||
slots[i] = null;
|
||||
|
||||
chest.getStackInSlot(j).stackSize++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 15; i++) {
|
||||
|
||||
if(slots[i] != null) {
|
||||
|
||||
for(int j = 0; j < chest.getSizeInventory(); j++) {
|
||||
|
||||
ItemStack sta = slots[i].copy();
|
||||
sta.stackSize = 1;
|
||||
|
||||
if(chest.getStackInSlot(j) == null && chest.isItemValidForSlot(j, sta)) {
|
||||
|
||||
slots[i].stackSize--;
|
||||
|
||||
if(slots[i].stackSize <= 0)
|
||||
slots[i] = null;
|
||||
|
||||
chest.setInventorySlotContents(j, sta);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 1,
|
||||
yCoord,
|
||||
zCoord - 1,
|
||||
xCoord + 2,
|
||||
yCoord + 1,
|
||||
zCoord + 2
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
for (int i = 0; i < 15; i++) {
|
||||
if (slots[i] != null) {
|
||||
for (int j = 0; j < chest.getSizeInventory(); j++) {
|
||||
ItemStack sta = slots[i].copy();
|
||||
sta.stackSize = 1;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
if (chest.getStackInSlot(j) == null && chest.isItemValidForSlot(j, sta)) {
|
||||
slots[i].stackSize--;
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerSatDock(player.inventory, this);
|
||||
}
|
||||
if (slots[i].stackSize <= 0)
|
||||
slots[i] = null;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUISatDock(player.inventory, this);
|
||||
}
|
||||
chest.setInventorySlotContents(j, sta);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
if (bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 1,
|
||||
yCoord,
|
||||
zCoord - 1,
|
||||
xCoord + 2,
|
||||
yCoord + 1,
|
||||
zCoord + 2
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerSatDock(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUISatDock(player.inventory, this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2497,6 +2497,7 @@ item.grenade_aschrab.name=Tossable Antischrabidium Cell
|
||||
item.grenade_black_hole.name=Black Hole Grenade
|
||||
item.grenade_breach.name=Breaching Grenade
|
||||
item.grenade_burst.name=Digger Grenade
|
||||
item.grenate_cats.name=Grenade of Cats
|
||||
item.grenade_cloud.name=Jar of Cloud
|
||||
item.grenade_cluster.name=Cluster Bomb
|
||||
item.grenade_electric.name=Lightning Bomb
|
||||
@ -3128,6 +3129,9 @@ item.mysteryshovel.name=Brittle Spade
|
||||
item.n2_charge.name=Large Explosive Charge
|
||||
item.neutrino_lens.name=Neutrino Lens
|
||||
item.neutron_reflector.name=Neutron Reflector
|
||||
item.night_vision.name=Night Vision Goggles
|
||||
item.night_vision.description.item=Grants you night vision (requires full electric set)
|
||||
item.night_vision.description.in_armor=%s (grants night vision)
|
||||
item.niter.name=Niter
|
||||
item.no9.name=Mining Helmet
|
||||
item.nossy_hat.name=Fabulous Hat
|
||||
@ -3900,6 +3904,9 @@ item.singularity_super_heated.name=Superheated Resonating Singularity
|
||||
item.siox.name=SiOX Cancer Medication
|
||||
item.siox.desc=Reverses mesothelioma with the power of Asbestos!
|
||||
item.siren_track.name=Siren Track
|
||||
item.sliding_blast_door_skin.0.name=Sliding Blast Door Skin: Default
|
||||
item.sliding_blast_door_skin.1.name=Sliding Blast Door Skin: Variant 1
|
||||
item.sliding_blast_door_skin.2.name=Sliding Blast Door Skin: Variant 2
|
||||
item.smashing_hammer.name=Smashing Hammer
|
||||
item.solid_fuel.name=Solid Fuel
|
||||
item.solid_fuel_bf.name=Solid Fuel (Balefire)
|
||||
@ -5153,6 +5160,7 @@ tile.sellafield.4.name=Infernal Sellafite
|
||||
tile.sellafield.5.name=Sellafite-Corium
|
||||
tile.sellafield_slaked.name=Slaked Sellafite
|
||||
tile.semtex.name=Semtex
|
||||
tile.sliding_blast_door.name=Sliding Blast Door
|
||||
tile.solar_mirror.name=Heliostat Mirror
|
||||
tile.soyuz_capsule.name=Cargo Landing Capsule
|
||||
tile.soyuz_launcher.name=Soyuz Launch Platform
|
||||
|
||||
@ -477,6 +477,9 @@ item.plate_titanium.name=Plaque en titane
|
||||
item.plate_aluminium.name=Plaque d'aluminium
|
||||
item.wire_red_copper.name=Fil de cuivre rouge
|
||||
item.neutron_reflector.name=Reflecteur neutronique
|
||||
item.night_vision.name=Lunettes de vision nocturne
|
||||
item.night_vision.description.item=Donne la vision nocturne (nécessite un set électrique complet)
|
||||
item.night_vision.description.in_armor=%s (donne la vision nocturne)
|
||||
item.nugget_beryllium.name=Pépite de béryllium
|
||||
|
||||
item.wire_aluminium.name=Fil d'aluminium
|
||||
@ -913,6 +916,7 @@ item.grenade_strong.name=Grenade ameliorée
|
||||
item.grenade_frag.name=Grenade Frag
|
||||
item.grenade_fire.name=Grenade Frag incendiaire
|
||||
item.grenade_shrapnel.name=Grenade à fragmentation
|
||||
item.grenate_cats.name=Grenade à chats
|
||||
item.grenade_cluster.name=Grenade à fragmentation
|
||||
item.grenade_flare.name=Flare
|
||||
item.grenade_electric.name=Grenade à éclairs
|
||||
|
||||
@ -2623,6 +2623,9 @@ item.plate_titanium.name=Титановая пластина
|
||||
item.plate_aluminium.name=Алюминиевая пластина
|
||||
item.wire_red_copper.name=Провод из красной меди
|
||||
item.neutron_reflector.name=Отражатель нейтронов
|
||||
item.night_vision.name=Очки ночного зрения
|
||||
item.night_vision.description.item=Даёт ночное зрение (нуждается в полном электрическом сете)
|
||||
item.night_vision.description.in_armor=%s (даёт ночное зрение)
|
||||
item.nugget_beryllium.name=Бериллиевый самородок
|
||||
item.nugget_bismuth.name=Самородок висмута
|
||||
item.nugget_tantalium.name=Самородок тантала
|
||||
@ -3876,6 +3879,7 @@ item.grenade_strong.name=Усовершенствованная граната
|
||||
item.grenade_frag.name=Осколочная граната
|
||||
item.grenade_fire.name=Огненная осколочная граната
|
||||
item.grenade_shrapnel.name=Граната со шрапнелью
|
||||
item.grenate_cats.name=Граната с котами
|
||||
item.grenade_cluster.name=Кластерная бомба
|
||||
item.grenade_flare.name=Сигнальная ракета
|
||||
item.grenade_electric.name=Электрограната
|
||||
|
||||
@ -59,6 +59,9 @@
|
||||
"door.wghStart": {"category": "block", "sounds": [{"name": "block/door/wgh_start", "stream": true}]},
|
||||
"door.wghStop": {"category": "block", "sounds": [{"name": "block/door/wgh_stop", "stream": true}]},
|
||||
"door.alarm6": {"category": "block", "sounds": [{"name": "block/door/alarm6", "stream": true}]},
|
||||
"door.sliding_door_shut": {"category": "block", "sounds": [{"name": "block/door/sliding_door_shut", "stream": false}]},
|
||||
"door.sliding_door_opened": {"category": "block", "sounds": [{"name": "block/door/sliding_door_opened", "stream": false}]},
|
||||
"door.sliding_door_opening": {"category": "block", "sounds": [{"name": "block/door/sliding_door_opening", "stream": false}]},
|
||||
|
||||
"item.techBleep": {"category": "player", "sounds": [{"name": "tool/techBleep", "stream": false}]},
|
||||
"item.techBoop": {"category": "player", "sounds": [{"name": "tool/techBoop", "stream": false}]},
|
||||
|
||||
|
After Width: | Height: | Size: 246 B |
BIN
src/main/resources/assets/hbm/textures/items/grenade_cats.png
Normal file
|
After Width: | Height: | Size: 764 B |
BIN
src/main/resources/assets/hbm/textures/items/night_vision.png
Normal file
|
After Width: | Height: | Size: 216 B |
|
After Width: | Height: | Size: 198 B |
|
After Width: | Height: | Size: 246 B |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 40 KiB |