new shredder blade model, alt bullets (buckshot, bmg, 9 and 5mm)

This commit is contained in:
HbmMods 2019-01-09 17:43:45 +01:00
parent 6519d80655
commit 0c18361b8b
44 changed files with 2392 additions and 3191 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

View File

@ -11,6 +11,8 @@ public class BulletConfiguration {
public Item ammo;
//spread of bullets in gaussian range
public float spread;
//weapon durability reduced (centered around 10)
public float tear;
//damage bounds
public float dmgMin;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
package com.hbm.inventory.container;
public class ContainerLeadBox {
}

View File

@ -0,0 +1,5 @@
package com.hbm.inventory.gui;
public class GUILeadBox {
}

View File

@ -707,6 +707,8 @@ public class ModItems {
public static Item waste_plutonium_hot;
public static Item waste_mox_hot;
public static Item waste_schrabidium_hot;
public static Item containment_box;
public static Item rod_lithium;
public static Item rod_dual_lithium;
@ -787,6 +789,24 @@ public class ModItems {
public static Item sat_chip;
public static Item sat_interface;
public static Item ammo_12gauge;
public static Item ammo_12gauge_incendiary;
public static Item ammo_20gauge;
public static Item ammo_20gauge_slug;
public static Item ammo_20gauge_flechette;
public static Item ammo_20gauge_incendiary;
public static Item ammo_20gauge_explosive;
public static Item ammo_20gauge_caustic;
public static Item ammo_20gauge_shock;
public static Item ammo_20gauge_wither;
public static Item ammo_5mm;
public static Item ammo_5mm_explosive;
public static Item ammo_9mm;
public static Item ammo_9mm_ap;
public static Item ammo_50bmg;
public static Item ammo_50bmg_incendiary;
public static Item ammo_50bmg_explosive;
public static Item gun_rpg;
public static Item gun_rpg_ammo;
public static Item gun_stinger;
@ -1457,6 +1477,7 @@ public class ModItems {
public static final int guiID_item_folder = 99;
public static final int guiID_item_designator = 100;
public static final int guiID_item_sat_interface = 101;
public static final int guiID_item_box = 102;
public static Item mysteryshovel;
public static Item memory;
@ -2096,6 +2117,7 @@ public class ModItems {
waste_mox_hot = new ItemCustomLore().setUnlocalizedName("waste_mox_hot").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":waste_mox_hot");
waste_schrabidium_hot = new ItemCustomLore().setUnlocalizedName("waste_schrabidium_hot").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":waste_schrabidium_hot");
scrap = new Item().setUnlocalizedName("scrap").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":scrap");
containment_box = new ItemLeadBox().setUnlocalizedName("containment_box").setCreativeTab(null).setTextureName(RefStrings.MODID + ":containment_box");
rod_thorium_fuel_depleted = new ItemCustomLore().setUnlocalizedName("rod_thorium_fuel_depleted").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_thorium_fuel_depleted");
rod_dual_thorium_fuel_depleted = new ItemCustomLore().setUnlocalizedName("rod_dual_thorium_fuel_depleted").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_thorium_fuel_depleted");
rod_quad_thorium_fuel_depleted = new ItemCustomLore().setUnlocalizedName("rod_quad_thorium_fuel_depleted").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_thorium_fuel_depleted");
@ -2170,7 +2192,25 @@ public class ModItems {
sat_resonator = new ItemSatChip().setUnlocalizedName("sat_resonator").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_resonator");
sat_chip = new ItemSatChip().setUnlocalizedName("sat_chip").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_chip");
sat_interface = new ItemSatInterface().setUnlocalizedName("sat_interface").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_interface");
ammo_12gauge = new Item().setUnlocalizedName("ammo_12gauge").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_12gauge");
ammo_12gauge_incendiary = new Item().setUnlocalizedName("ammo_12gauge_incendiary").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_12gauge_incendiary");
ammo_20gauge = new Item().setUnlocalizedName("ammo_20gauge").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge");
ammo_20gauge_slug = new Item().setUnlocalizedName("ammo_20gauge_slug").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge_slug");
ammo_20gauge_flechette = new Item().setUnlocalizedName("ammo_20gauge_flechette").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge_flechette");
ammo_20gauge_incendiary = new Item().setUnlocalizedName("ammo_20gauge_incendiary").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge_incendiary");
ammo_20gauge_explosive = new Item().setUnlocalizedName("ammo_20gauge_explosive").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge_explosive");
ammo_20gauge_caustic = new Item().setUnlocalizedName("ammo_20gauge_caustic").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge_caustic");
ammo_20gauge_shock = new Item().setUnlocalizedName("ammo_20gauge_shock").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge_shock");
ammo_20gauge_wither = new Item().setUnlocalizedName("ammo_20gauge_wither").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_20gauge_wither");
ammo_5mm = new Item().setUnlocalizedName("ammo_5mm").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_5mm");
ammo_5mm_explosive = new Item().setUnlocalizedName("ammo_5mm_explosive").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_5mm_explosive");
ammo_9mm = new Item().setUnlocalizedName("ammo_9mm").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_9mm");
ammo_9mm_ap = new Item().setUnlocalizedName("ammo_9mm_ap").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_9mm_ap");
ammo_50bmg = new Item().setUnlocalizedName("ammo_50bmg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50bmg");
ammo_50bmg_incendiary = new Item().setUnlocalizedName("ammo_50bmg_incendiary").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50bmg_incendiary");
ammo_50bmg_explosive = new Item().setUnlocalizedName("ammo_50bmg_explosive").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50bmg_explosive");
gun_rpg = new GunRpg().setUnlocalizedName("gun_rpg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_rpg_new");
gun_rpg_ammo = new Item().setUnlocalizedName("gun_rpg_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_rpg_ammo_alt");
gun_stinger = new GunStinger().setUnlocalizedName("gun_stinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_stinger");
@ -3697,6 +3737,7 @@ public class ModItems {
GameRegistry.registerItem(oil_detector, oil_detector.getUnlocalizedName());
GameRegistry.registerItem(survey_scanner, survey_scanner.getUnlocalizedName());
GameRegistry.registerItem(geiger_counter, geiger_counter.getUnlocalizedName());
GameRegistry.registerItem(containment_box, containment_box.getUnlocalizedName());
//Keys and Locks
GameRegistry.registerItem(key, key.getUnlocalizedName());
@ -3844,6 +3885,24 @@ public class ModItems {
GameRegistry.registerItem(gun_hp_ammo, gun_hp_ammo.getUnlocalizedName());
GameRegistry.registerItem(gun_defabricator_ammo, gun_defabricator_ammo.getUnlocalizedName());
GameRegistry.registerItem(gun_euthanasia_ammo, gun_euthanasia_ammo.getUnlocalizedName());
GameRegistry.registerItem(ammo_12gauge, ammo_12gauge.getUnlocalizedName());
GameRegistry.registerItem(ammo_12gauge_incendiary, ammo_12gauge_incendiary.getUnlocalizedName());
GameRegistry.registerItem(ammo_20gauge, ammo_20gauge.getUnlocalizedName());
GameRegistry.registerItem(ammo_20gauge_slug, ammo_20gauge_slug.getUnlocalizedName());
GameRegistry.registerItem(ammo_20gauge_flechette, ammo_20gauge_flechette.getUnlocalizedName());
GameRegistry.registerItem(ammo_20gauge_incendiary, ammo_20gauge_incendiary.getUnlocalizedName());
GameRegistry.registerItem(ammo_20gauge_explosive, ammo_20gauge_explosive.getUnlocalizedName());
GameRegistry.registerItem(ammo_20gauge_caustic, ammo_20gauge_caustic.getUnlocalizedName());
GameRegistry.registerItem(ammo_20gauge_shock, ammo_20gauge_shock.getUnlocalizedName());
GameRegistry.registerItem(ammo_20gauge_wither, ammo_20gauge_wither.getUnlocalizedName());
GameRegistry.registerItem(ammo_5mm, ammo_5mm.getUnlocalizedName());
GameRegistry.registerItem(ammo_5mm_explosive, ammo_5mm_explosive.getUnlocalizedName());
GameRegistry.registerItem(ammo_9mm, ammo_9mm.getUnlocalizedName());
GameRegistry.registerItem(ammo_9mm_ap, ammo_9mm_ap.getUnlocalizedName());
GameRegistry.registerItem(ammo_50bmg, ammo_50bmg.getUnlocalizedName());
GameRegistry.registerItem(ammo_50bmg_incendiary, ammo_50bmg_incendiary.getUnlocalizedName());
GameRegistry.registerItem(ammo_50bmg_explosive, ammo_50bmg_explosive.getUnlocalizedName());
//Turret Ammo
GameRegistry.registerItem(turret_light_ammo, turret_light_ammo.getUnlocalizedName());

View File

@ -0,0 +1,22 @@
package com.hbm.items.tool;
import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemLeadBox extends Item {
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if(world.isRemote)
player.openGui(MainRegistry.instance, ModItems.guiID_item_box, world, 0, 0, 0);
return stack;
}
}

View File

@ -25,6 +25,9 @@ public class ItemGunBase extends Item implements IHoldableWeapon {
private GunConfiguration mainConfig;
private GunConfiguration altConfig;
private boolean m1 = false;
private boolean m2 = false;
public ItemGunBase(GunConfiguration config) {
mainConfig = config;
}
@ -54,35 +57,41 @@ public class ItemGunBase extends Item implements IHoldableWeapon {
boolean clickLeft = Mouse.isButtonDown(0);
boolean clickRight = Mouse.isButtonDown(1);
boolean left = getIsMouseDown(stack);
boolean right = getIsAltDown(stack);
boolean left = m1; //getIsMouseDown(stack);
boolean right = m2; //getIsAltDown(stack);
if(isCurrentItem) {
if(left && right) {
PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(false, (byte) 0));
PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(false, (byte) 1));
setIsMouseDown(stack, false);
setIsAltDown(stack, false);
//setIsMouseDown(stack, false);
//setIsAltDown(stack, false);
m1 = false;
m2 = false;
}
if(!left && !right) {
if(clickLeft) {
PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(true, (byte) 0));
setIsMouseDown(stack, true);
//setIsMouseDown(stack, true);
m1 = true;
} else if(clickRight) {
PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(true, (byte) 1));
setIsAltDown(stack, true);
//setIsAltDown(stack, true);
m2 = true;
}
}
if(left && !clickLeft) {
PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(false, (byte) 0));
setIsMouseDown(stack, false);
//setIsMouseDown(stack, false);
m1 = false;
}
if(right && !clickRight) {
PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(false, (byte) 1));
setIsAltDown(stack, false);
//setIsAltDown(stack, false);
m2 = false;
}
if(mainConfig.reloadType != 0 || (altConfig != null && altConfig.reloadType != 0)) {
@ -104,12 +113,12 @@ public class ItemGunBase extends Item implements IHoldableWeapon {
}
//called on right click
//called on click
private void startAction(ItemStack stack, World world, EntityPlayer player, boolean main) {
}
//called on right click release
//called on click release
private void endAction(ItemStack stack, World world, EntityPlayer player, boolean main) {
}

View File

@ -39,6 +39,7 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.event.entity.EntityEvent.EnteringChunk;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
@ -59,10 +60,10 @@ public class ModEventHandler
}
@SubscribeEvent
public void onPlayerDeath(PlayerDropsEvent event) {
public void onPlayerDeath(LivingDeathEvent event) {
RadEntitySavedData eData = RadEntitySavedData.getData(event.entityPlayer.worldObj);
eData.setRadForEntity(event.entityPlayer, 0);
RadEntitySavedData eData = RadEntitySavedData.getData(event.entityLiving.worldObj);
eData.setRadForEntity(event.entityLiving, 0);
}
@SubscribeEvent

View File

@ -95,8 +95,7 @@ public class ResourceManager {
//Shredder
public static final IModelCustom shredder_body = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/shredder_body.obj"));
public static final IModelCustom shredder_blade1 = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/shredder_blade1.obj"));
public static final IModelCustom shredder_blade2 = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/shredder_blade2.obj"));
public static final IModelCustom shredder_blade = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/shredder_blade.obj"));
//Bombs
public static final IModelCustom bomb_solinium = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/ufp.obj"));

View File

@ -19,28 +19,25 @@ public class RenderMachineShredder extends TileEntitySpecialRenderer {
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glTranslated(0, -0.5, 0);
GL11.glRotatef(10, -1F, 0F, 1F);
bindTexture(ResourceManager.boxcar_tex);
bindTexture(ResourceManager.universal);
ResourceManager.shredder_body.renderAll();
GL11.glPushMatrix();
GL11.glTranslated(-0.25, 2.85, 0.4375/2);
GL11.glRotatef((System.currentTimeMillis() / 2) % 360, 0F, 0F, -1F);
GL11.glRotatef((System.currentTimeMillis() / 4) % 360, 0F, 0F, -1F);
bindTexture(ResourceManager.turbofan_blades_tex);
ResourceManager.shredder_blade1.renderAll();
ResourceManager.shredder_blade.renderAll();
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0.25, 2.85, 0);
GL11.glRotatef((System.currentTimeMillis() / 2) % 360, 0F, 0F, 1F);
GL11.glRotatef((System.currentTimeMillis() / 4) % 360, 0F, 0F, 1F);
bindTexture(ResourceManager.turbofan_blades_tex);
GL11.glScaled(-1, 1, 1);
ResourceManager.shredder_blade1.renderAll();
ResourceManager.shredder_blade.renderAll();
GL11.glPopMatrix();

View File

@ -1,7 +1,248 @@
package com.hbm.tileentity.machine;
import net.minecraft.tileentity.TileEntity;
import java.util.List;
import java.util.Random;
public class TileEntityMachineShredderLarge extends TileEntity {
import com.hbm.interfaces.IConsumer;
import com.hbm.inventory.MachineRecipes;
import com.hbm.items.ModItems;
import com.hbm.items.special.ItemBattery;
import com.hbm.items.tool.ItemAssemblyTemplate;
import com.hbm.lib.Library;
import com.hbm.packet.AuxElectricityPacket;
import com.hbm.packet.LoopedSoundPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.TEAssemblerPacket;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
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;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.tileentity.TileEntityHopper;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.oredict.OreDictionary;
public class TileEntityMachineShredderLarge extends TileEntity implements ISidedInventory, IConsumer {
private ItemStack slots[];
public long power;
public static final long maxPower = 100000;
public int progress;
public int maxProgress = 100;
Random rand = new Random();
private String customName;
public TileEntityMachineShredderLarge() {
slots = new ItemStack[31];
}
@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.assembler";
}
@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) <=128;
}
}
//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) {
if(i == 0)
if(itemStack.getItem() instanceof ItemBattery)
return true;
if(i == 1)
return true;
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);
this.power = nbt.getLong("powerTime");
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);
nbt.setLong("powerTime", power);
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 new int[] { 0 };
}
@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;
}
public long getPowerScaled(long i) {
return (power * i) / maxPower;
}
public int getProgressScaled(int i) {
return (progress * i) / maxProgress;
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power));
}
}
@Override
public void setPower(long i) {
power = i;
}
@Override
public long getPower() {
return power;
}
@Override
public long getMaxPower() {
return maxPower;
}
@Override
public AxisAlignedBB getRenderBoundingBox() {
return TileEntity.INFINITE_EXTENT_AABB;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared()
{
return 65536.0D;
}
}