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 00000000000..d486f10c232 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/cover/cover_pump_inverted.png differ 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 00000000000..d65d2a5c08f Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_arm_inverted.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_arm_inverted_emissive.png b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_arm_inverted_emissive.png new file mode 100644 index 00000000000..4b4a21cb74d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_arm_inverted_emissive.png differ 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 00000000000..d65d2a5c08f Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_conveyor_inverted.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_conveyor_inverted_emissive.png b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_conveyor_inverted_emissive.png new file mode 100644 index 00000000000..4b4a21cb74d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_conveyor_inverted_emissive.png differ 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 00000000000..6555701ae66 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_pump_inverted.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_pump_inverted.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_pump_inverted.png.mcmeta new file mode 100644 index 00000000000..97596ba8176 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_pump_inverted.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":2 + } +} \ No newline at end of file