Adding Data Access Hatch

This commit is contained in:
Antifluxfield 2017-06-29 12:31:50 -05:00 committed by GitHub
parent 4061f8f397
commit d6625b0431

View file

@ -0,0 +1,87 @@
package gregtech.api.metatileentity.implementations;
import gregtech.api.enums.Textures;
import gregtech.api.gui.*;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch {
public GT_MetaTileEntity_Hatch_DataAccess(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 16, "Data Access for Multiblocks");
}
public GT_MetaTileEntity_Hatch_DataAccess(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 9 : 16, aDescription, aTextures);
}
public GT_MetaTileEntity_Hatch_DataAccess(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 9 : 16, aDescription, aTextures);
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
}
@Override
public boolean isSimpleMachine() {
return true;
}
@Override
public boolean isFacingValid(byte aFacing) {
return true;
}
@Override
public boolean isAccessAllowed(EntityPlayer aPlayer) {
return true;
}
@Override
public boolean isValidSlot(int aIndex) {
return true;
}
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_Hatch_DataAccess(mName, mTier, mDescriptionArray, mTextures);
}
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
if (aBaseMetaTileEntity.isClientSide()) return true;
aBaseMetaTileEntity.openGUI(aPlayer);
return true;
}
@Override
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity);
}
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Data Access Bus");
}
@Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
}
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
}
}