Brittle and Non-movable block tags

- added a block tag non_movable conatining blocks that should not be moved with contraptions
- added a block tag for brittle blocks breaking without support
- moved obsidian from hardcoded to non_movable block tag
- moved flower pots, doors and bells from hardcoded to brittle block tag
- registrate block tagging of brittle blocks
- made immersive engineering connectors non-movable to avoid reported weird behavior
This commit is contained in:
LordGrimmauld 2020-07-06 23:37:44 +02:00
parent a0b4b5fa93
commit 0c6bbcc5ed
7 changed files with 66 additions and 28 deletions

View File

@ -2444,6 +2444,7 @@ d3fdb8ece6cb072a93ddb64a0baad5ac952117a4 data\create\recipes\weathered_limestone
6eceb25fabbb6b389ca35de3b829ad061c9c456a data\create\recipes\weathered_limestone_pillar.json
11667414f73bc2d00bda7c5c1a7d2934bf6e9165 data\create\recipes\weathered_limestone_pillar_from_weathered_limestone_stonecutting.json
266f08e604d229a9d2b46f7272c0b06ec270bf3d data\create\recipes\zinc_block.json
87024323ea933fa10a4e7802f68ce5b9054021e6 data\create\tags\blocks\brittle.json
081f5aa35602fc27af2ca01ea9f2fd5e7eb284dc data\create\tags\items\create_ingots.json
d2dc4ff179ef7b2aa9276455c196e15d44aa95a8 data\create\tags\items\crushed_ores.json
16bcb8fcbe9170c2c11f1ca8d99d8b36cd812bbd data\forge\tags\blocks\glass\colorless.json

View File

@ -0,0 +1,17 @@
{
"replace": false,
"values": [
"create:nozzle",
"create:hand_crank",
"create:rope",
"create:pulley_magnet",
"create:furnace_engine",
"create:redstone_link",
"create:extractor",
"create:vertical_extractor",
"create:linked_extractor",
"create:vertical_linked_extractor",
"create:funnel",
"create:vertical_funnel"
]
}

View File

