Allow shift rightclick for screwdrivers

This commit is contained in:
Blood-Asp 2016-03-19 22:15:50 +01:00
parent f4b8aa6f3a
commit 20cd83a175
2 changed files with 52 additions and 1 deletions

View file

@ -256,9 +256,17 @@ public class GT_Block_Machines
public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float par1, float par2, float par3) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity == null) || (aPlayer.isSneaking())) {
if (tTileEntity == null) {
return false;
}
if(aPlayer.isSneaking()){
ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
if(tCurrentItem!=null){
if(!GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)){
return false;
}
}else {return false;}
}
if ((tTileEntity instanceof IGregTechTileEntity)) {
if (((IGregTechTileEntity) tTileEntity).getTimer() < 50L) {
return false;

View file

@ -0,0 +1,43 @@
package gregtech.common.tileentities.machines.basic;
import java.util.Iterator;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_CuringOven
extends GT_MetaTileEntity_BasicMachine {
private static int sHeaviestElementMass = 0;
public GT_MetaTileEntity_CuringOven(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", new ITexture[]{new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM"))});
}
public GT_MetaTileEntity_CuringOven(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
}
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_Replicator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
}
public int checkRecipe() {
return 0;
}
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (ItemList.Cell_Empty.isStackEqual(aStack));
}
public boolean isFluidInputAllowed(FluidStack aFluid) {
return false;
}
}