-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add NC hatches for PCB Factory and QFT (#3737)
Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
- Loading branch information
1 parent
b1e6718
commit fb18c4e
Showing
20 changed files
with
944 additions
and
48 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
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
72 changes: 72 additions & 0 deletions
72
src/main/java/gregtech/api/metatileentity/implementations/MTEHatchBulkCatalystHousing.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,72 @@ | ||
package gregtech.api.metatileentity.implementations; | ||
|
||
import net.minecraft.item.ItemStack; | ||
|
||
import gregtech.api.interfaces.ITexture; | ||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity; | ||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity; | ||
import gregtech.api.render.TextureFactory; | ||
import gtPlusPlus.core.util.minecraft.ItemUtils; | ||
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; | ||
|
||
public class MTEHatchBulkCatalystHousing extends MTEHatchNonConsumableBase { | ||
|
||
private int catalystCapacity = 0; | ||
|
||
public MTEHatchBulkCatalystHousing(int ID, String name, String nameRegional, int tier, int itemCapacity) { | ||
super(ID, name, nameRegional, tier, "Dedicated Catalyst Storage"); | ||
catalystCapacity = itemCapacity; | ||
} | ||
|
||
public MTEHatchBulkCatalystHousing(String name, String[] description, ITexture[][][] textures, int tier, | ||
int itemCapacity) { | ||
super(name, tier, description, textures); | ||
catalystCapacity = itemCapacity; | ||
} | ||
|
||
@Override | ||
protected int getItemCapacity() { | ||
return catalystCapacity; | ||
} | ||
|
||
public int getStoredCatalystMeta() { | ||
if (getItemStack() == null) return -1; | ||
return getItemStack().getItemDamage(); | ||
} | ||
|
||
@Override | ||
protected boolean isValidItem(ItemStack item) { | ||
return ItemUtils.isCatalyst(item); | ||
} | ||
|
||
@Override | ||
public ITexture[] getTexturesActive(ITexture aBaseTexture) { | ||
return new ITexture[] { aBaseTexture, TextureFactory.builder() | ||
.addIcon(TexturesGtBlock.Overlay_Bus_Catalyst) | ||
.extFacing() | ||
.build(), | ||
TextureFactory.builder() | ||
.addIcon(TexturesGtBlock.Overlay_Bus_Catalyst) | ||
.extFacing() | ||
.glow() | ||
.build() }; | ||
} | ||
|
||
@Override | ||
public ITexture[] getTexturesInactive(ITexture aBaseTexture) { | ||
return new ITexture[] { aBaseTexture, TextureFactory.builder() | ||
.addIcon(TexturesGtBlock.Overlay_Bus_Catalyst) | ||
.extFacing() | ||
.build(), | ||
TextureFactory.builder() | ||
.addIcon(TexturesGtBlock.Overlay_Bus_Catalyst) | ||
.extFacing() | ||
.glow() | ||
.build() }; | ||
} | ||
|
||
@Override | ||
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { | ||
return new MTEHatchBulkCatalystHousing(mName, mDescriptionArray, mTextures, mTier, catalystCapacity); | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
src/main/java/gregtech/api/metatileentity/implementations/MTEHatchNanite.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,81 @@ | ||
package gregtech.api.metatileentity.implementations; | ||
|
||
import net.minecraft.item.ItemStack; | ||
|
||
import gregtech.api.enums.Materials; | ||
import gregtech.api.enums.OrePrefixes; | ||
import gregtech.api.enums.Textures; | ||
import gregtech.api.interfaces.ITexture; | ||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity; | ||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity; | ||
import gregtech.api.objects.ItemData; | ||
import gregtech.api.render.TextureFactory; | ||
import gregtech.api.util.GTOreDictUnificator; | ||
|
||
public class MTEHatchNanite extends MTEHatchNonConsumableBase { | ||
|
||
private int naniteCapacity = 0; | ||
|
||
public MTEHatchNanite(int ID, String name, String nameRegional, int tier, int itemCapacity) { | ||
super(ID, name, nameRegional, tier, "Holds nanites for use in multiblocks"); | ||
naniteCapacity = itemCapacity; | ||
} | ||
|
||
public MTEHatchNanite(String name, String[] description, ITexture[][][] textures, int tier, int itemCapacity) { | ||
super(name, tier, description, textures); | ||
naniteCapacity = itemCapacity; | ||
} | ||
|
||
@Override | ||
protected int getItemCapacity() { | ||
return naniteCapacity; | ||
} | ||
|
||
public Materials getStoredNaniteMaterial() { | ||
if (getItemStack() == null) return null; | ||
ItemData data = GTOreDictUnificator.getAssociation(getItemStack()); | ||
if (data == null) return null; | ||
return data.mMaterial.mMaterial; | ||
} | ||
|
||
@Override | ||
protected boolean isValidItem(ItemStack item) { | ||
ItemData data = GTOreDictUnificator.getAssociation(item); | ||
if (data == null) { | ||
return false; | ||
} | ||
OrePrefixes prefix = data.mPrefix; | ||
return prefix == OrePrefixes.nanite; | ||
} | ||
|
||
@Override | ||
public ITexture[] getTexturesActive(ITexture aBaseTexture) { | ||
return new ITexture[] { aBaseTexture, TextureFactory.builder() | ||
.addIcon(Textures.BlockIcons.OVERLAY_NANITE_HATCH) | ||
.extFacing() | ||
.build(), | ||
TextureFactory.builder() | ||
.addIcon(Textures.BlockIcons.OVERLAY_NANITE_HATCH_GLOW) | ||
.extFacing() | ||
.glow() | ||
.build() }; | ||
} | ||
|
||
@Override | ||
public ITexture[] getTexturesInactive(ITexture aBaseTexture) { | ||
return new ITexture[] { aBaseTexture, TextureFactory.builder() | ||
.addIcon(Textures.BlockIcons.OVERLAY_NANITE_HATCH) | ||
.extFacing() | ||
.build(), | ||
TextureFactory.builder() | ||
.addIcon(Textures.BlockIcons.OVERLAY_NANITE_HATCH_GLOW) | ||
.extFacing() | ||
.glow() | ||
.build() }; | ||
} | ||
|
||
@Override | ||
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { | ||
return new MTEHatchNanite(mName, mDescriptionArray, mTextures, mTier, naniteCapacity); | ||
} | ||
} |
Oops, something went wrong.