-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
690 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
src/main/java/reobf/proghatches/gt/metatileentity/CommunicationPortHatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package reobf.proghatches.gt.metatileentity; | ||
|
||
import gregtech.api.GregTech_API; | ||
import gregtech.api.enums.Textures; | ||
import gregtech.api.interfaces.IIconContainer; | ||
import gregtech.api.interfaces.ITexture; | ||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity; | ||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity; | ||
import gregtech.api.metatileentity.BaseMetaTileEntity; | ||
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; | ||
import gregtech.api.render.TextureFactory; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraftforge.common.util.ForgeDirection; | ||
import reobf.proghatches.main.registration.Registration; | ||
|
||
public class CommunicationPortHatch extends GT_MetaTileEntity_Hatch{ | ||
public CommunicationPortHatch(int aID, String aName, String aNameRegional, int aTier | ||
) { | ||
super(aID, aName, aNameRegional, aTier, 0, new String[0] ); | ||
Registration.items.add(new ItemStack(GregTech_API.sBlockMachines, 1, aID)); | ||
} | ||
public CommunicationPortHatch(String aName, int aTier, String[] aDescription, | ||
ITexture[][][] aTextures) { | ||
super(aName, aTier, 0, aDescription, aTextures); | ||
|
||
} | ||
@Override | ||
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { | ||
|
||
return new CommunicationPortHatch(mName, mTier, mDescriptionArray, mTextures); | ||
} | ||
private static final IIconContainer textureFont = new Textures.BlockIcons.CustomIcon("icons/NeutronSensorFont"); | ||
private static final IIconContainer textureFont_Glow = new Textures.BlockIcons.CustomIcon( | ||
"icons/NeutronSensorFont_GLOW"); | ||
|
||
@Override | ||
public ITexture[] getTexturesActive(ITexture aBaseTexture) { | ||
return new ITexture[] { aBaseTexture, TextureFactory.of(textureFont), TextureFactory.builder() | ||
.addIcon(textureFont_Glow) | ||
.glow() | ||
.build() }; | ||
} | ||
|
||
@Override | ||
public ITexture[] getTexturesInactive(ITexture aBaseTexture) { | ||
return new ITexture[] { aBaseTexture, TextureFactory.of(textureFont) }; | ||
} | ||
|
||
@Override | ||
public boolean isValidSlot(int aIndex) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isSimpleMachine() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean isFacingValid(ForgeDirection facing) { | ||
return true; | ||
} | ||
@Override | ||
public boolean allowGeneralRedstoneOutput() { | ||
return true; | ||
} | ||
@Override | ||
public boolean isAccessAllowed(EntityPlayer aPlayer) { | ||
return true; | ||
} | ||
public void setRS(boolean porton) { | ||
|
||
for(ForgeDirection s:ForgeDirection.values()) | ||
this.getBaseMetaTileEntity().setInternalOutputRedstoneSignal(s, (byte) (porton?15:0)); | ||
|
||
((BaseMetaTileEntity) this.getBaseMetaTileEntity()). updateNeighbours(0xff,0xff);//set all bits to 1 to update all 6 sides | ||
|
||
} | ||
@Override | ||
public void initDefaultModes(NBTTagCompound aNBT) { | ||
for(ForgeDirection s:ForgeDirection.values()) | ||
this.getBaseMetaTileEntity().setInternalOutputRedstoneSignal(s, (byte) 0); | ||
} | ||
|
||
} |
Oops, something went wrong.