Conversation
Roelymole
left a comment
There was a problem hiding this comment.
I was away, so sorry it took me a little while to get to this.
I do have a few comments, but in general this is all looking very good!
| protected void addTags(HolderLookup.Provider provider) { | ||
| this.tag(GCBlockTags.SEALABLE) | ||
| .add(GCBlocks.AIR_LOCK_SEAL) | ||
| .add(GCBlocks.MAGNETIC_CRAFTING_TABLE) |
There was a problem hiding this comment.
I would have expected the magnetic crafting table to be sealable without being added to this list of exceptions.
| var textureMapping = new TextureMapping() | ||
| .put(TextureSlot.BOTTOM, TextureMapping.getBlockTexture(block, "_base")) | ||
| .put(TextureSlot.TOP, TextureMapping.getBlockTexture(block, "_top")) | ||
| .put(TextureSlot.SIDE, TextureMapping.getBlockTexture(block, "_side")); |
There was a problem hiding this comment.
I would suggest renaming the base texture to magnetic_crafting_table_bottom.png, then this can be simplified to TextureMapping.cubeBottomTop(block).
| ) | ||
| )); | ||
| registry.register(SimpleTransferHandler.create(MagneticCraftingTableMenu.class, BuiltinPlugin.CRAFTING, | ||
| new SimpleTransferHandler.IntRange(1, 10) |
There was a problem hiding this comment.
It would be better to avoid hardcoding the start and end points of the range, especially since you have already defined constants with the values that are needed.
| new SimpleTransferHandler.IntRange(1, 10) | |
| new SimpleTransferHandler.IntRange( | |
| MagneticCraftingTableMenu.CRAFT_SLOT_START, | |
| MagneticCraftingTableMenu.CRAFT_SLOT_END | |
| ) |
| registration.addRecipeTransferHandler(FoodCannerMenu.class, null, GCJEIRecipeTypes.CANNING, | ||
| FoodCannerBlockEntity.INPUT_SLOT, FoodCannerBlockEntity.INPUT_LENGTH, FoodCannerBlockEntity.OUTPUT_SLOT + 1, 36); | ||
| registration.addRecipeTransferHandler(MagneticCraftingTableMenu.class, GCMenuTypes.MAGNETIC_CRAFTING_TABLE, RecipeTypes.CRAFTING, | ||
| 1, 9, 10, 36); |
There was a problem hiding this comment.
It would be better to make use of the constants you have defined here as well rather than using 'magic numbers'.
They are unlikely to change in this case, but at the very least it would be more descriptive.
| import java.util.List; | ||
| import java.util.stream.IntStream; | ||
|
|
||
| @SuppressWarnings("UnstableApiUsage") |
There was a problem hiding this comment.
Perhaps there was an instance of UnstableApiUsage that you were suppressing at some point, but there don't seem to be any now, so this should probably be removed.
| @Override | ||
| public List<Slot> getCraftingSlots(MagneticCraftingTableMenu menu) { | ||
| List<Slot> slots = new ArrayList<>(); | ||
| for (int slot = 1; slot < 10; ++slot) { |
There was a problem hiding this comment.
Similarly, it would be better to use the constants MagneticCraftingTableMenu.CRAFT_SLOT_START and MagneticCraftingTableMenu.CRAFT_SLOT_END here.
| BlockEntity blockEntity = level.getBlockEntity(pos); | ||
| if (blockEntity instanceof MagneticCraftingTableBlockEntity craftingTable) { | ||
| player.openMenu(craftingTable); | ||
| player.awardStat(Stats.INTERACT_WITH_CRAFTING_TABLE); |
There was a problem hiding this comment.
It would be much better to add a stat dedicated to the magnetic crafting table. It should just be a case of adding a single line to GCStats and GCTranslationProvider, then rerunning the datagen Gradle task.
| this.blockDesc(GCBlocks.FUEL_LOADER, "Loads fuel into a rocket placed on an adjacent launch pad."); | ||
| this.blockDesc(GCBlocks.GLOWSTONE_LANTERN, "Provides light, even in areas without oxygen."); | ||
| this.blockDesc(GCBlocks.GLOWSTONE_TORCH, "Provides light, even in areas without oxygen."); | ||
| this.blockDesc(GCBlocks.MAGNETIC_CRAFTING_TABLE, "Holds items in its crafting grid when closed. Hoppers can insert ingredients."); |
There was a problem hiding this comment.
It is not just hoppers that will be able to insert items, so it might be worth rewording this slightly.
| // SPECIAL | ||
| public static final Block ROCKET_LAUNCH_PAD = BLOCKS.registerWithItem(Constant.Block.ROCKET_LAUNCH_PAD, new LaunchPadBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_LIGHT_GRAY).instrument(NoteBlockInstrument.BASEDRUM).strength(1.5F, 10.0F).requiresCorrectToolForDrops())); | ||
| public static final Block FUELING_PAD = BLOCKS.registerWithItem(Constant.Block.FUELING_PAD, new FuelPadBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_GRAY).instrument(NoteBlockInstrument.BASEDRUM).strength(1.5F, 10.0F).requiresCorrectToolForDrops())); | ||
| public static final Block MAGNETIC_CRAFTING_TABLE = BLOCKS.registerWithItem(Constant.Block.MAGNETIC_CRAFTING_TABLE, new MagneticCraftingTableBlock(BlockBehaviour.Properties.of().mapColor(MapColor.METAL).instrument(NoteBlockInstrument.BASEDRUM).strength(0.6F, 2.5F).sound(SoundType.METAL).requiresCorrectToolForDrops())); |
There was a problem hiding this comment.
The strength values seem a bit low, it might be worth playing around with them a bit to find something that feels a bit more balanced.
| generator.blockStateOutput.accept(MultiVariantGenerator.multiVariant(block).with(PropertyDispatch.property(MagneticCraftingTableBlock.FACING) | ||
| .select(Direction.DOWN, Variant.variant() | ||
| .with(VariantProperties.X_ROT, VariantProperties.Rotation.R180) | ||
| .with(VariantProperties.MODEL, model)) | ||
| .select(Direction.UP, Variant.variant() | ||
| .with(VariantProperties.MODEL, model)) | ||
| .select(Direction.NORTH, Variant.variant() | ||
| .with(VariantProperties.X_ROT, VariantProperties.Rotation.R90) | ||
| .with(VariantProperties.MODEL, model)) | ||
| .select(Direction.SOUTH, Variant.variant() | ||
| .with(VariantProperties.X_ROT, VariantProperties.Rotation.R90) | ||
| .with(VariantProperties.Y_ROT, VariantProperties.Rotation.R180) | ||
| .with(VariantProperties.MODEL, model)) | ||
| .select(Direction.WEST, Variant.variant() | ||
| .with(VariantProperties.X_ROT, VariantProperties.Rotation.R90) | ||
| .with(VariantProperties.Y_ROT, VariantProperties.Rotation.R270) | ||
| .with(VariantProperties.MODEL, model)) | ||
| .select(Direction.EAST, Variant.variant() | ||
| .with(VariantProperties.X_ROT, VariantProperties.Rotation.R90) | ||
| .with(VariantProperties.Y_ROT, VariantProperties.Rotation.R90) | ||
| .with(VariantProperties.MODEL, model)) | ||
| )); | ||
| generator.delegateItemModel(block, model); |
There was a problem hiding this comment.
There are some helper functions that can be used to simplify this a great deal.
| generator.blockStateOutput.accept(MultiVariantGenerator.multiVariant(block).with(PropertyDispatch.property(MagneticCraftingTableBlock.FACING) | |
| .select(Direction.DOWN, Variant.variant() | |
| .with(VariantProperties.X_ROT, VariantProperties.Rotation.R180) | |
| .with(VariantProperties.MODEL, model)) | |
| .select(Direction.UP, Variant.variant() | |
| .with(VariantProperties.MODEL, model)) | |
| .select(Direction.NORTH, Variant.variant() | |
| .with(VariantProperties.X_ROT, VariantProperties.Rotation.R90) | |
| .with(VariantProperties.MODEL, model)) | |
| .select(Direction.SOUTH, Variant.variant() | |
| .with(VariantProperties.X_ROT, VariantProperties.Rotation.R90) | |
| .with(VariantProperties.Y_ROT, VariantProperties.Rotation.R180) | |
| .with(VariantProperties.MODEL, model)) | |
| .select(Direction.WEST, Variant.variant() | |
| .with(VariantProperties.X_ROT, VariantProperties.Rotation.R90) | |
| .with(VariantProperties.Y_ROT, VariantProperties.Rotation.R270) | |
| .with(VariantProperties.MODEL, model)) | |
| .select(Direction.EAST, Variant.variant() | |
| .with(VariantProperties.X_ROT, VariantProperties.Rotation.R90) | |
| .with(VariantProperties.Y_ROT, VariantProperties.Rotation.R90) | |
| .with(VariantProperties.MODEL, model)) | |
| )); | |
| generator.delegateItemModel(block, model); | |
| generator.blockStateOutput.accept( | |
| MultiVariantGenerator.multiVariant(block, Variant.variant().with(VariantProperties.MODEL, model)) | |
| .with(generator.createColumnWithFacing()) | |
| ); |
Closes #512.