Fix dyed handle compilation error

- Revert DYED_VALVE_HANDLES to using an array instead of a Vector
This commit is contained in:
PepperBell 2021-05-24 13:49:59 -07:00
parent 20cd8da377
commit d31fe013ce
4 changed files with 6 additions and 10 deletions

View file

@ -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.customItemModel;
import static com.simibubi.create.foundation.data.ModelGen.oxidizedItemModel; import static com.simibubi.create.foundation.data.ModelGen.oxidizedItemModel;
import java.util.Vector;
import com.simibubi.create.AllTags.AllBlockTags; import com.simibubi.create.AllTags.AllBlockTags;
import com.simibubi.create.AllTags.AllItemTags; import com.simibubi.create.AllTags.AllItemTags;
import com.simibubi.create.content.AllSections; import com.simibubi.create.content.AllSections;
@ -627,13 +625,12 @@ public class AllBlocks {
.transform(BuilderTransformers.valveHandle(null)) .transform(BuilderTransformers.valveHandle(null))
.register(); .register();
public static final Vector<BlockEntry<ValveHandleBlock>> DYED_VALVE_HANDLES = public static final BlockEntry<?>[] DYED_VALVE_HANDLES = new BlockEntry<?>[DyeColor.values().length];
new Vector<>(DyeColor.values().length);
static { static {
for (DyeColor colour : DyeColor.values()) { for (DyeColor colour : DyeColor.values()) {
String colourName = colour.getString(); 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)) .transform(BuilderTransformers.valveHandle(colour))
.recipe((c, p) -> ShapedRecipeBuilder.shapedRecipe(c.get()) .recipe((c, p) -> ShapedRecipeBuilder.shapedRecipe(c.get())
.patternLine("#") .patternLine("#")
@ -642,7 +639,7 @@ public class AllBlocks {
.key('-', AllItemTags.VALVE_HANDLES.tag) .key('-', AllItemTags.VALVE_HANDLES.tag)
.addCriterion("has_valve", RegistrateRecipeProvider.hasItem(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"))) .build(p, Create.asResource("crafting/kinetics/" + c.getName() + "_from_other_valve_handle")))
.register()); .register();
} }
} }

View file

@ -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.SchematicannonRenderer;
import com.simibubi.create.content.schematics.block.SchematicannonTileEntity; import com.simibubi.create.content.schematics.block.SchematicannonTileEntity;
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer; import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer;
import com.tterrag.registrate.util.entry.BlockEntry;
import com.tterrag.registrate.util.entry.TileEntityEntry; import com.tterrag.registrate.util.entry.TileEntityEntry;
public class AllTileEntities { public class AllTileEntities {
@ -249,7 +248,7 @@ public class AllTileEntities {
.tileEntity("hand_crank", HandCrankTileEntity::new) .tileEntity("hand_crank", HandCrankTileEntity::new)
.instance(() -> HandCrankInstance::new) .instance(() -> HandCrankInstance::new)
.validBlocks(AllBlocks.HAND_CRANK, AllBlocks.COPPER_VALVE_HANDLE) .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) .renderer(() -> HandCrankRenderer::new)
.register(); .register();

View file

@ -48,7 +48,7 @@ public class ValveHandleBlock extends HandCrankBlock {
if (worldIn.isRemote) if (worldIn.isRemote)
return ActionResultType.SUCCESS; return ActionResultType.SUCCESS;
BlockState newState = AllBlocks.DYED_VALVE_HANDLES.get(color.ordinal()) BlockState newState = AllBlocks.DYED_VALVE_HANDLES[color.ordinal()]
.getDefaultState() .getDefaultState()
.with(FACING, state.get(FACING)); .with(FACING, state.get(FACING));
if (newState != state) if (newState != state)

View file

@ -631,7 +631,7 @@ public class KineticsScenes {
scene.overlay.showControls(new InputWindowElement(centerOf, Pointing.DOWN).rightClick() scene.overlay.showControls(new InputWindowElement(centerOf, Pointing.DOWN).rightClick()
.withItem(new ItemStack(Items.BLUE_DYE)), 40); .withItem(new ItemStack(Items.BLUE_DYE)), 40);
scene.idle(7); 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); .with(ValveHandleBlock.FACING, Direction.UP), true);
scene.idle(10); scene.idle(10);
scene.overlay.showText(70) scene.overlay.showText(70)