Add some changes

This commit is contained in:
Alexander committed 2014-04-18 00:49:00 -04:00
1 parent da42896f1d
commit 89ee0077be
13 files changed
+131 -19

No files matched your search

@@ -4,12 +4,14 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import tconstruct.blocks.logic.TileEntityLandmine;
import tconstruct.common.TRepo;
/**
*
@@ -60,6 +62,9 @@ public class ContainerLandmine extends Container
@Override
public boolean canInteractWith (EntityPlayer entityplayer)
{
Block block = te.getWorldObj().getBlock(te.xCoord, te.yCoord, te.zCoord);
if (block != TRepo.landmine)
return false;
return te.isUseableByPlayer(entityplayer);
}
@@ -1,5 +1,6 @@
package tconstruct.inventory;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@@ -12,6 +13,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.world.World;
import tconstruct.blocks.logic.CraftingStationLogic;
import tconstruct.common.TRepo;
import tconstruct.library.armor.ArmorCore;
import tconstruct.library.crafting.ToolBuilder;
import tconstruct.library.tools.ToolCore;
@@ -152,9 +154,13 @@ public class CraftingStationContainer extends Container
}
@Override
public boolean canInteractWith (EntityPlayer par1EntityPlayer)
public boolean canInteractWith (EntityPlayer player)
{
return par1EntityPlayer.getDistanceSq((double) this.posX + 0.5D, (double) this.posY + 0.5D, (double) this.posZ + 0.5D) <= 64.0D;
Block block = worldObj.getBlock(this.posX, this.posY, this.posZ);
if (block != TRepo.craftingStationWood && block != TRepo.craftingSlabWood)
return false;
return player.getDistanceSq((double) this.posX + 0.5D, (double) this.posY + 0.5D, (double) this.posZ + 0.5D) <= 64.0D;
}
@Override
@@ -1,5 +1,6 @@
package tconstruct.inventory;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@@ -7,6 +8,7 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import tconstruct.blocks.logic.FrypanLogic;
import tconstruct.common.TRepo;
public class FrypanContainer extends Container
{
@@ -85,6 +87,10 @@ public class FrypanContainer extends Container
@Override
public boolean canInteractWith (EntityPlayer entityplayer)
{
Block block = logic.getWorldObj().getBlock(logic.xCoord, logic.yCoord, logic.zCoord);
if (block != TRepo.heldItemBlock)
return false;
return logic.isUseableByPlayer(entityplayer);
}
@@ -1,11 +1,13 @@
package tconstruct.inventory;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import tconstruct.blocks.logic.PartBuilderLogic;
import tconstruct.blocks.logic.PatternChestLogic;
import tconstruct.common.TRepo;
import tconstruct.library.util.IPattern;
public class PartCrafterChestContainer extends ActiveContainer
@@ -54,9 +56,12 @@ public class PartCrafterChestContainer extends ActiveContainer
}
@Override
public boolean canInteractWith (EntityPlayer var1)
public boolean canInteractWith (EntityPlayer entityplayer)
{
return true;
Block block = logic.getWorldObj().getBlock(logic.xCoord, logic.yCoord, logic.zCoord);
if (block != TRepo.toolStationWood && block != TRepo.craftingSlabWood)
return false;
return logic.isUseableByPlayer(entityplayer);
}
@Override
@@ -1,10 +1,12 @@
package tconstruct.inventory;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import tconstruct.blocks.logic.PartBuilderLogic;
import tconstruct.common.TRepo;
import tconstruct.library.util.IPattern;
public class PartCrafterContainer extends ActiveContainer
@@ -43,9 +45,12 @@ public class PartCrafterContainer extends ActiveContainer
}
@Override
public boolean canInteractWith (EntityPlayer var1)
public boolean canInteractWith (EntityPlayer entityplayer)
{
return true;
Block block = logic.getWorldObj().getBlock(logic.xCoord, logic.yCoord, logic.zCoord);
if (block != TRepo.toolStationWood && block != TRepo.craftingSlabWood)
return false;
return logic.isUseableByPlayer(entityplayer);
}
@Override
@@ -1,11 +1,13 @@
package tconstruct.inventory;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import tconstruct.blocks.logic.PatternChestLogic;
import tconstruct.common.TRepo;
import tconstruct.library.util.IPattern;
public class PatternChestContainer extends Container
@@ -44,6 +46,9 @@ public class PatternChestContainer extends Container
@Override
public boolean canInteractWith (EntityPlayer entityplayer)
{
Block block = logic.getWorldObj().getBlock(logic.xCoord, logic.yCoord, logic.zCoord);
if (block != TRepo.toolStationWood && block != TRepo.craftingSlabWood)
return false;
return logic.isUseableByPlayer(entityplayer);
}
@@ -1,11 +1,13 @@
package tconstruct.inventory;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import tconstruct.blocks.logic.StencilTableLogic;
import tconstruct.common.TRepo;
public class PatternShaperContainer extends Container
{
@@ -41,7 +43,7 @@ public class PatternShaperContainer extends Container
/*public void onCraftMatrixChanged(IInventory iinventory)
{
craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj));
craftResult.setInventorySloTRepos(0, CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj));
}*/
/*@Override
@@ -62,7 +64,10 @@ public class PatternShaperContainer extends Container
@Override
public boolean canInteractWith (EntityPlayer entityplayer)
{
return true;
Block block = logic.getWorldObj().getBlock(logic.xCoord, logic.yCoord, logic.zCoord);
if (block != TRepo.toolStationWood && block != TRepo.craftingSlabWood)
return false;
return logic.isUseableByPlayer(entityplayer);
}
@Override
@@ -1,10 +1,12 @@
package tconstruct.inventory;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import tconstruct.blocks.logic.SmelteryLogic;
import tconstruct.common.TRepo;
public class SmelteryContainer extends ActiveContainer
{
@@ -114,6 +116,9 @@ public class SmelteryContainer extends ActiveContainer
@Override
public boolean canInteractWith (EntityPlayer entityplayer)
{
Block block = logic.getWorldObj().getBlock(logic.xCoord, logic.yCoord, logic.zCoord);
if (block != TRepo.smeltery && block != TRepo.smelteryNether)
return false;
return logic.isUseableByPlayer(entityplayer);
}
@@ -1,11 +1,14 @@
package tconstruct.inventory;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.blocks.logic.ToolForgeLogic;
import tconstruct.blocks.logic.ToolStationLogic;
import tconstruct.common.TRepo;
import tconstruct.library.tools.ToolCore;
public class ToolForgeContainer extends ToolStationContainer
@@ -87,4 +90,13 @@ public class ToolForgeContainer extends ToolStationContainer
logic.getWorldObj().playAuxSFX(1021, (int) logic.xCoord, (int) logic.yCoord, (int) logic.zCoord, 0);
}
}
@Override
public boolean canInteractWith (EntityPlayer entityplayer)
{
Block block = logic.getWorldObj().getBlock(logic.xCoord, logic.yCoord, logic.zCoord);
if (block != TRepo.toolForge && block != TRepo.craftingSlabWood)
return false;
return logic.isUseableByPlayer(entityplayer);
}
}
@@ -2,12 +2,14 @@ package tconstruct.inventory;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.blocks.logic.ToolStationLogic;
import tconstruct.common.TRepo;
import tconstruct.library.tools.ToolCore;
public class ToolStationContainer extends ActiveContainer
@@ -80,9 +82,12 @@ public class ToolStationContainer extends ActiveContainer
}
@Override
public boolean canInteractWith (EntityPlayer var1)
public boolean canInteractWith (EntityPlayer entityplayer)
{
return true;
Block block = logic.getWorldObj().getBlock(logic.xCoord, logic.yCoord, logic.zCoord);
if (block != TRepo.toolStationWood && block != TRepo.craftingSlabWood)
return false;
return logic.isUseableByPlayer(entityplayer);
}
@Override