Fixing Stuff

This commit is contained in:
Ellpeck 2014-12-12 15:40:01 +01:00
parent 5eb1a30871
commit d48ae1dd49
10 changed files with 167 additions and 412 deletions

View file

@ -1,287 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions>
<entry name=".+\.(properties|xml|html|dtd|tld)" />
<entry name=".+\.(gif|png|jpeg|jpg)" />
</resourceExtensions>
<wildcardResourcePatterns>
<entry name="!?*.groovy" />
<entry name="!?*.java" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
<component name="CopyrightManager" default="" />
<component name="DependencyValidationManager">
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</component>
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="GradleUISettings">
<setting name="root" />
</component>
<component name="GradleUISettings2">
<setting name="root" />
</component>
<component name="IdProvider" IDEtalkID="11DA1DB66DD62DDA1ED602B7079FE97C" />
<component name="InspectionProjectProfileManager">
<profiles>
<profile version="1.0" is_locked="false">
<option name="myName" value="Project Default" />
<option name="myLocal" value="false" />
<inspection_tool class="GroovyAssignabilityCheck" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="GroovyUnusedAssignment" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
</profile>
</profiles>
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</component>
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" />
<option name="OPTION_SCOPE" value="protected" />
<option name="OPTION_HIERARCHY" value="true" />
<option name="OPTION_NAVIGATOR" value="true" />
<option name="OPTION_INDEX" value="true" />
<option name="OPTION_SEPARATE_INDEX" value="true" />
<option name="OPTION_DOCUMENT_TAG_USE" value="false" />
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
<option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
<option name="OPTION_DEPRECATED_LIST" value="true" />
<option name="OTHER_OPTIONS" value="" />
<option name="HEAP_SIZE" />
<option name="LOCALE" />
<option name="OPEN_IN_BROWSER" value="true" />
</component>
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
<component name="ProjectDictionaryState">
<dictionary name="Ellpeck">
<words>
<w>almandine</w>
<w>amazonite</w>
<w>andradite</w>
<w>clinohumite</w>
<w>crafter</w>
<w>danburite</w>
<w>diopside</w>
<w>ellpeck</w>
<w>fayalite</w>
<w>forsterite</w>
<w>gemification</w>
<w>glossular</w>
<w>goshen</w>
<w>goshenite</w>
<w>idiochromatic</w>
<w>iolite</w>
<w>lepidolite</w>
<w>mcmod</w>
<w>mcversion</w>
<w>melanite</w>
<w>minecraftforge</w>
<w>moldavite</w>
<w>nuummite</w>
<w>orthoclase</w>
<w>paraiba</w>
<w>peridot</w>
<w>pickaxe</w>
<w>rhodochrosite</w>
<w>rodochrosite</w>
<w>smithsonite</w>
<w>sodalite</w>
<w>sonatype</w>
<w>sphene</w>
<w>thingycraft</w>
<w>titanian</w>
<w>tourlamine</w>
</words>
</dictionary>
</component>
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/ThingyCraft.iml" filepath="$PROJECT_DIR$/ThingyCraft.iml" />
</modules>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SvnBranchConfigurationManager">
<option name="mySupportsUserInfoFilter" value="true" />
</component>
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<UIState>
<splitter-proportions>
<SplitterProportionsDataImpl />
</splitter-proportions>
<settings />
</UIState>
</state>
<state key="Copyright.UI">
<UIState>
<splitter-proportions>
<SplitterProportionsDataImpl />
</splitter-proportions>
</UIState>
</state>
<state key="ProjectJDKs.UI">
<UIState>
<splitter-proportions>
<SplitterProportionsDataImpl>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</SplitterProportionsDataImpl>
</splitter-proportions>
<last-edited>1.6</last-edited>
</UIState>
</state>
<state key="ScopeChooserConfigurable.UI">
<UIState>
<splitter-proportions>
<SplitterProportionsDataImpl />
</splitter-proportions>
<settings />
</UIState>
</state>
</states>
</component>
</project>

