diff --git a/src/main/java/appeng/api/definitions/IParts.java b/src/main/java/appeng/api/definitions/IParts.java index a654ef3d4be..92e28b2862c 100644 --- a/src/main/java/appeng/api/definitions/IParts.java +++ b/src/main/java/appeng/api/definitions/IParts.java @@ -44,6 +44,8 @@ public interface IParts { IItemDefinition quartzFiber(); + IItemDefinition partCreativeEnergy(); + IItemDefinition toggleBus(); IItemDefinition invertedToggleBus(); diff --git a/src/main/java/appeng/api/definitions/Parts.java b/src/main/java/appeng/api/definitions/Parts.java index 34dcc59da59..c5381356839 100644 --- a/src/main/java/appeng/api/definitions/Parts.java +++ b/src/main/java/appeng/api/definitions/Parts.java @@ -46,6 +46,8 @@ public class Parts { public AEItemDefinition partQuartzFiber; + public AEItemDefinition partCreativeEnergy; + public AEItemDefinition partToggleBus; public AEItemDefinition partInvertedToggleBus; diff --git a/src/main/java/appeng/core/Registration.java b/src/main/java/appeng/core/Registration.java index f757623ac54..e17bd2f3d09 100644 --- a/src/main/java/appeng/core/Registration.java +++ b/src/main/java/appeng/core/Registration.java @@ -336,6 +336,7 @@ private void assignParts(final Parts target, final IParts source) { // target.partLumenCableGlass = source.lumenCableGlass(); // target.partLumenCableDense = source.lumenCableDense(); target.partQuartzFiber = this.converter.of(source.quartzFiber()); + target.partCreativeEnergy = this.converter.of(source.partCreativeEnergy()); target.partToggleBus = this.converter.of(source.toggleBus()); target.partInvertedToggleBus = this.converter.of(source.invertedToggleBus()); target.partStorageBus = this.converter.of(source.storageBus()); diff --git a/src/main/java/appeng/core/api/definitions/ApiParts.java b/src/main/java/appeng/core/api/definitions/ApiParts.java index a8ade8f36a4..d2acfab5d47 100644 --- a/src/main/java/appeng/core/api/definitions/ApiParts.java +++ b/src/main/java/appeng/core/api/definitions/ApiParts.java @@ -36,6 +36,7 @@ public final class ApiParts implements IParts { // private final AEColoredItemDefinition lumenCableGlass; // private final AEColoredItemDefinition lumenCableDense; private final IItemDefinition quartzFiber; + private final IItemDefinition partCreativeEnergy; private final IItemDefinition toggleBus; private final IItemDefinition invertedToggleBus; private final IItemDefinition storageBus; @@ -88,6 +89,7 @@ public ApiParts(final DefinitionConstructor constructor, final IPartHelper partH // this.lumenCableGlass = Optional.absent(); // has yet to be implemented, no PartType defined for it yet // this.lumenCableDense = Optional.absent(); // has yet to be implemented, no PartType defined for it yet this.quartzFiber = new DamagedItemDefinition(itemMultiPart.createPart(PartType.QuartzFiber)); + this.partCreativeEnergy = new DamagedItemDefinition(itemMultiPart.createPart(PartType.PartCreativeEnergy)); this.toggleBus = new DamagedItemDefinition(itemMultiPart.createPart(PartType.ToggleBus)); this.invertedToggleBus = new DamagedItemDefinition(itemMultiPart.createPart(PartType.InvertedToggleBus)); this.storageBus = new DamagedItemDefinition(itemMultiPart.createPart(PartType.StorageBus)); @@ -189,6 +191,11 @@ public IItemDefinition quartzFiber() { return this.quartzFiber; } + @Override + public IItemDefinition partCreativeEnergy() { + return this.partCreativeEnergy; + } + @Override public IItemDefinition toggleBus() { return this.toggleBus; diff --git a/src/main/java/appeng/items/parts/PartType.java b/src/main/java/appeng/items/parts/PartType.java index 0dc16143549..acafe21b24f 100644 --- a/src/main/java/appeng/items/parts/PartType.java +++ b/src/main/java/appeng/items/parts/PartType.java @@ -33,6 +33,7 @@ import appeng.parts.networking.PartCableCovered; import appeng.parts.networking.PartCableGlass; import appeng.parts.networking.PartCableSmart; +import appeng.parts.networking.PartCreativeEnergy; import appeng.parts.networking.PartDenseCable; import appeng.parts.networking.PartDenseCableCovered; import appeng.parts.networking.PartQuartzFiber; @@ -212,7 +213,10 @@ public boolean isCable() { PartInterfaceTerminal.class), PatternTerminalEx(500, EnumSet.of(AEFeature.Patterns), EnumSet.noneOf(IntegrationType.class), - PartPatternTerminalEx.class); + PartPatternTerminalEx.class), + + PartCreativeEnergy(690, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), + PartCreativeEnergy.class); public final int baseDamage; private final Set features; diff --git a/src/main/java/appeng/parts/networking/PartCreativeEnergy.java b/src/main/java/appeng/parts/networking/PartCreativeEnergy.java new file mode 100644 index 00000000000..690863f5b8d --- /dev/null +++ b/src/main/java/appeng/parts/networking/PartCreativeEnergy.java @@ -0,0 +1,107 @@ +package appeng.parts.networking; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.item.ItemStack; + +import org.lwjgl.opengl.GL11; + +import appeng.api.config.AccessRestriction; +import appeng.api.config.Actionable; +import appeng.api.config.PowerMultiplier; +import appeng.api.networking.energy.IAEPowerStorage; +import appeng.api.parts.IPartCollisionHelper; +import appeng.api.parts.IPartRenderHelper; +import appeng.client.texture.CableBusTextures; +import appeng.parts.AEBasePart; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class PartCreativeEnergy extends AEBasePart implements IAEPowerStorage { + + public PartCreativeEnergy(final ItemStack is) { + super(is); + this.getProxy().setIdlePowerUsage(0); + } + + @Override + public void getBoxes(final IPartCollisionHelper bch) { + bch.addBox(6, 6, 11, 10, 10, 12); + bch.addBox(4, 4, 12, 12, 12, 13); + } + + @Override + @SideOnly(Side.CLIENT) + public void renderInventory(final IPartRenderHelper rh, final RenderBlocks renderer) { + GL11.glTranslated(-0.2, -0.3, 0.0); + + rh.setTexture( + CableBusTextures.PartTunnelSides.getIcon(), + CableBusTextures.PartTunnelSides.getIcon(), + CableBusTextures.BlockP2PTunnel2.getIcon(), + this.getItemStack().getIconIndex(), + CableBusTextures.PartTunnelSides.getIcon(), + CableBusTextures.PartTunnelSides.getIcon()); + rh.setBounds(4.0f, 4.0f, 8.0f, 12.0f, 12.0f, 9.0f); + rh.renderInventoryBox(renderer); + } + + @Override + @SideOnly(Side.CLIENT) + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { + rh.setTexture( + CableBusTextures.PartTunnelSides.getIcon(), + CableBusTextures.PartTunnelSides.getIcon(), + CableBusTextures.BlockP2PTunnel2.getIcon(), + this.getItemStack().getIconIndex(), + CableBusTextures.PartTunnelSides.getIcon(), + CableBusTextures.PartTunnelSides.getIcon()); + rh.setBounds(4, 4, 12, 12, 12, 13); + rh.renderBlock(x, y, z, renderer); + + rh.setTexture(CableBusTextures.BlockP2PTunnel2.getIcon()); + + rh.setBounds(6, 6, 11, 10, 10, 12); + rh.renderBlock(x, y, z, renderer); + } + + @Override + public int cableConnectionRenderTo() { + return 16; + } + + @Override + public double injectAEPower(final double amt, final Actionable mode) { + return 0; + } + + @Override + public double getAEMaxPower() { + return Long.MAX_VALUE / 10000; + } + + @Override + public double getAECurrentPower() { + return Long.MAX_VALUE / 10000; + } + + @Override + public boolean isAEPublicPowerStorage() { + return true; + } + + @Override + public AccessRestriction getPowerFlow() { + return AccessRestriction.READ_WRITE; + } + + @Override + public boolean isInfinite() { + return true; + } + + @Override + public double extractAEPower(final double amt, final Actionable mode, final PowerMultiplier pm) { + return amt; + } +} diff --git a/src/main/resources/assets/appliedenergistics2/lang/en_US.lang b/src/main/resources/assets/appliedenergistics2/lang/en_US.lang index 370527f7d57..ee615767977 100644 --- a/src/main/resources/assets/appliedenergistics2/lang/en_US.lang +++ b/src/main/resources/assets/appliedenergistics2/lang/en_US.lang @@ -713,6 +713,7 @@ item.appliedenergistics2.ItemPart.P2PTunnel.name=P2P Tunnel item.appliedenergistics2.ItemPart.PatternTerminal.name=ME Pattern Terminal item.appliedenergistics2.ItemPart.PatternTerminalEx.name=ME Processing Pattern Terminal item.appliedenergistics2.ItemPart.QuartzFiber.name=Quartz Fiber +item.appliedenergistics2.ItemPart.PartCreativeEnergy.name=Creative Energy Anchor item.appliedenergistics2.ItemPart.StorageBus.name=ME Storage Bus item.appliedenergistics2.ItemPart.Terminal.name=ME Terminal item.appliedenergistics2.ItemPart.CraftingTerminal.name=ME Crafting Terminal diff --git a/src/main/resources/assets/appliedenergistics2/recipes/network/parts/index.recipe b/src/main/resources/assets/appliedenergistics2/recipes/network/parts/index.recipe index 1f8093c3cdc..d14d481fcf8 100644 --- a/src/main/resources/assets/appliedenergistics2/recipes/network/parts/index.recipe +++ b/src/main/resources/assets/appliedenergistics2/recipes/network/parts/index.recipe @@ -8,3 +8,4 @@ import=network/parts/quartz-fiber.recipe import=network/parts/terminals.recipe import=network/parts/toggle-buses.recipe import=network/parts/tunnels.recipe +import=network/parts/part-creative-energy-cell.recipe \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/recipes/network/parts/part-creative-energy-cell.recipe b/src/main/resources/assets/appliedenergistics2/recipes/network/parts/part-creative-energy-cell.recipe new file mode 100644 index 00000000000..aae851888d5 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/recipes/network/parts/part-creative-energy-cell.recipe @@ -0,0 +1,3 @@ +shapeless= + ae2:ItemPart.CableAnchor ae2:BlockCreativeEnergyCell + -> 1 ae2:ItemPart.PartCreativeEnergy \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/ItemPart.PartCreativeEnergy.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/ItemPart.PartCreativeEnergy.png new file mode 100644 index 00000000000..6c891e5a88a Binary files /dev/null and b/src/main/resources/assets/appliedenergistics2/textures/blocks/ItemPart.PartCreativeEnergy.png differ