From d31fe013cead44d4112eeb25cf890ed6ede15b50 Mon Sep 17 00:00:00 2001 From: PepperBell <44146161+PepperCode1@users.noreply.github.com> Date: Mon, 24 May 2021 13:49:59 -0700 Subject: [PATCH] Fix dyed handle compilation error - Revert DYED_VALVE_HANDLES to using an array instead of a Vector --- src/main/java/com/simibubi/create/AllBlocks.java | 9 +++------ src/main/java/com/simibubi/create/AllTileEntities.java | 3 +-- .../contraptions/components/crank/ValveHandleBlock.java | 2 +- .../create/foundation/ponder/content/KineticsScenes.java | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 8944e78c6..c50c3701e 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -9,8 +9,6 @@ import static com.simibubi.create.foundation.data.CreateRegistrate.connectedText import static com.simibubi.create.foundation.data.ModelGen.customItemModel; import static com.simibubi.create.foundation.data.ModelGen.oxidizedItemModel; -import java.util.Vector; - import com.simibubi.create.AllTags.AllBlockTags; import com.simibubi.create.AllTags.AllItemTags; import com.simibubi.create.content.AllSections; @@ -627,13 +625,12 @@ public class AllBlocks { .transform(BuilderTransformers.valveHandle(null)) .register(); - public static final Vector> DYED_VALVE_HANDLES = - new Vector<>(DyeColor.values().length); + public static final BlockEntry[] DYED_VALVE_HANDLES = new BlockEntry[DyeColor.values().length]; static { for (DyeColor colour : DyeColor.values()) { String colourName = colour.getString(); - DYED_VALVE_HANDLES.add(REGISTRATE.block(colourName + "_valve_handle", ValveHandleBlock::dyed) + DYED_VALVE_HANDLES[colour.ordinal()] = REGISTRATE.block(colourName + "_valve_handle", ValveHandleBlock::dyed) .transform(BuilderTransformers.valveHandle(colour)) .recipe((c, p) -> ShapedRecipeBuilder.shapedRecipe(c.get()) .patternLine("#") @@ -642,7 +639,7 @@ public class AllBlocks { .key('-', AllItemTags.VALVE_HANDLES.tag) .addCriterion("has_valve", RegistrateRecipeProvider.hasItem(AllItemTags.VALVE_HANDLES.tag)) .build(p, Create.asResource("crafting/kinetics/" + c.getName() + "_from_other_valve_handle"))) - .register()); + .register(); } } diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index 329786289..1ff2f9a0f 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -157,7 +157,6 @@ import com.simibubi.create.content.schematics.block.SchematicannonInstance; import com.simibubi.create.content.schematics.block.SchematicannonRenderer; import com.simibubi.create.content.schematics.block.SchematicannonTileEntity; import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer; -import com.tterrag.registrate.util.entry.BlockEntry; import com.tterrag.registrate.util.entry.TileEntityEntry; public class AllTileEntities { @@ -249,7 +248,7 @@ public class AllTileEntities { .tileEntity("hand_crank", HandCrankTileEntity::new) .instance(() -> HandCrankInstance::new) .validBlocks(AllBlocks.HAND_CRANK, AllBlocks.COPPER_VALVE_HANDLE) - .validBlocks(AllBlocks.DYED_VALVE_HANDLES.toArray(new BlockEntry[AllBlocks.DYED_VALVE_HANDLES.size()])) + .validBlocks(AllBlocks.DYED_VALVE_HANDLES) .renderer(() -> HandCrankRenderer::new) .register(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crank/ValveHandleBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crank/ValveHandleBlock.java index e9e8c32d7..a29a996c1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crank/ValveHandleBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crank/ValveHandleBlock.java @@ -48,7 +48,7 @@ public class ValveHandleBlock extends HandCrankBlock { if (worldIn.isRemote) return ActionResultType.SUCCESS; - BlockState newState = AllBlocks.DYED_VALVE_HANDLES.get(color.ordinal()) + BlockState newState = AllBlocks.DYED_VALVE_HANDLES[color.ordinal()] .getDefaultState() .with(FACING, state.get(FACING)); if (newState != state) diff --git a/src/main/java/com/simibubi/create/foundation/ponder/content/KineticsScenes.java b/src/main/java/com/simibubi/create/foundation/ponder/content/KineticsScenes.java index 3bc0ccf90..8177eb9b3 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/content/KineticsScenes.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/content/KineticsScenes.java @@ -631,7 +631,7 @@ public class KineticsScenes { scene.overlay.showControls(new InputWindowElement(centerOf, Pointing.DOWN).rightClick() .withItem(new ItemStack(Items.BLUE_DYE)), 40); scene.idle(7); - scene.world.modifyBlock(util.grid.at(2, 2, 2), s -> AllBlocks.DYED_VALVE_HANDLES.get(11).getDefaultState() + scene.world.modifyBlock(util.grid.at(2, 2, 2), s -> AllBlocks.DYED_VALVE_HANDLES[11].getDefaultState() .with(ValveHandleBlock.FACING, Direction.UP), true); scene.idle(10); scene.overlay.showText(70)