View file

@ -22,7 +22,7 @@ group = "ellpeck.gemification"
archivesBaseName = "Gemification" archivesBaseName = "Gemification"
minecraft { minecraft {
version = "1.7.10-10.13.2.1236" version = "1.7.10-10.13.2.1264"
runDir = "idea" runDir = "idea"
} }

View file

@ -0,0 +1,10 @@
package ellpeck.gemification.blocks.models;
import net.minecraft.client.model.ModelBase;
public class ModelBaseG extends ModelBase{
public void render(float f){
}
}

View file

@ -3,7 +3,7 @@ package ellpeck.gemification.blocks.models;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
public class ModelCrucible extends ModelBase{ public class ModelCrucible extends ModelBaseG{
public ModelRenderer floor, rimOne, rimTwo, rimThree, rimFour, wallOne, wallTwo, wallThree, wallFour, supportOne, supportTwo, supportThree, supportFour; public ModelRenderer floor, rimOne, rimTwo, rimThree, rimFour, wallOne, wallTwo, wallThree, wallFour, supportOne, supportTwo, supportThree, supportFour;
public ModelCrucible() { public ModelCrucible() {
@ -50,7 +50,7 @@ public class ModelCrucible extends ModelBase{
this.supportThree.addBox(0.0F, 0.0F, 0.0F, 2, 3, 2); this.supportThree.addBox(0.0F, 0.0F, 0.0F, 2, 3, 2);
} }
public void render(float f) { public void render(float f){
this.supportTwo.render(f); this.supportTwo.render(f);
this.wallTwo.render(f); this.wallTwo.render(f);
this.floor.render(f); this.floor.render(f);

View file

@ -8,10 +8,10 @@ import org.lwjgl.opengl.GL11;
public class RendererHoldingTileEntity implements IItemRenderer { public class RendererHoldingTileEntity implements IItemRenderer {
ModelCrucible model; ModelBaseG model;
ResourceLocation texture; ResourceLocation texture;
public RendererHoldingTileEntity(ModelCrucible model, ResourceLocation res){ public RendererHoldingTileEntity(ModelBaseG model, ResourceLocation res){
this.model = model; this.model = model;
texture = res; texture = res;
} }

View file

@ -18,10 +18,10 @@ public class CrucibleCraftingManager{
@SuppressWarnings("all") @SuppressWarnings("all")
public void initRecipes(){ public void initRecipes(){
this.addRecipe(new ItemStack(Blocks.acacia_stairs), Util.fluidNone, 200, new Object[]{"ccc", "cgc", "ccc", 'c', Blocks.cobblestone, 'g', new ItemStack(Items.stick)}); this.addRecipe(new ItemStack(Blocks.acacia_stairs), Util.fluidChromeDiopside, 200, new Object[]{"ccc", "cgc", "ccc", 'c', Blocks.cobblestone, 'g', new ItemStack(Items.stick)});
} }
@SuppressWarnings("static-access, unchecked") @SuppressWarnings("unchecked, static-access")
public void addRecipe(ItemStack output, GemType fluidNeeded, int processTimeNeeded, Object ... recipe){ public void addRecipe(ItemStack output, GemType fluidNeeded, int processTimeNeeded, Object ... recipe){
String s = ""; String s = "";
int i = 0; int i = 0;

View file

@ -0,0 +1,22 @@
package ellpeck.gemification.tile;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
public class TileEntityBase extends TileEntity{
public Packet getDescriptionPacket(){
NBTTagCompound compound = new NBTTagCompound();
this.writeToNBT(compound);
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), compound);
}
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet){
super.onDataPacket(net, packet);
this.readFromNBT(packet.func_148857_g());
}
}

View file

@ -18,17 +18,8 @@ import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
public class TileEntityCrucible extends TileEntity implements ISidedInventory { public class TileEntityCrucible extends TileEntityInventoryBase{
/**
* 0-3: Inputs
* 4: Main Input
* 5-8: Inputs
* 9: Water
* 10: Gem
* 11: Output
*/
public ItemStack slots[] = new ItemStack[12];
public final int slotOutput = 11; public final int slotOutput = 11;
public final int slotMainInput = 4; public final int slotMainInput = 4;
public final int slotWater = 9; public final int slotWater = 9;
@ -45,6 +36,18 @@ public class TileEntityCrucible extends TileEntity implements ISidedInventory {
private boolean isCrafting = false; private boolean isCrafting = false;
public static ItemStack output; public static ItemStack output;
public TileEntityCrucible(){
/**
* 0-3: Inputs
* 4: Main Input
* 5-8: Inputs
* 9: Water
* 10: Gem
* 11: Output
*/
this.slots = new ItemStack[12];
}
public void updateEntity(){ public void updateEntity(){
if(!worldObj.isRemote){ if(!worldObj.isRemote){
this.craft(); this.craft();
@ -101,127 +104,23 @@ public class TileEntityCrucible extends TileEntity implements ISidedInventory {
} }
} }
public int getSizeInventory() {
return slots.length;
}
public ItemStack getStackInSlot(int i) {
return slots[i];
}
public ItemStack decrStackSize(int i, int j) {
if (slots[i] != null) {
ItemStack stackAt;
if (slots[i].stackSize <= j) {
stackAt = slots[i];
slots[i] = null;
return stackAt;
} else {
stackAt = slots[i].splitStack(j);
if (slots[i].stackSize == 0)
slots[i] = null;
return stackAt;
}
}
return null;
}
public ItemStack getStackInSlotOnClosing(int i) {
return getStackInSlot(i);
}
public void setInventorySlotContents(int i, ItemStack stack){
this.slots[i] = stack;
}
public String getInventoryName() { public String getInventoryName() {
return InitBlocks.blockCrucible.getUnlocalizedName().substring(5); return InitBlocks.blockCrucible.getUnlocalizedName().substring(5);
} }
public boolean hasCustomInventoryName() {
return false;
}
public int getInventoryStackLimit() {
return 64;
}
public boolean isUseableByPlayer(EntityPlayer player) {
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this && player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
}
public void openInventory() {
}
public void closeInventory() {
}
public boolean isItemValidForSlot(int i, ItemStack stack) {
return false;
}
public void writeToNBT(NBTTagCompound compound){ public void writeToNBT(NBTTagCompound compound){
super.writeToNBT(compound); super.writeToNBT(compound);
NBTTagList tagList = new NBTTagList();
for(int currentIndex = 0; currentIndex < slots.length; ++currentIndex){
if (slots[currentIndex] != null){
NBTTagCompound tagCompound = new NBTTagCompound();
tagCompound.setByte("Slot", (byte)currentIndex);
slots[currentIndex].writeToNBT(tagCompound);
tagList.appendTag(tagCompound);
}
}
compound.setTag("Items", tagList);
compound.setInteger("CurrentFluidID", this.currentFluidID); compound.setInteger("CurrentFluidID", this.currentFluidID);
} }
public void readFromNBT(NBTTagCompound nbtTagCompound){ public void readFromNBT(NBTTagCompound compound){
super.readFromNBT(nbtTagCompound); super.readFromNBT(compound);
NBTTagList tagList = nbtTagCompound.getTagList("Items", 10); this.currentFluidID = compound.getInteger("CurrentFluidID");
for (int i = 0; i < tagList.tagCount(); ++i){
NBTTagCompound tagCompound = tagList.getCompoundTagAt(i);
byte slotIndex = tagCompound.getByte("Slot");
if (slotIndex >= 0 && slotIndex < slots.length){
slots[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound);
}
}
this.currentFluidID = nbtTagCompound.getInteger("CurrentFluidID");
if(this.currentFluidID == Util.fluidWater.ID) this.currentFluid = Util.fluidWater; if(this.currentFluidID == Util.fluidWater.ID) this.currentFluid = Util.fluidWater;
else if(this.currentFluidID == Util.fluidNone.ID) this.currentFluid = Util.fluidNone; else if(this.currentFluidID == Util.fluidNone.ID) this.currentFluid = Util.fluidNone;
else this.currentFluid = Util.gemList.get(this.currentFluidID); else this.currentFluid = Util.gemList.get(this.currentFluidID);
} }
public Packet getDescriptionPacket() {
NBTTagCompound compound = new NBTTagCompound();
this.writeToNBT(compound);
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), compound);
}
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
super.onDataPacket(net, packet);
this.readFromNBT(packet.func_148857_g());
}
public String getName() {
return InitBlocks.blockCrucible.getUnlocalizedName().substring(5);
}
public int[] getAccessibleSlotsFromSide(int side) {
return new int[0];
}
public boolean canInsertItem(int par1, ItemStack stack, int par3) {
return false;
}
public boolean canExtractItem(int par1, ItemStack stack, int par3) {
return false;
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public int getCraftProcessScaled(int par1){ public int getCraftProcessScaled(int par1){
return this.currentProcessTime * par1 / this.processTimeNeeded; return this.currentProcessTime * par1 / this.processTimeNeeded;

View file

@ -0,0 +1,111 @@
package ellpeck.gemification.tile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
public class TileEntityInventoryBase extends TileEntityBase implements ISidedInventory{
public ItemStack slots[];
public void writeToNBT(NBTTagCompound compound){
super.writeToNBT(compound);
NBTTagList tagList = new NBTTagList();
for(int currentIndex = 0; currentIndex < slots.length; ++currentIndex){
if (slots[currentIndex] != null){
NBTTagCompound tagCompound = new NBTTagCompound();
tagCompound.setByte("Slot", (byte)currentIndex);
slots[currentIndex].writeToNBT(tagCompound);
tagList.appendTag(tagCompound);
}
}
compound.setTag("Items", tagList);
}
public void readFromNBT(NBTTagCompound compound){
super.readFromNBT(compound);
NBTTagList tagList = compound.getTagList("Items", 10);
for (int i = 0; i < tagList.tagCount(); ++i){
NBTTagCompound tagCompound = tagList.getCompoundTagAt(i);
byte slotIndex = tagCompound.getByte("Slot");
if (slotIndex >= 0 && slotIndex < slots.length){
slots[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound);
}
}
}
public int[] getAccessibleSlotsFromSide(int side) {
return new int[0];
}
public boolean canInsertItem(int par1, ItemStack stack, int par3) {
return false;
}
public boolean canExtractItem(int par1, ItemStack stack, int par3) {
return false;
}
public boolean hasCustomInventoryName() {
return false;
}
public int getInventoryStackLimit() {
return 64;
}
public boolean isUseableByPlayer(EntityPlayer player) {
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this && player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
}
public void openInventory() {
}
public void closeInventory() {
}
public boolean isItemValidForSlot(int i, ItemStack stack) {
return false;
}
public ItemStack getStackInSlotOnClosing(int i) {
return getStackInSlot(i);
}
public void setInventorySlotContents(int i, ItemStack stack){
this.slots[i] = stack;
}
public String getInventoryName() {
return null;
}
public int getSizeInventory() {
return slots.length;
}
public ItemStack getStackInSlot(int i) {
return slots[i];
}
public ItemStack decrStackSize(int i, int j) {
if (slots[i] != null) {
ItemStack stackAt;
if (slots[i].stackSize <= j) {
stackAt = slots[i];
slots[i] = null;
return stackAt;
} else {
stackAt = slots[i].splitStack(j);
if (slots[i].stackSize == 0)
slots[i] = null;
return stackAt;
}
}
return null;
}
}

View file

@ -1,4 +1,4 @@
itemGroup.thingycraft=ThingyCraft itemGroup.gemification=Gemification
tile.oreGemOnyx.name=Onyx Ore tile.oreGemOnyx.name=Onyx Ore
tile.oreGemAlmandineGarnet.name=Almandine Garnet Ore tile.oreGemAlmandineGarnet.name=Almandine Garnet Ore