From acfeb9bf288c5a2450ad4098ba429b0ca2dd7ef7 Mon Sep 17 00:00:00 2001 From: DStrand1 Date: Tue, 7 Dec 2021 01:13:38 -0600 Subject: [PATCH] Invert some cover animations when set to `import` fix ru_ru and zh_cn lang key from last commit --- .../java/gregtech/api/render/Textures.java | 3 ++ .../gregtech/common/covers/CoverConveyor.java | 29 +++++++++++++++++- .../gregtech/common/covers/CoverPump.java | 29 +++++++++++++++++- .../common/covers/CoverRoboticArm.java | 6 +++- .../resources/assets/gregtech/lang/ru_ru.lang | 2 +- .../resources/assets/gregtech/lang/zh_cn.lang | 2 +- .../blocks/cover/cover_pump_inverted.png | Bin 0 -> 742 bytes .../blocks/cover/overlay_arm_inverted.png | Bin 0 -> 457 bytes .../cover/overlay_arm_inverted_emissive.png | Bin 0 -> 202 bytes .../overlay_arm_inverted_emissive.png.mcmeta | 5 +++ .../cover/overlay_conveyor_inverted.png | Bin 0 -> 457 bytes .../overlay_conveyor_inverted_emissive.png | Bin 0 -> 202 bytes ...rlay_conveyor_inverted_emissive.png.mcmeta | 5 +++ .../blocks/cover/overlay_pump_inverted.png | Bin 0 -> 745 bytes .../cover/overlay_pump_inverted.png.mcmeta | 5 +++ 15 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 src/main/resources/assets/gregtech/textures/blocks/cover/cover_pump_inverted.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/cover/overlay_arm_inverted.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/cover/overlay_arm_inverted_emissive.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/cover/overlay_arm_inverted_emissive.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/cover/overlay_conveyor_inverted.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/cover/overlay_conveyor_inverted_emissive.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/cover/overlay_conveyor_inverted_emissive.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/cover/overlay_pump_inverted.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/cover/overlay_pump_inverted.png.mcmeta diff --git a/src/main/java/gregtech/api/render/Textures.java b/src/main/java/gregtech/api/render/Textures.java index 682fed98fcd..a8446e10cb2 100644 --- a/src/main/java/gregtech/api/render/Textures.java +++ b/src/main/java/gregtech/api/render/Textures.java @@ -195,8 +195,11 @@ public class Textures { public static final SimpleOverlayRenderer ENERGY_OUT_ULTRA = new SimpleOverlayRenderer("overlay/machine/overlay_energy_out_ultra"); public static final SimpleOverlayRenderer ENERGY_IN_ULTRA = new SimpleOverlayRenderer("overlay/machine/overlay_energy_in_ultra"); public static final SimpleOverlayRenderer CONVEYOR_OVERLAY = new SimpleOverlayRenderer("cover/overlay_conveyor"); + public static final SimpleOverlayRenderer CONVEYOR_OVERLAY_INVERTED = new SimpleOverlayRenderer("cover/overlay_conveyor_inverted"); public static final SimpleOverlayRenderer ARM_OVERLAY = new SimpleOverlayRenderer("cover/overlay_arm"); + public static final SimpleOverlayRenderer ARM_OVERLAY_INVERTED = new SimpleOverlayRenderer("cover/overlay_arm_inverted"); public static final SimpleOverlayRenderer PUMP_OVERLAY = new SimpleOverlayRenderer("cover/overlay_pump"); + public static final SimpleOverlayRenderer PUMP_OVERLAY_INVERTED = new SimpleOverlayRenderer("cover/overlay_pump_inverted"); public static final SimpleOverlayRenderer AIR_VENT_OVERLAY = new SimpleOverlayRenderer("overlay/machine/overlay_air_vent"); public static final SimpleOverlayRenderer BLOWER_OVERLAY = new SimpleOverlayRenderer("overlay/machine/overlay_blower"); public static final SimpleOverlayRenderer BLOWER_ACTIVE_OVERLAY = new SimpleOverlayRenderer("overlay/machine/overlay_blower_active"); diff --git a/src/main/java/gregtech/common/covers/CoverConveyor.java b/src/main/java/gregtech/common/covers/CoverConveyor.java index 9a5d2e0217e..cbfb4ea9db5 100644 --- a/src/main/java/gregtech/common/covers/CoverConveyor.java +++ b/src/main/java/gregtech/common/covers/CoverConveyor.java @@ -29,6 +29,7 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.*; import net.minecraft.util.math.MathHelper; @@ -79,6 +80,7 @@ protected void adjustTransferRate(int amount) { protected void setConveyorMode(ConveyorMode conveyorMode) { this.conveyorMode = conveyorMode; + writeUpdateData(1, buf -> buf.writeEnumValue(conveyorMode)); coverHolder.markDirty(); } @@ -404,7 +406,11 @@ public void onRemoved() { @Override public void renderCover(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline, Cuboid6 plateBox, BlockRenderLayer layer) { - Textures.CONVEYOR_OVERLAY.renderSided(attachedSide, plateBox, renderState, pipeline, translation); + if (conveyorMode == ConveyorMode.EXPORT) { + Textures.CONVEYOR_OVERLAY.renderSided(attachedSide, plateBox, renderState, pipeline, translation); + } else { + Textures.CONVEYOR_OVERLAY_INVERTED.renderSided(attachedSide, plateBox, renderState, pipeline, translation); + } } @Override @@ -495,6 +501,27 @@ public void setWorkingEnabled(boolean isActivationAllowed) { this.isWorkingAllowed = isActivationAllowed; } + @Override + public void readUpdateData(int id, PacketBuffer packetBuffer) { + super.readUpdateData(id, packetBuffer); + if (id == 1) { + this.conveyorMode = packetBuffer.readEnumValue(ConveyorMode.class); + coverHolder.scheduleRenderUpdate(); + } + } + + @Override + public void writeInitialSyncData(PacketBuffer packetBuffer) { + super.writeInitialSyncData(packetBuffer); + packetBuffer.writeEnumValue(conveyorMode); + } + + @Override + public void readInitialSyncData(PacketBuffer packetBuffer) { + super.readInitialSyncData(packetBuffer); + this.conveyorMode = packetBuffer.readEnumValue(ConveyorMode.class); + } + @Override public void writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); diff --git a/src/main/java/gregtech/common/covers/CoverPump.java b/src/main/java/gregtech/common/covers/CoverPump.java index 15ddf7895d6..0e9a7e5965a 100644 --- a/src/main/java/gregtech/common/covers/CoverPump.java +++ b/src/main/java/gregtech/common/covers/CoverPump.java @@ -27,6 +27,7 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.*; import net.minecraft.util.math.BlockPos.PooledMutableBlockPos; @@ -84,6 +85,7 @@ protected void adjustTransferRate(int amount) { public void setPumpMode(PumpMode pumpMode) { this.pumpMode = pumpMode; + writeUpdateData(1, buf -> buf.writeEnumValue(pumpMode)); coverHolder.markDirty(); } @@ -246,6 +248,27 @@ public EnumActionResult onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, return EnumActionResult.SUCCESS; } + @Override + public void readUpdateData(int id, PacketBuffer packetBuffer) { + super.readUpdateData(id, packetBuffer); + if (id == 1) { + this.pumpMode = packetBuffer.readEnumValue(PumpMode.class); + coverHolder.scheduleRenderUpdate(); + } + } + + @Override + public void writeInitialSyncData(PacketBuffer packetBuffer) { + super.writeInitialSyncData(packetBuffer); + packetBuffer.writeEnumValue(pumpMode); + } + + @Override + public void readInitialSyncData(PacketBuffer packetBuffer) { + super.readInitialSyncData(packetBuffer); + this.pumpMode = packetBuffer.readEnumValue(PumpMode.class); + } + @Override public boolean canAttach() { return coverHolder.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, attachedSide) != null; @@ -267,7 +290,11 @@ public void onRemoved() { @Override public void renderCover(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline, Cuboid6 plateBox, BlockRenderLayer layer) { - Textures.PUMP_OVERLAY.renderSided(attachedSide, plateBox, renderState, pipeline, translation); + if (pumpMode == PumpMode.EXPORT) { + Textures.PUMP_OVERLAY.renderSided(attachedSide, plateBox, renderState, pipeline, translation); + } else { + Textures.PUMP_OVERLAY_INVERTED.renderSided(attachedSide, plateBox, renderState, pipeline, translation); + } } @Override diff --git a/src/main/java/gregtech/common/covers/CoverRoboticArm.java b/src/main/java/gregtech/common/covers/CoverRoboticArm.java index ba3fc8423a3..618119bf456 100644 --- a/src/main/java/gregtech/common/covers/CoverRoboticArm.java +++ b/src/main/java/gregtech/common/covers/CoverRoboticArm.java @@ -36,7 +36,11 @@ public CoverRoboticArm(ICoverable coverable, EnumFacing attachedSide, int tier, @Override public void renderCover(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline, Cuboid6 plateBox, BlockRenderLayer layer) { - Textures.ARM_OVERLAY.renderSided(attachedSide, plateBox, renderState, pipeline, translation); + if (conveyorMode == ConveyorMode.EXPORT) { + Textures.ARM_OVERLAY.renderSided(attachedSide, plateBox, renderState, pipeline, translation); + } else { + Textures.ARM_OVERLAY_INVERTED.renderSided(attachedSide, plateBox, renderState, pipeline, translation); + } } @Override diff --git a/src/main/resources/assets/gregtech/lang/ru_ru.lang b/src/main/resources/assets/gregtech/lang/ru_ru.lang index 2bc457a2b66..a5c42765d94 100644 --- a/src/main/resources/assets/gregtech/lang/ru_ru.lang +++ b/src/main/resources/assets/gregtech/lang/ru_ru.lang @@ -843,7 +843,7 @@ cover.fluid_regulator.transfer_mode.description=§eTransfer Any§r - in this mod cover.fluid_regulator.supply_exact=Supply Exact: %s cover.fluid_regulator.keep_exact=Keep Exact: %s -cover.machine_controller.name=Настройки контроллера машины +cover.machine_controller.title=Настройки контроллера машины cover.machine_controller.normal=Нормально cover.machine_controller.inverted=Инвертировано cover.machine_controller.redstone=Минимальный Редстоун сигнал: %d diff --git a/src/main/resources/assets/gregtech/lang/zh_cn.lang b/src/main/resources/assets/gregtech/lang/zh_cn.lang index 785392f4740..ad413130a54 100644 --- a/src/main/resources/assets/gregtech/lang/zh_cn.lang +++ b/src/main/resources/assets/gregtech/lang/zh_cn.lang @@ -634,7 +634,7 @@ cover.pump.mode.export=模式: 过滤输出 cover.pump.mode.import=模式: 过滤输入 cover.pump.fluid_filter.title=流体过滤 -cover.machine_controller.name=机器控制覆盖板设置 +cover.machine_controller.title=机器控制覆盖板设置 cover.machine_controller.normal=不反转信号 cover.machine_controller.inverted=反转信号 cover.machine_controller.redstone=最小红石信号强度: %d diff --git a/src/main/resources/assets/gregtech/textures/blocks/cover/cover_pump_inverted.png b/src/main/resources/assets/gregtech/textures/blocks/cover/cover_pump_inverted.png new file mode 100644 index 0000000000000000000000000000000000000000..d486f10c232540220258aee76c7e07ee5db6408a GIT binary patch literal 742 zcmeAS@N?(olHy`uVBq!ia0vp^0zmA*!3-o-7PBt_QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1esRj6ixXzn5clz`hlO|2->FI85ZLP1budJ+0OHZFUV+Jn|uduMNq?FXY zef!ka)%EoBLPJ9)O`aqyEFvW(rJ$&=a^*^66BB=b|DK+nt5>h?-@kwIwaCCHc_pr6Gsj8~d z)z!<)$Z!OTczF2v`I(!UhlYjv2l#t>dAc||+uGWio0}OL8eX}2RY5^fOC>mZe*OCDwQJL+Pg}iu_0(z8rcRsM(AY3_>a?)1Fh@s+sZ*!cH#BJL zXaj@pef3>cAeB@S=u$M z`}B>k@071W_Yb$;) zXlY+Rf6Fraq6&+ST@oxTd}lvAc(jd^%Z;mlLO|kegDYPIB0CI+r}sT>t$tR|*u l^XO45507w$s9a|!gH(b?*^JqK4}jie@O1TaS?83{1OU7LSp@(9 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_arm_inverted.png b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_arm_inverted.png new file mode 100644 index 0000000000000000000000000000000000000000..d65d2a5c08f636dacf95f4e411466b6718609e93 GIT binary patch literal 457 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%Li30X`wF^XAQ+K7GcdNt1edx?5XY>+9<)D=X8|(`U|@!No< zAtNIrFE1Y&8Zv3}BtbzzQBe_TX&EJDC4Ybao}L~F37`ULWhG@bH8l@U&$hNUX%JUQ zRZUG(Q`5=WxuLO@N=8OjK|$W! z%sezK)IY%A)63Jv+1b|C*4*68(9jU*-WiJ>CIczUk|4j}|6~FNt2L<(KtnhSJR*x3 z82Ao@Fyrz36)8Z$Bu^K|5RKsE4GzptxC{)83^#AswDB;jg~iStl@&jKJY-^Oafb4NqZ4xRaP_B1KQICw_7hWf@j3+pXVU9ooY>gD+i;tA#^MrMYl i#_ik+%#&DkbQnyQ8Nn{1`ISV`@iy0XB4ude`@%$AjK*4xV7srqY_qUf9@-`TVxL&+2c%xA^qC59M zWAjr6&d~lzS0+k@c)l~Vx3B!h#n7;-r6zt)*|nXX*Y%FZF4WIwys}`<=Sf96%DEn(i3Aai-;lSmezRScf4elF{r5}E*4n@24G literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_arm_inverted_emissive.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_arm_inverted_emissive.png.mcmeta new file mode 100644 index 00000000000..97596ba8176 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_arm_inverted_emissive.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":2 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_conveyor_inverted.png b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_conveyor_inverted.png new file mode 100644 index 0000000000000000000000000000000000000000..d65d2a5c08f636dacf95f4e411466b6718609e93 GIT binary patch literal 457 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%Li30X`wF^XAQ+K7GcdNt1edx?5XY>+9<)D=X8|(`U|@!No< zAtNIrFE1Y&8Zv3}BtbzzQBe_TX&EJDC4Ybao}L~F37`ULWhG@bH8l@U&$hNUX%JUQ zRZUG(Q`5=WxuLO@N=8OjK|$W! z%sezK)IY%A)63Jv+1b|C*4*68(9jU*-WiJ>CIczUk|4j}|6~FNt2L<(KtnhSJR*x3 z82Ao@Fyrz36)8Z$Bu^K|5RKsE4GzptxC{)83^#AswDB;jg~iStl@&jKJY-^Oafb4NqZ4xRaP_B1KQICw_7hWf@j3+pXVU9ooY>gD+i;tA#^MrMYl i#_ik+%#&DkbQnyQ8Nn{1`ISV`@iy0XB4ude`@%$AjK*4xV7srqY_qUf9@-`TVxL&+2c%xA^qC59M zWAjr6&d~lzS0+k@c)l~Vx3B!h#n7;-r6zt)*|nXX*Y%FZF4WIwys}`<=Sf96%DEn(i3Aai-;lSmezRScf4elF{r5}E*4n@24G literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_conveyor_inverted_emissive.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_conveyor_inverted_emissive.png.mcmeta new file mode 100644 index 00000000000..97596ba8176 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_conveyor_inverted_emissive.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":2 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_pump_inverted.png b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_pump_inverted.png new file mode 100644 index 0000000000000000000000000000000000000000..6555701ae667065dc8fd4020f5c1b1b66dd612cf GIT binary patch literal 745 zcmeAS@N?(olHy`uVBq!ia0vp^0zmA*!3-o-7PBt_QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1esRj6ixXzn5clz`hlO|2->FI85ZLP1budJ+0OHZFUV+Jn|uduN2m8(}3 z6cp9f)%EoBLPJ9)O`aqyEFvW(wSWJ9HFb4k6BB=b|DK*6DJe+>1%*|sR!*5RrM9jv zBO}AZ)3dFuZPm(Eb#=8?R@RP=j!w?b4ULVudb%biCJv5{?(QD8Ha1mNRl2%*R@T-* zK|$^w9)5m)=4R%hVWIv3{+?c*F3!%jwzlTxW`>4_|NsAg_3D+Rl+@(OQ?6dQs-UP) zS68=c)ha71D|I#XsZ*xZ1Gy_#PMtC}I5^nO&Q4QPW6hd1)2B~+{rdIQYuBbtpSF7S z>Z#MFO`SHip|N4=)M;U1VUCUtQ>RX?Z)nig(cZUj-^!IMuU@@68EC=eDRs5AL4iS; z85y8(EO9#tq>@U4{DOhbpe z!-e??mw|zi;pPpSHXdfRu-Lhyvf}5DhfGXOPKT6g79|xh7IJ!OW=cj{?r7Mvp=rya zNt?K09Hxf*#)dfubL%ZwtGsIU^85r2@dR@tGecA3?G4-t&5a@lc=)}wv*qHXpM2P` zRe0hycTRrx%u@FyA10I(l{s?qhnttGmOuG0LF{Viw+}M29v)0R`}k?Eh@9QNGNrl| zFAv)@=-Mzf2V8dFuq((zBdDUK^|jV(cb=0U9z5C9=W<%VEKuX8YLtZ*o32gL