Skip to content

Commit

Permalink
Add the blueprint shelf, a block that can store up to 9 blueprints!
Browse files Browse the repository at this point in the history
  • Loading branch information
BluSunrize committed Jun 13, 2024
1 parent 8a922db commit d7460b2
Show file tree
Hide file tree
Showing 28 changed files with 1,308 additions and 14 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Allow survey tools to be used on more blocks (voidsong-dragonfly)
- Add cloche recipes for ferns and grass (voidsong-dragonfly)
- Add crushing recipes for stone and deepslate (voidsong-dragonfly)
- Add the blueprint shelf, a block that can store up to 9 blueprints! (BluSunrize)
- Fix crusher not accepting multiple stacks of the same ore (BluSunrize)
- Fix stone multiblocks being washed away by water (BluSunrize)
- Fix potential race condition with wires damaging entities (BluSunrize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import blusunrize.immersiveengineering.common.blocks.metal.*;
import blusunrize.immersiveengineering.common.blocks.metal.MetalLadderBlock.CoverType;
import blusunrize.immersiveengineering.common.blocks.plant.HempBlock;
import blusunrize.immersiveengineering.common.blocks.wooden.BlueprintShelfBlock;
import blusunrize.immersiveengineering.common.blocks.wooden.SawdustBlock;
import blusunrize.immersiveengineering.common.blocks.wooden.TreatedWoodStyles;
import blusunrize.immersiveengineering.common.register.IEBlocks.*;
Expand Down Expand Up @@ -49,11 +50,8 @@
import net.minecraft.world.level.block.state.properties.Property;
import net.minecraft.world.level.material.Fluid;
import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions;
import net.neoforged.neoforge.client.model.generators.BlockModelBuilder;
import net.neoforged.neoforge.client.model.generators.ConfiguredModel;
import net.neoforged.neoforge.client.model.generators.ModelFile;
import net.neoforged.neoforge.client.model.generators.*;
import net.neoforged.neoforge.client.model.generators.ModelFile.ExistingModelFile;
import net.neoforged.neoforge.client.model.generators.VariantBlockStateBuilder;
import net.neoforged.neoforge.client.model.generators.loaders.CompositeModelBuilder;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import org.apache.commons.lang3.mutable.Mutable;
Expand Down Expand Up @@ -362,6 +360,33 @@ protected void registerStatesAndModels()
simpleBlock(StoneDecoration.CONCRETE_SPRAYED.get(), obj("block/sprayed_concrete.obj", cutout()));

createHorizontalRotatedBlock(WoodenDevices.CRAFTING_TABLE, obj("block/wooden_device/craftingtable.obj"));
{
MultiPartBlockStateBuilder multipartBuilder = getMultipartBuilder(WoodenDevices.BLUEPRINT_SHELF.get());
for(Direction d : Direction.values())
{
int rotX = d.getAxis()==Axis.Y?-90: 0;
int rotY = d.getAxis()==Axis.Y?0: getAngle(d, 180);
// add the frame
multipartBuilder.part()
.modelFile(models().getExistingFile(modLoc("block/blueprint_shelf/frame")))
.rotationX(rotX)
.rotationY(rotY)
.addModel()
.condition(IEProperties.FACING_ALL, d)
.end();
// add the blueprints
for(int i = 0; i < BlueprintShelfBlock.BLUEPRINT_SLOT_FILLED.length; i++)
multipartBuilder.part()
.modelFile(models().getExistingFile(modLoc("block/blueprint_shelf/blueprint_"+i)))
.rotationX(rotX)
.rotationY(rotY)
.addModel()
.condition(IEProperties.FACING_ALL, d)
.condition(BlueprintShelfBlock.BLUEPRINT_SLOT_FILLED[i], true)
.end();
}
itemModel(WoodenDevices.BLUEPRINT_SHELF, models().getExistingFile(modLoc("block/blueprint_shelf/frame")));
}
cubeAll(WoodenDevices.CRATE, modLoc("block/wooden_device/crate"));
cubeAll(WoodenDevices.REINFORCED_CRATE, modLoc("block/wooden_device/reinforced_crate"));
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ private void registerAxeMineable()
tag,
WoodenDevices.CRAFTING_TABLE,
WoodenDevices.WORKBENCH,
WoodenDevices.BLUEPRINT_SHELF,
WoodenDevices.CIRCUIT_TABLE,
WoodenDevices.GUNPOWDER_BARREL,
WoodenDevices.WOODEN_BARREL,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d7460b2

Please sign in to comment.