From b5521b6b73f7507f8efee53f35f21f51823caa85 Mon Sep 17 00:00:00 2001 From: reobf <2215595288@qq.com> Date: Sun, 11 Feb 2024 18:32:43 +0800 Subject: [PATCH] update --- .../reobf/proghatches/block/TileIOHub.java | 104 +++++++++++++----- .../BufferedDualInputHatch.java | 30 ++++- .../gt/metatileentity/DualInputHatch.java | 2 +- .../metatileentity/PatternDualInputHatch.java | 2 +- .../ProgrammingCircuitProvider.java | 8 ++ .../reobf/proghatches/main/ClientProxy.java | 13 ++- .../main/mixin/StoreInjectionPoint.java | 42 +++++++ .../mixins/MixinFixTossWhenClickSlot.java | 10 ++ .../MixinHandleProgrammingOnRecipeStart.java | 14 ++- ...atternEncodingCiruitSpecialTreatment2.java | 2 +- .../reobf/proghatches/util/IIconTexture.java | 104 ++++++++++++++++++ 11 files changed, 291 insertions(+), 40 deletions(-) create mode 100644 src/main/java/reobf/proghatches/main/mixin/StoreInjectionPoint.java create mode 100644 src/main/java/reobf/proghatches/util/IIconTexture.java diff --git a/src/main/java/reobf/proghatches/block/TileIOHub.java b/src/main/java/reobf/proghatches/block/TileIOHub.java index a455adc..02b0583 100644 --- a/src/main/java/reobf/proghatches/block/TileIOHub.java +++ b/src/main/java/reobf/proghatches/block/TileIOHub.java @@ -14,11 +14,13 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; import scala.None$; import li.cil.oc.util.ExtendedWorld$; import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; import scala.Option; import scala.Some; import scala.Tuple2; @@ -259,10 +261,19 @@ public void onConnect(Node node) { public void onDisconnect(Node node) { - } + } + public void markDirty() + { + final Chunk chunk = worldObj.getChunkFromBlockCoords(xCoord, zCoord); + if (chunk != null) { + chunk.setChunkModified(); + } + //this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this); + + } boolean init; public void updateEntity() { - this.markDirty(); + dead=false; super.updateEntity(); @@ -510,37 +521,73 @@ public Object[] getCustomName(final Context context, final Arguments args) { return new Object[]{TileIOHub.this.getInventoryName()}; } @Callback(doc = "function(address:string):boolean -- Swap the inventory between this IO Hub and another IO Hub. Return whether operation successes.") - public Object[] swap(final Context context, final Arguments args) { - + public Object[] swap(final Context context, final Arguments args) {markDirty(); + final String address = args.checkString(0); + final int entry = args.checkInteger(1); + final int amount = args.optInteger(2, 1000); + + final Node n =node().network().node(address); + if (n == null) { + return new Object[] {false,"no such component"}; + // throw new IllegalArgumentException("no such component"); + } + if (!(n instanceof Component)) { + return new Object[] {false,"no such component"}; + //throw new IllegalArgumentException("no such component"); + } + final li.cil.oc.api.network.Environment env = n.host(); + if (!(env instanceof TileIOHub.OCApi)) { + return new Object[] {false,"not a iohub"}; + //throw new IllegalArgumentException("not a iohub"); + } + final TileIOHub.OCApi database = ( TileIOHub.OCApi)env; + database.markDirty(); + //do not directly swap ref just in case... + ItemStack[] ia = Arrays.stream(inv).map(ItemStack::copy).toArray( ItemStack[]::new); + NBTTagCompound[] fa = Arrays.stream(ft).map(s->s.writeToNBT(new NBTTagCompound())).toArray(NBTTagCompound[]::new); + ItemStack[] ib = Arrays.stream(database.TileIOHubthis().inv).map(ItemStack::copy).toArray(ItemStack[]::new); + NBTTagCompound[] fb = Arrays.stream(database.TileIOHubthis().ft).map(s->s.writeToNBT(new NBTTagCompound())).toArray(NBTTagCompound[]::new); + + for(int i=0;i=inv.length+1){throw new RuntimeException("invalid slot");} slotselected=arg0; @@ -860,6 +907,7 @@ public int selectedTank() { @Override public void selectedTank_$eq(int arg0) { + markDirty(); if(arg0<0+1||arg0>=ft.length+1){throw new RuntimeException("invalid slot");} tankselected=arg0; @@ -924,7 +972,7 @@ public Object[] compareFluidTo(final Context context, final Arguments args) { } @APIType({"fluid"}) @Callback(doc = "function(index:number[, count:number=1000]):boolean -- Move the specified amount of fluid from the selected tank into the specified tank.") - public Object[] transferFluidTo(final Context context, final Arguments args) { + public Object[] transferFluidTo(final Context context, final Arguments args) {markDirty(); return TankControl$class.transferFluidTo(this, context, args); } @APIType({"item"}) @@ -953,7 +1001,7 @@ public Object[] compareTo(final Context context, final Arguments args) { } @APIType({"item"}) @Callback(doc = "function(toSlot:number[, amount:number]):boolean -- Move up to the specified amount of items from the selected slot into the specified slot.") - public Object[] transferTo(final Context context, final Arguments args) { + public Object[] transferTo(final Context context, final Arguments args) {markDirty(); return InventoryControl$class.transferTo(this, context, args); } @@ -969,24 +1017,24 @@ public Object[] getItemInventorySize(final Context context, final Arguments args } @APIType({"item"}) @Callback(doc = "function(inventorySlot:number, slot:number[, count:number=64]):number -- Drops an item into the specified slot in the item inventory.") - public Object[] dropIntoItemInventory(final Context context, final Arguments args) { + public Object[] dropIntoItemInventory(final Context context, final Arguments args) {markDirty(); return ItemInventoryControl$class.dropIntoItemInventory(this, context, args); } @APIType({"item"}) @Callback(doc = "function(inventorySlot:number, slot:number[, count:number=64]):number -- Sucks an item out of the specified slot in the item inventory.") - public Object[] suckFromItemInventory(final Context context, final Arguments args) { + public Object[] suckFromItemInventory(final Context context, final Arguments args) {markDirty(); return ItemInventoryControl$class.suckFromItemInventory(this, context, args); } @APIType({"item"}) @Callback(doc = "function(facing:number, slot:number[, count:number[, fromSide:number]]):boolean -- Drops the selected item stack into the specified slot of an inventory.") - public Object[] dropIntoSlot(final Context context, final Arguments args) { + public Object[] dropIntoSlot(final Context context, final Arguments args) {markDirty(); return InventoryWorldControlMk2$class.dropIntoSlot(this, context, args); } @APIType({"item"}) @Callback(doc = "function(facing:number, slot:number[, count:number[, fromSide:number]]):boolean -- Sucks items from the specified slot of an inventory.") - public Object[] suckFromSlot(final Context context, final Arguments args) { + public Object[] suckFromSlot(final Context context, final Arguments args) {markDirty(); return InventoryWorldControlMk2$class.suckFromSlot(this, context, args); } @@ -1021,7 +1069,7 @@ public Object[] allItems(final Context context, final Arguments args) { } @APIType({"item","ae"}) @Callback(doc = "function(filter:table, dbAddress:string[, startSlot:number[, count:number]]): Boolean -- Store items in the network matching the specified filter in the database with the specified address.") - public Object[] storeAE(final Context context, final Arguments args) { + public Object[] storeAE(final Context context, final Arguments args) {markDirty(); return NetworkControl$class.store(this, context, args); } @APIType({"fluid","ae"}) @@ -1085,7 +1133,7 @@ public IMEMonitor getItemInventory() { } @APIType({"item","ae"}) @Callback(doc = "function([number:amount]):number -- Transfer selected items to your ae system.") - public Object[] sendItems(final Context context, final Arguments args) { + public Object[] sendItems(final Context context, final Arguments args) {markDirty(); final IInventory invRobot = TileIOHub.this; if (invRobot.getSizeInventory() <= 0) { @@ -1125,7 +1173,7 @@ public Object[] sendItems(final Context context, final Arguments args) { } @APIType({"item","ae"}) @Callback(doc = "function(database:address, entry:number[, number:amount]):number -- Get items from your ae system.") - public Object[] requestItems(final Context context, final Arguments args) { + public Object[] requestItems(final Context context, final Arguments args) {markDirty(); final String address = args.checkString(0); final int entry = args.checkInteger(1); final int amount = args.optInteger(2, 64); @@ -1199,7 +1247,7 @@ public IMEMonitor getFluidInventory() { return (IMEMonitor)storage.getFluidInventory(); }@APIType({"fluid","ae"}) @Callback(doc = "function([number:amount]):number -- Transfer selected fluid to your ae system.") - public Object[] sendFluids(final Context context, final Arguments args) { + public Object[] sendFluids(final Context context, final Arguments args) {markDirty(); final int selected =selectedTank(); final MultiTank tanks = tank(); if (tanks.tankCount() <= 0) { @@ -1231,7 +1279,7 @@ public Object[] sendFluids(final Context context, final Arguments args) { @APIType({"fluid","ae"}) @Callback(doc = "function(database:address, entry:number[, number:amount]):number -- Get fluid from your ae system.") - public Object[] requestFluids(final Context context, final Arguments args) { + public Object[] requestFluids(final Context context, final Arguments args) {markDirty(); final String address = args.checkString(0); final int entry = args.checkInteger(1); final int amount = args.optInteger(2, 1000); diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/BufferedDualInputHatch.java b/src/main/java/reobf/proghatches/gt/metatileentity/BufferedDualInputHatch.java index 41a09fd..f229530 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/BufferedDualInputHatch.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/BufferedDualInputHatch.java @@ -3,6 +3,7 @@ import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import static reobf.proghatches.main.Config.defaultObj; +import java.io.IOException; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.reflect.Method; @@ -26,6 +27,7 @@ import net.minecraft.nbt.JsonToNBT; import net.minecraft.nbt.NBTException; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; @@ -56,6 +58,7 @@ import com.gtnewhorizons.modularui.common.widget.Scrollable; import com.gtnewhorizons.modularui.common.widget.SlotGroup; import com.gtnewhorizons.modularui.common.widget.SlotWidget; +import com.gtnewhorizons.modularui.common.widget.SyncedWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.relauncher.Side; @@ -631,9 +634,11 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.getWorld().isRemote) return; - - if(dirty){updateSlots();markDirty();} - dirty=dirty||(!highEfficiencyMode()); + + if(dirty){updateSlots();} + dirty=dirty||getBaseMetaTileEntity().hasInventoryBeenModified(); + //System.out.println(dirty); + //dirty=dirty||(!highEfficiencyMode()); boolean on=(this.getBaseMetaTileEntity().isAllowedToWork()); for (DualInvBuffer inv0 : this.sortByEmpty()) { if(on&&dirty){ @@ -678,6 +683,7 @@ public ArrayList sortByEmpty() { } public void classify() { + if(isRemote())return; for (DualInvBuffer inv0 : this.sortByEmpty()) { if (inv0.full() == false) inv0.classify(this.mStoredFluid, mInventory); } @@ -987,6 +993,11 @@ public List getExtraTooltip() { () -> inv0.toTag() .toString(), s -> inv0.fromTag(cv(s)))); + + + + + return builder.build(); } @@ -1041,7 +1052,12 @@ public void addUIWidgets(Builder builder, UIBuildContext buildContext) { } builder.widget(createPowerSwitchButton(builder)); - + builder.widget(new SyncedWidget(){ + //player operation is more complicated, always set to true when GUI open + public void detectAndSendChanges(boolean init) {BufferedDualInputHatch.this.dirty=true;}; + @Override public void readOnClient(int id, PacketBuffer buf) throws IOException {} + @Override public void readOnServer(int id, PacketBuffer buf) throws IOException {}}); + super.addUIWidgets(builder, buildContext); // builder.widget(widget); @@ -1290,7 +1306,11 @@ public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDat } - + private Boolean isRemote; + public boolean isRemote(){ + if(isRemote==null)isRemote=this.getBaseMetaTileEntity().getWorld().isRemote; + return isRemote; + } @Override public void updateSlots() { inv0.forEach(DualInvBuffer::updateSlots); diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/DualInputHatch.java b/src/main/java/reobf/proghatches/gt/metatileentity/DualInputHatch.java index bc8328b..4f4704d 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/DualInputHatch.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/DualInputHatch.java @@ -535,7 +535,7 @@ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { super.onFirstTick(aBaseMetaTileEntity); } - boolean program; + boolean program=true;//default: ON @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/PatternDualInputHatch.java b/src/main/java/reobf/proghatches/gt/metatileentity/PatternDualInputHatch.java index 8eddb90..da84386 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/PatternDualInputHatch.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/PatternDualInputHatch.java @@ -339,7 +339,7 @@ public boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCraf } } - + dirty=true; classify(); justHadNewItems = true; diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/ProgrammingCircuitProvider.java b/src/main/java/reobf/proghatches/gt/metatileentity/ProgrammingCircuitProvider.java index 1ff5859..3a65bd6 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/ProgrammingCircuitProvider.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/ProgrammingCircuitProvider.java @@ -458,7 +458,15 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new ProgrammingCircuitProvider(mName, mTier, 1, mDescriptionArray, mTextures); } +@Override +public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection aFacing, + int colorIndex, boolean aActive, boolean redstoneLevel) { + return super.getTexture(aBaseMetaTileEntity, side, aFacing, colorIndex, aActive, redstoneLevel); + + + +} @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch diff --git a/src/main/java/reobf/proghatches/main/ClientProxy.java b/src/main/java/reobf/proghatches/main/ClientProxy.java index d7c4cc1..c18712e 100644 --- a/src/main/java/reobf/proghatches/main/ClientProxy.java +++ b/src/main/java/reobf/proghatches/main/ClientProxy.java @@ -1,8 +1,10 @@ package reobf.proghatches.main; import net.minecraftforge.client.MinecraftForgeClient; - +import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import reobf.proghatches.client.CircuitSpecialRenderer; public class ClientProxy extends CommonProxy { @@ -14,5 +16,14 @@ public void preInit(FMLPreInitializationEvent event) { super.preInit(event); MinecraftForgeClient.registerItemRenderer(MyMod.progcircuit, new CircuitSpecialRenderer()); + MinecraftForge.EVENT_BUS.register(this); + // TextureStitchEvent.Pre + + } + @SubscribeEvent + public void handle(TextureStitchEvent.Pre e){ + + System.out.println("xxxxxxxxxxxxxxxxxxxxxxxxxxxx"); + } } diff --git a/src/main/java/reobf/proghatches/main/mixin/StoreInjectionPoint.java b/src/main/java/reobf/proghatches/main/mixin/StoreInjectionPoint.java new file mode 100644 index 0000000..38055c9 --- /dev/null +++ b/src/main/java/reobf/proghatches/main/mixin/StoreInjectionPoint.java @@ -0,0 +1,42 @@ +package reobf.proghatches.main.mixin; + +import java.util.Collection; + +import org.spongepowered.asm.lib.Opcodes; +import org.spongepowered.asm.lib.tree.AbstractInsnNode; +import org.spongepowered.asm.lib.tree.InsnList; +import org.spongepowered.asm.lib.tree.VarInsnNode; +import org.spongepowered.asm.mixin.injection.InjectionPoint; +import org.spongepowered.asm.mixin.injection.modify.BeforeLoadLocal; +import org.spongepowered.asm.mixin.injection.modify.ModifyVariableInjector; +import org.spongepowered.asm.mixin.injection.struct.InjectionPointData; + +public class StoreInjectionPoint extends BeforeLoadLocal{ +public StoreInjectionPoint(InjectionPointData d) { + +super(d,Opcodes.ISTORE,true); + +} + @Override + public boolean find(String desc, InsnList insns, Collection nodes) { + boolean[] b=new boolean[1]; + insns.forEach(s->{ + + if(s.getOpcode()==Opcodes.ASTORE + + + + ){ + //System.out.println(((VarInsnNode)s).); + b[0]=true; + nodes.add(s); + + } + + + }); + + return b[0]; + } + +} diff --git a/src/main/java/reobf/proghatches/main/mixin/mixins/MixinFixTossWhenClickSlot.java b/src/main/java/reobf/proghatches/main/mixin/mixins/MixinFixTossWhenClickSlot.java index fa0be5f..34cdd86 100644 --- a/src/main/java/reobf/proghatches/main/mixin/mixins/MixinFixTossWhenClickSlot.java +++ b/src/main/java/reobf/proghatches/main/mixin/mixins/MixinFixTossWhenClickSlot.java @@ -23,5 +23,15 @@ protected boolean mouseClicked(boolean c) { return c; } +/* +GuiContainer.java + +boolean flag1 = mouseX < i1 || mouseY < j1 || mouseX >= i1 + this.xSize || mouseY >= j1 + this.ySize; +if (slot != null) { +flag1 = this.localvar$zzg000$programmablehatches$mouseClicked(flag1);<-----------inject here +k1 = slot.slotNumber; +} + +*/ } diff --git a/src/main/java/reobf/proghatches/main/mixin/mixins/MixinHandleProgrammingOnRecipeStart.java b/src/main/java/reobf/proghatches/main/mixin/mixins/MixinHandleProgrammingOnRecipeStart.java index 43b8e2e..2b246a7 100644 --- a/src/main/java/reobf/proghatches/main/mixin/mixins/MixinHandleProgrammingOnRecipeStart.java +++ b/src/main/java/reobf/proghatches/main/mixin/mixins/MixinHandleProgrammingOnRecipeStart.java @@ -21,7 +21,9 @@ public abstract class MixinHandleProgrammingOnRecipeStart { // GT_MetaTileEntity_Hatch_InputBus @SuppressWarnings("rawtypes") - @ModifyVariable(method = "startRecipeProcessing", at = @At(opcode = Opcodes.ASTORE, value = "STORE"), require = 1) + @ModifyVariable( + method = "startRecipeProcessing",ordinal=0/*set it to 0 to enable explicit mode or mixin will raise warnings*/, + at = @At(opcode = Opcodes.ASTORE, value = "STORE"/*"reobf.proghatches.main.mixin.StoreInjectionPoint"*/), require = 1) public GT_MetaTileEntity_Hatch_InputBus startRecipeProcessing(GT_MetaTileEntity_Hatch_InputBus a) { try { @@ -40,7 +42,13 @@ public GT_MetaTileEntity_Hatch_InputBus startRecipeProcessing(GT_MetaTileEntity_ } return a; - // MixinCallback.handleAddedToMachineList(aTileEntity,this); + } - + /* + + opcode = Opcodes.ASTORE seems to be useless? + [14:57:37] [Client thread/WARN] [mixin]: @At("STORE" implicit GT_MetaTileEntity_Hatch_InputBus) has invalid IMPLICIT discriminator for opcode 8 in gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase::startRecipeProcessing()V: Found 0 candidate variables but exactly 1 is required. + [14:57:37] [Client thread/WARN] [mixin]: @At("STORE" implicit GT_MetaTileEntity_Hatch_InputBus) has invalid IMPLICIT discriminator for opcode 51 in gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase::startRecipeProcessing()V: Found 0 candidate variables but exactly 1 is required. + [14:57:37] [Client thread/WARN] [mixin]: @At("STORE" implicit GT_MetaTileEntity_Hatch_InputBus) has invalid IMPLICIT discriminator for opcode 59 in gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase::startRecipeProcessing()V: Found 0 candidate variables but exactly 1 is required. +*/ } diff --git a/src/main/java/reobf/proghatches/main/mixin/mixins/MixinPatternEncodingCiruitSpecialTreatment2.java b/src/main/java/reobf/proghatches/main/mixin/mixins/MixinPatternEncodingCiruitSpecialTreatment2.java index 08717a6..950f063 100644 --- a/src/main/java/reobf/proghatches/main/mixin/mixins/MixinPatternEncodingCiruitSpecialTreatment2.java +++ b/src/main/java/reobf/proghatches/main/mixin/mixins/MixinPatternEncodingCiruitSpecialTreatment2.java @@ -96,7 +96,7 @@ private List g(List c) { * private void g(IRecipeHandler recipe, int recipeIndex, String identifier,CallbackInfoReturnable c,List cap,int i, * Iterator ii, PositionedStack iii){ * } - * 牛的 mixin还能混出VerifyError + * * cpw.mods.fml.common.LoaderException: java.lang.VerifyError: Bad local variable type * Exception Details: * Location: diff --git a/src/main/java/reobf/proghatches/util/IIconTexture.java b/src/main/java/reobf/proghatches/util/IIconTexture.java new file mode 100644 index 0000000..ae68b9a --- /dev/null +++ b/src/main/java/reobf/proghatches/util/IIconTexture.java @@ -0,0 +1,104 @@ +package reobf.proghatches.util; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + +import gregtech.api.interfaces.IBlockContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.util.LightingHelper; +import gregtech.common.render.GT_TextureBase; + +public class IIconTexture extends GT_TextureBase implements ITexture { + + private final IIcon mBlock; + // private final byte mSide, mMeta; + + protected IIconTexture(IIcon aBlock, short[] aRGBa) { + if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_CopiedBlockTexture"); + mBlock = aBlock; + + } + + @Override + public boolean isOldTexture() { + return false; + } + + private IIcon getIcon(int ordinalSide) { + + return mBlock; + } + + @Override + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + final IIcon aIcon = getIcon(ForgeDirection.EAST.ordinal()); + aRenderer.field_152631_f = true; + startDrawingQuads(aRenderer, 1.0f, 0.0f, 0.0f); + new LightingHelper(aRenderer).setupLightingXPos(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.EAST, 0xffffff); + aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, aIcon); + draw(aRenderer); + aRenderer.field_152631_f = false; + } + + @Override + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + startDrawingQuads(aRenderer, -1.0f, 0.0f, 0.0f); + final IIcon aIcon = getIcon(ForgeDirection.WEST.ordinal()); + new LightingHelper(aRenderer).setupLightingXNeg(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.WEST, 0xffffff); + aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, aIcon); + draw(aRenderer); + } + + @Override + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + startDrawingQuads(aRenderer, 0.0f, 1.0f, 0.0f); + final IIcon aIcon = getIcon(ForgeDirection.UP.ordinal()); + new LightingHelper(aRenderer).setupLightingYPos(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.UP, 0xffffff); + aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, aIcon); + draw(aRenderer); + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + startDrawingQuads(aRenderer, 0.0f, -1.0f, 0.0f); + final IIcon aIcon = getIcon(ForgeDirection.DOWN.ordinal()); + new LightingHelper(aRenderer).setupLightingYNeg(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.DOWN, 0xffffff); + aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, aIcon); + draw(aRenderer); + } + + @Override + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + startDrawingQuads(aRenderer, 0.0f, 0.0f, 1.0f); + final IIcon aIcon = getIcon(ForgeDirection.SOUTH.ordinal()); + new LightingHelper(aRenderer).setupLightingZPos(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.SOUTH, 0xffffff); + aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, aIcon); + draw(aRenderer); + } + + @Override + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + startDrawingQuads(aRenderer, 0.0f, 0.0f, -1.0f); + final IIcon aIcon = getIcon(ForgeDirection.NORTH.ordinal()); + aRenderer.field_152631_f = true; + new LightingHelper(aRenderer).setupLightingZNeg(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.NORTH, 0xffffff); + aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, aIcon); + draw(aRenderer); + aRenderer.field_152631_f = false; + } + + @Override + public boolean isValidTexture() { + return mBlock != null; + } + + +}