@ -8,6 +8,7 @@ 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 com.simibubi.create.AllTags.AllBlockTags;
import com.simibubi.create.content.AllSections;
import com.simibubi.create.content.contraptions.base.CasingBlock;
import com.simibubi.create.content.contraptions.components.actors.DrillBlock;
@ -301,6 +302,7 @@ public class AllBlocks {
public static final BlockEntry<NozzleBlock> NOZZLE = REGISTRATE.block("nozzle", NozzleBlock::new)
.initialProperties(SharedProperties::stone)
.tag(AllBlockTags.BRITTLE.tag)
.blockstate(BlockStateGen.directionalBlockProvider(true))
.addLayer(() -> RenderType::getCutoutMipped)
.item()
@ -318,6 +320,7 @@ public class AllBlocks {
.initialProperties(SharedProperties::wooden)
.blockstate(BlockStateGen.directionalBlockProvider(true))
.transform(StressConfigDefaults.setCapacity(32.0))
.tag(AllBlockTags.BRITTLE.tag)
.item()
.transform(customItemModel())
.register();
@ -482,6 +485,7 @@ public class AllBlocks {
public static final BlockEntry<PulleyBlock.RopeBlock> ROPE = REGISTRATE.block("rope", PulleyBlock.RopeBlock::new)
.initialProperties(SharedProperties.beltMaterial, MaterialColor.BROWN)
.tag(AllBlockTags.BRITTLE.tag)
.properties(p -> p.sound(SoundType.CLOTH))
.blockstate((c, p) -> p.simpleBlock(c.get(), p.models()
.getExistingFile(p.modLoc("block/rope_pulley/" + c.getName()))))
@ -490,6 +494,7 @@ public class AllBlocks {
public static final BlockEntry<PulleyBlock.MagnetBlock> PULLEY_MAGNET =
REGISTRATE.block("pulley_magnet", PulleyBlock.MagnetBlock::new)
.initialProperties(SharedProperties::stone)
.tag(AllBlockTags.BRITTLE.tag)
.blockstate((c, p) -> p.simpleBlock(c.get(), p.models()
.getExistingFile(p.modLoc("block/rope_pulley/" + c.getName()))))
.register();
@ -650,6 +655,7 @@ public class AllBlocks {
public static final BlockEntry<FurnaceEngineBlock> FURNACE_ENGINE =
REGISTRATE.block("furnace_engine", FurnaceEngineBlock::new)
.initialProperties(SharedProperties::softMetal)
.tag(AllBlockTags.BRITTLE.tag)
.blockstate(BlockStateGen.horizontalBlockProvider(true))
.transform(StressConfigDefaults.setCapacity(1024.0))
.item()
@ -682,6 +688,7 @@ public class AllBlocks {
public static final BlockEntry<RedstoneLinkBlock> REDSTONE_LINK =
REGISTRATE.block("redstone_link", RedstoneLinkBlock::new)
.initialProperties(SharedProperties::wooden)
.tag(AllBlockTags.BRITTLE.tag)
.blockstate(new RedstoneLinkGenerator()::generate)
.addLayer(() -> RenderType::getCutoutMipped)
.item()
@ -795,6 +802,7 @@ public class AllBlocks {
public static final BlockEntry<ExtractorBlock> EXTRACTOR = REGISTRATE.block("extractor", ExtractorBlock::new)
.initialProperties(SharedProperties::softMetal)
.tag(AllBlockTags.BRITTLE.tag)
.blockstate((c, p) -> p.horizontalBlock(c.get(), AssetLookup.forPowered(c, p, c.getName() + "/horizontal")))
.item()
.transform(customItemModel("_", "horizontal"))
@ -803,12 +811,14 @@ public class AllBlocks {
public static final BlockEntry<ExtractorBlock.Vertical> VERTICAL_EXTRACTOR =
REGISTRATE.block("vertical_extractor", ExtractorBlock.Vertical::new)
.initialProperties(SharedProperties::softMetal)
.tag(AllBlockTags.BRITTLE.tag)
.blockstate(new VerticalExtractorGenerator(false)::generate)
.loot((p, b) -> p.registerDropping(b, EXTRACTOR.get()))
.register();
public static final BlockEntry<LinkedExtractorBlock> LINKED_EXTRACTOR = REGISTRATE
.block("linked_extractor", LinkedExtractorBlock::new)
.tag(AllBlockTags.BRITTLE.tag)
.initialProperties(SharedProperties::softMetal)
.addLayer(() -> RenderType::getCutoutMipped)
.blockstate((c, p) -> p.horizontalBlock(c.get(), AssetLookup.forPowered(c, p, "extractor/horizontal_linked")))
@ -819,6 +829,7 @@ public class AllBlocks {
public static final BlockEntry<LinkedExtractorBlock.Vertical> VERTICAL_LINKED_EXTRACTOR =
REGISTRATE.block("vertical_linked_extractor", LinkedExtractorBlock.Vertical::new)
.initialProperties(SharedProperties::softMetal)
.tag(AllBlockTags.BRITTLE.tag)
.blockstate(new VerticalExtractorGenerator(true)::generate)
.loot((p, b) -> p.registerDropping(b, LINKED_EXTRACTOR.get()))
.addLayer(() -> RenderType::getCutoutMipped)
@ -826,6 +837,7 @@ public class AllBlocks {
public static final BlockEntry<FunnelBlock> FUNNEL = REGISTRATE.block("funnel", FunnelBlock::new)
.initialProperties(SharedProperties::softMetal)
.tag(AllBlockTags.BRITTLE.tag)
.blockstate((c, p) -> p.horizontalBlock(c.get(), state -> p.models()
.getExistingFile(p.modLoc("block/funnel/horizontal" + (state.get(FunnelBlock.BELT) ? "_belt" : "")))))
.item()
@ -835,6 +847,7 @@ public class AllBlocks {
public static final BlockEntry<FunnelBlock.Vertical> VERTICAL_FUNNEL =
REGISTRATE.block("vertical_funnel", FunnelBlock.Vertical::new)
.initialProperties(SharedProperties::softMetal)
.tag(AllBlockTags.BRITTLE.tag)
.blockstate(new VerticalFunnelGenerator()::generate)
.loot((p, b) -> p.registerDropping(b, FUNNEL.get()))
.register();

View File

@ -88,7 +88,7 @@ public class AllTags {
}
public static enum AllBlockTags {
WINDMILL_SAILS, FAN_HEATERS, WINDOWABLE,
WINDMILL_SAILS, FAN_HEATERS, WINDOWABLE, NON_MOVABLE, BRITTLE
;

View File

@ -1,6 +1,7 @@
package com.simibubi.create.content.contraptions.components.structureMovement;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllTags.AllBlockTags;
import com.simibubi.create.content.contraptions.components.actors.AttachedActorBlock;
import com.simibubi.create.content.contraptions.components.actors.HarvesterBlock;
import com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceBlock;
@ -15,8 +16,6 @@ import com.simibubi.create.content.contraptions.components.structureMovement.cha
import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.PistonState;
import com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyBlock.MagnetBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyBlock.RopeBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyTileEntity;
import com.simibubi.create.content.logistics.block.AttachedLogisticalBlock;
import com.simibubi.create.content.logistics.block.extractor.ExtractorBlock;
@ -29,7 +28,6 @@ import net.minecraft.block.AbstractRailBlock;
import net.minecraft.block.BellBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.CarpetBlock;
import net.minecraft.block.DoorBlock;
import net.minecraft.block.FenceGateBlock;
@ -73,7 +71,7 @@ public class BlockMovementTraits {
return true;
if (blockState.getBlockHardness(world, pos) == -1)
return false;
if (block == Blocks.OBSIDIAN)
if (AllBlockTags.NON_MOVABLE.tag.contains(block))
return false;
// Move controllers only when they aren't moving
@ -112,22 +110,13 @@ public class BlockMovementTraits {
Block block = state.getBlock();
if (state.has(BlockStateProperties.HANGING))
return true;
if (block instanceof HandCrankBlock)
return true;
if (block instanceof LadderBlock)
return true;
if (block instanceof ExtractorBlock)
return true;
if (block instanceof FunnelBlock)
return true;
if (block instanceof TorchBlock)
return true;
if (block instanceof FlowerPotBlock)
return true;
if (block instanceof AbstractPressurePlateBlock)
return true;
if (block instanceof DoorBlock)
return true;
if (block instanceof HorizontalFaceBlock)
return true;
if (block instanceof AbstractRailBlock)
@ -136,21 +125,9 @@ public class BlockMovementTraits {
return true;
if (block instanceof RedstoneWireBlock)
return true;
if (block instanceof RedstoneLinkBlock)
return true;
if (block instanceof RopeBlock)
return true;
if (block instanceof NozzleBlock)
return true;
if (block instanceof MagnetBlock)
return true;
if (block instanceof EngineBlock)
return true;
if (block instanceof CarpetBlock)
return true;
if (block instanceof BellBlock)
return true;
return false;
return AllBlockTags.BRITTLE.tag.contains(block);
}
/**

View File

@ -0,0 +1,11 @@
{
"replace": false,
"values": [
"#minecraft:doors",
"minecraft:flower_pot",
"minecraft:bell"
],
"optional": [
]
}

View File

@ -0,0 +1,19 @@
{
"replace": false,
"values": [
"minecraft:obsidian"
],
"optional": [
"immersiveengineering:connector_lv",
"immersiveengineering:connector_lv_relay",
"immersiveengineering:connector_mv",
"immersiveengineering:connector_mv_relay",
"immersiveengineering:connector_hv",
"immersiveengineering:connector_hv_relay",
"immersiveengineering:connector_bundled",
"immersiveengineering:connector_structural",
"immersiveengineering:connector_redstone",
"immersiveengineering:connector_probe",
"immersiveengineering:breaker_switch"
]
}