- 1,185
- 3
Код:
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.InstantiationException: com.svk.industrialGuns.Tile.TileTableGunCreate
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.Class.newInstance(Unknown Source)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.tileentity.TileEntity.createAndLoadEntity(TileEntity.java:123)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.chunk.storage.AnvilChunkLoader.loadEntities(AnvilChunkLoader.java:525)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraftforge.common.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:41)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraftforge.common.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:12)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraftforge.common.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:344)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraftforge.common.util.AsynchronousExecutor.getSkipQueue(AsynchronousExecutor.java:302)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:12)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:144)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:119)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:305)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:79)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:96)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: Caused by: java.lang.NoSuchMethodException: com.svk.industrialGuns.Tile.TileTableGunCreate.<init>()
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.Class.getConstructor0(Unknown Source)
[21:07:52] [Server thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: ... 15 more
[21:07:52] [Server thread/WARN]: Skipping BlockEntity with id TableGunCreate
Код блока:
Код:
package com.svk.industrialGuns.blocks;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;//?
import com.svk.industrialGuns.Tile.TileTableGunCreate;
import com.svk.industrialGuns.base.BaseClassMod;
public class TableGunCreate extends BlockContainer
{
private float power = 0;
public TableGunCreate(float power)
{
super(Material.wood);
this.power = power;
}
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
{
if(world.isRemote)
{
return true;
} else {
player.openGui(BaseClassMod.instance, BaseClassMod.guiTableGunCreate, world, x, y, z);
return true;
}
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
{
return new TileTableGunCreate(power/20.0F);
}
}
Код тайла:
Код:
package com.svk.industrialGuns.Tile;
import buildcraft.api.gates.IGate;
import buildcraft.api.transport.IPipe;
import buildcraft.api.transport.IPipeConnection;
import buildcraft.api.transport.IPipeTile;
import buildcraft.api.transport.IPipeTile.PipeType;
import buildcraft.api.transport.PipeWire;
import com.svk.industrialGuns.base.CommonProxy;
import com.svk.industrialGuns.craft.CraftingManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public class TileTableGunCreate extends TileEntity implements ISidedInventory, IPipeConnection
{
private ItemStack[] slots = new ItemStack[8];
public TileTableGunCreate(float power)
{
}
public void updateEntity()
{
}
public void readFromNBT(NBTTagCompound nbt)
{
System.out.println("+");
super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("Slots", 8);
this.slots = new ItemStack[getSizeInventory()];
for(int i = 0; i < list.tagCount(); i++)
{
NBTTagCompound item = list.getCompoundTagAt(i);
byte b = item.getByte("Item");
if(b >= 0 && b < this.slots.length)
{
this.slots[b] = ItemStack.loadItemStackFromNBT(item);
}
if(nbt.hasKey("TableGunCreate"))
{
this.setInventoryName(nbt.getString("TableGunCreate"));
}
}
}
public void writeToNBT(NBTTagCompound nbt)
{
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
for(int i = 0; i < this.slots.length; i++)
{
if(this.slots[i] != null)
{
NBTTagCompound item = new NBTTagCompound();
item.setByte("Item", (byte) i);
this.slots[i].writeToNBT(item);
list.appendTag(item);
}
}
nbt.setTag("Slots", list);
if(this.hasCustomInventoryName())
{
nbt.setString("TableGunCreate", this.getInventoryName());
}
}
@Override
public int getSizeInventory()
{
return this.slots.length;
}
@Override
public ItemStack getStackInSlot(int i)
{
return this.slots[i];
}
public ItemStack decrStackSize(int i, int j)
{
System.out.println(i);
if(this.slots[i] != null)
{
ItemStack itemstack;
if(this.slots[i].stackSize < j)
{
itemstack = this.slots[i];
this.slots[i] = null;
return itemstack;
}
else
{
itemstack = this.slots[i].splitStack(j);
if(this.slots[i].stackSize == 0)
{
this.slots[i] = null;
}
return itemstack;
}
}
return null;
}
public ItemStack getStackInSlotOnClosing(int i)
{
if(this.slots[i] != null)
{
ItemStack itemstack = this.slots[i];
this.slots[i] = null;
return itemstack;
}
return null;
}
@Override
public void setInventorySlotContents(int i, ItemStack itemstack)
{
this.slots[i] = itemstack;
if(itemstack != null && itemstack.stackSize > this.getInventoryStackLimit())
{
itemstack.stackSize = this.getInventoryStackLimit();
}
}
public void setInventoryName(String string)
{
}
public String getInventoryName()
{
return null;
}
@Override
public boolean hasCustomInventoryName() {
// TODO Auto-generated method stub
return false;
}
@Override
public int getInventoryStackLimit() {
// TODO Auto-generated method stub
return 64;
}
@Override
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
// TODO Auto-generated method stub
return false;
}
@Override
public void openInventory()
{
}
@Override
public void closeInventory()
{
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack itemStack)
{
if(slots[slot] != null)
{
return true;
}
else
{
return false;
}
}
@Override
public int[] getAccessibleSlotsFromSide(int p_94128_1_)
{
int slotsReturn[] = {0,1,2,3,4,5,6,7,8};
return slotsReturn;
}
@Override
public boolean canInsertItem(int slot, ItemStack stack, int side)
{
return isItemValidForSlot(slot, stack);
}
@Override
public boolean canExtractItem(int slot, ItemStack stack, int side)
{
if(slot == 7 && slot == 8)
{
return true;
}
else
{
return false;
}
}
@Override
public ConnectOverride overridePipeConnection(PipeType type, ForgeDirection with)
{
return ConnectOverride.DISCONNECT;
}
}