From 37e856efdce12db59dd45ee9f7d3909ab26b05ae Mon Sep 17 00:00:00 2001 From: Jummit Date: Sat, 15 May 2021 20:04:51 +0200 Subject: [PATCH 1/5] Skip 737b3cb5 Don't use capabilities for generic peripherals --- patchwork.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/patchwork.md b/patchwork.md index cc9b68710..df4dd12a9 100644 --- a/patchwork.md +++ b/patchwork.md @@ -422,3 +422,10 @@ The config still uses a `blacklist` and `whitelist` array. Added improved help viewer (#595) ``` Didn't port the lua tests over. + +``` +737b3cb57696fb5517252e7db38bc88ce960b4d8 + +Don't use capabilities for generic peripherals +``` +Not ported, related to forges capability system which is not used in the port. From 02c7903cb7dfe07afbb48c6535d16485a13a1fe1 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Thu, 10 Dec 2020 19:05:31 +0000 Subject: [PATCH 2/5] Remove a couple of todos --- patchwork.md | 6 ++++++ .../client/proxy/ComputerCraftProxyClient.java | 1 - .../client/render/MonitorTextureBufferShader.java | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/patchwork.md b/patchwork.md index df4dd12a9..84ab9a376 100644 --- a/patchwork.md +++ b/patchwork.md @@ -429,3 +429,9 @@ Didn't port the lua tests over. Don't use capabilities for generic peripherals ``` Not ported, related to forges capability system which is not used in the port. + +``` +ea3a16036794357c3a44edffc90fdb652e03881e + +Remove a couple of todos +``` diff --git a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java index 79d9dad5b..251b0d4c3 100644 --- a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java +++ b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java @@ -76,7 +76,6 @@ public final class ComputerCraftProxyClient implements ClientModInitializer { BlockEntityRendererRegistry.INSTANCE.register(ComputerCraftRegistry.ModTiles.MONITOR_ADVANCED, TileEntityMonitorRenderer::new); BlockEntityRendererRegistry.INSTANCE.register(ComputerCraftRegistry.ModTiles.TURTLE_NORMAL, TileEntityTurtleRenderer::new); BlockEntityRendererRegistry.INSTANCE.register(ComputerCraftRegistry.ModTiles.TURTLE_ADVANCED, TileEntityTurtleRenderer::new); - // TODO: ClientRegistry.bindTileEntityRenderer( TileCable.FACTORY, x -> new TileEntityCableRenderer() ); ClientSpriteRegistryCallback.event(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE) .register(ClientRegistry::onTextureStitchEvent); diff --git a/src/main/java/dan200/computercraft/client/render/MonitorTextureBufferShader.java b/src/main/java/dan200/computercraft/client/render/MonitorTextureBufferShader.java index a1e28598a..882d8582f 100644 --- a/src/main/java/dan200/computercraft/client/render/MonitorTextureBufferShader.java +++ b/src/main/java/dan200/computercraft/client/render/MonitorTextureBufferShader.java @@ -49,7 +49,6 @@ class MonitorTextureBufferShader { RenderSystem.glUniform1i(uniformWidth, width); RenderSystem.glUniform1i(uniformHeight, height); - // TODO: Cache this? Maybe?? PALETTE_BUFFER.rewind(); for (int i = 0; i < 16; i++) { double[] colour = palette.getColour(i); From d6c5a5bd2757f696d4661feed762090bc0052283 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Thu, 10 Dec 2020 19:13:49 +0000 Subject: [PATCH 3/5] Some sanity checks for get{Direction,Orientation} Silly bodge, but should fix #600. --- patchwork.md | 7 +++++++ .../shared/peripheral/monitor/TileMonitor.java | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/patchwork.md b/patchwork.md index 84ab9a376..40a7ddb96 100644 --- a/patchwork.md +++ b/patchwork.md @@ -435,3 +435,10 @@ ea3a16036794357c3a44edffc90fdb652e03881e Remove a couple of todos ``` + +``` +bb8f4c624bf87169b73fb631d8250cfc38181e15 + +Some sanity checks for get{Direction,Orientation} +``` +Use `getCachedState` instead of forge's `getBlockState` and `contains` instead of `has`. \ No newline at end of file diff --git a/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java b/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java index aa520479d..d677099f3 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java @@ -218,7 +218,10 @@ public class TileMonitor extends TileGeneric implements IPeripheralTile { // region Sizing and placement stuff public Direction getDirection() { - return this.getCachedState().get(BlockMonitor.FACING); + // Ensure we're actually a monitor block. This _should_ always be the case, but sometimes there's + // fun problems with the block being missing on the client. + BlockState state = getCachedState(); + return state.contains( BlockMonitor.FACING ) ? state.get( BlockMonitor.FACING ) : Direction.NORTH; } public Direction getOrientation() { From 45ac601946cd0f97746f2b05c9cdb2cc91d12fe4 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Thu, 10 Dec 2020 22:16:49 +0000 Subject: [PATCH 4/5] Generate docs for generic peripherals This was the easy bit. Now I've got to write them! --- patchwork.md | 9 ++++++++- .../peripheral/generic/methods/InventoryMethods.java | 2 -- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/patchwork.md b/patchwork.md index 40a7ddb96..8153ec51d 100644 --- a/patchwork.md +++ b/patchwork.md @@ -441,4 +441,11 @@ bb8f4c624bf87169b73fb631d8250cfc38181e15 Some sanity checks for get{Direction,Orientation} ``` -Use `getCachedState` instead of forge's `getBlockState` and `contains` instead of `has`. \ No newline at end of file +Use `getCachedState` instead of forge's `getBlockState` and `contains` instead of `has`. + +``` +05c3c8ad3269c9025757f9261e7f609889fb6bdc + +Generate docs for generic peripherals +``` +Skipped everything except some removed whitespace. \ No newline at end of file diff --git a/src/main/java/dan200/computercraft/shared/peripheral/generic/methods/InventoryMethods.java b/src/main/java/dan200/computercraft/shared/peripheral/generic/methods/InventoryMethods.java index 6642cccf2..76186fc24 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/generic/methods/InventoryMethods.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/generic/methods/InventoryMethods.java @@ -36,8 +36,6 @@ import java.util.Optional; import static dan200.computercraft.shared.peripheral.generic.methods.ArgumentHelpers.assertBetween; - - /** * Methods for interacting with inventories. * From 70eff6aa6336f982231ac5fdec55cd04f1a45557 Mon Sep 17 00:00:00 2001 From: Jummit Date: Sat, 15 May 2021 20:32:40 +0200 Subject: [PATCH 5/5] Skip "Docs for energy and inventory methods" --- patchwork.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/patchwork.md b/patchwork.md index 8153ec51d..46f21aa62 100644 --- a/patchwork.md +++ b/patchwork.md @@ -448,4 +448,17 @@ Use `getCachedState` instead of forge's `getBlockState` and `contains` instead o Generate docs for generic peripherals ``` -Skipped everything except some removed whitespace. \ No newline at end of file +Skipped everything except some removed whitespace. + +``` +85cf2d5ff1b63010de4661301801aa504e5b9015 + +Docs for energy and inventory methods +``` +and +``` +5865e9c41a0140b9f1acdd2fb095353c467fbb45 + +Not sure what irritates me more +``` +both skipped because the changes where already ported. \ No newline at end of file