From 976be3470fd48b51ce44fdd92f969c6ab69ef86c Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 10 Apr 2021 18:23:42 +0200 Subject: [PATCH] Better address these, Part II - Fixed entities attempting to path-find through Creates' non-solids #1390 - Fixed Redstone Links occasionally wiping their frequency when moved in a Contraption - Fixed Flywheels doubling their SU capacity after every chunk reload - Fixed display of numeric formats using non-breaking space #1374 - Signs can now be moved on a contraption #1315 - Fixed Typo in german localization #1363 - Fixed Windmill Bearings keeping su information after relocation #1364 - Fixed Symmetry Wand using up too many items #1342 --- gradle.properties | 2 +- src/generated/resources/.cache/cache | 4 +- .../assets/create/lang/unfinished/de_de.json | 2 +- .../data/create/advancements/aesthetics.json | 4 +- .../java/com/simibubi/create/AllBlocks.java | 26 ++++--- .../com/simibubi/create/AllTileEntities.java | 3 +- src/main/java/com/simibubi/create/Create.java | 2 +- .../contraptions/base/KineticBlock.java | 2 - .../components/actors/AttachedActorBlock.java | 6 ++ .../components/actors/DrillBlock.java | 6 ++ .../components/actors/HarvesterBlock.java | 1 + .../components/actors/SeatBlock.java | 6 ++ .../components/clock/CuckooClockBlock.java | 6 ++ .../components/crank/HandCrankBlock.java | 6 ++ .../components/crank/ValveHandleBlock.java | 3 +- .../crusher/CrushingWheelControllerBlock.java | 6 ++ .../components/deployer/DeployerBlock.java | 6 ++ .../components/fan/EncasedFanTileEntity.java | 2 +- .../components/fan/NozzleBlock.java | 6 ++ .../flywheel/FlywheelTileEntity.java | 2 +- .../components/millstone/MillstoneBlock.java | 6 ++ .../mixer/MechanicalMixerBlock.java | 6 ++ .../components/motor/CreativeMotorBlock.java | 7 ++ .../press/MechanicalPressBlock.java | 6 ++ .../contraptions/components/saw/SawBlock.java | 6 ++ .../BlockMovementTraits.java | 9 +++ .../bearing/MechanicalBearingTileEntity.java | 5 ++ .../structureMovement/bearing/SailBlock.java | 6 ++ .../bearing/WindmillBearingTileEntity.java | 5 +- .../mounted/CartAssemblerBlock.java | 61 ++------------- .../piston/MechanicalPistonHeadBlock.java | 6 ++ .../piston/PistonExtensionPoleBlock.java | 6 ++ .../structureMovement/pulley/PulleyBlock.java | 6 ++ .../components/turntable/TurntableBlock.java | 6 ++ .../contraptions/fluids/PumpBlock.java | 6 ++ .../fluids/actors/ItemDrainBlock.java | 6 ++ .../fluids/actors/SpoutBlock.java | 6 ++ .../fluids/pipes/FluidPipeBlock.java | 7 ++ .../fluids/pipes/FluidValveBlock.java | 6 ++ .../fluids/pipes/GlassFluidPipeBlock.java | 7 ++ .../fluids/pipes/SmartFluidPipeBlock.java | 6 ++ .../goggles/GoggleOverlayRenderer.java | 1 - .../goggles/IHaveGoggleInformation.java | 2 +- .../contraptions/processing/BasinBlock.java | 6 ++ .../processing/burner/BlazeBurnerBlock.java | 7 ++ .../burner/LitBlazeBurnerBlock.java | 6 ++ .../relays/advanced/GantryShaftBlock.java | 6 ++ .../contraptions/relays/belt/BeltBlock.java | 6 ++ .../relays/elementary/AbstractShaftBlock.java | 14 +++- .../contraptions/relays/gauge/GaugeBlock.java | 74 +++++++++++-------- .../symmetry/SymmetryWandItem.java | 16 ++-- .../logistics/block/chute/ChuteBlock.java | 6 ++ .../logistics/block/depot/DepotBlock.java | 6 ++ .../logistics/block/depot/EjectorBlock.java | 6 ++ .../block/funnel/AbstractFunnelBlock.java | 6 ++ .../block/inventories/CrateBlock.java | 6 ++ .../block/redstone/AnalogLeverBlock.java | 6 ++ .../block/redstone/NixieTubeBlock.java | 6 ++ .../block/redstone/RedstoneLinkBlock.java | 10 ++- .../schematics/block/SchematicTableBlock.java | 6 ++ .../foundation/ponder/PonderRegistry.java | 9 ++- .../foundation/ponder/content/BeltScenes.java | 1 + .../ponder/content/KineticsScenes.java | 2 +- src/main/resources/META-INF/mods.toml | 2 +- .../resources/assets/create/lang/de_de.json | 2 +- 65 files changed, 367 insertions(+), 131 deletions(-) diff --git a/gradle.properties b/gradle.properties index b3f9ce737..cb210473c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false # mod version info -mod_version=0.3.1a +mod_version=0.3.1b minecraft_version=1.16.5 forge_version=36.0.42 diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 037185b3f..511caf924 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -408,7 +408,7 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json 768a724d6c921cb92790364cf7a692fe8742a885 assets/create/lang/en_ud.json 3060ba1eee371d642e0590c3d6e99c2be397c7f5 assets/create/lang/en_us.json -e30cf096df194568cec732e36dea067efa28468a assets/create/lang/unfinished/de_de.json +e3b0bc11cc7b208d248ad339caeebf91aa51a5ef assets/create/lang/unfinished/de_de.json 3b3e7b694b75ab50acfe911935f80da0b3234010 assets/create/lang/unfinished/es_es.json 20d7a808b485b9140bce1c4c483c7fc2218a0611 assets/create/lang/unfinished/es_mx.json 1e9f530d590556eac0c4d08750d3ebbd83b504f2 assets/create/lang/unfinished/fr_fr.json @@ -1649,7 +1649,7 @@ d080b1b25e5bc8baf5aee68691b08c7f12ece3b0 assets/create/models/item/windmill_bear a80fb25a0b655e76be986b5b49fcb0f03461a1ab assets/create/models/item/zinc_nugget.json b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json e76041b7ae829fdd7dc0524f6ca4d2f89fca51bb assets/create/sounds.json -0f1b4b980afba9bf2caf583b88e261bba8b10313 data/create/advancements/aesthetics.json +5d0cc4c0255dc241e61c173b31ddca70c88d08e4 data/create/advancements/aesthetics.json 187921fa131b06721bfaf63f2623a28c141aae9a data/create/advancements/andesite_alloy.json 0ea2db7173b5be28b289ea7c9a6a0cf5805c60c7 data/create/advancements/andesite_casing.json 83c046bd200623933545c9e4326f782fb02c87fa data/create/advancements/arm_blaze_burner.json diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index a8e495da1..5ae626464 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -57,7 +57,7 @@ "block.create.clutch": "Kupplung", "block.create.cogwheel": "Zahnrad", "block.create.content_observer": "Inhaltsbeobachter", - "block.create.controller_rail": "Steureungsschiene", + "block.create.controller_rail": "Steuerungsschiene", "block.create.copper_block": "Kupfer Block", "block.create.copper_casing": "Kupferrahmen", "block.create.copper_ore": "Kupfererz", diff --git a/src/generated/resources/data/create/advancements/aesthetics.json b/src/generated/resources/data/create/advancements/aesthetics.json index d723cbe38..59a86f429 100644 --- a/src/generated/resources/data/create/advancements/aesthetics.json +++ b/src/generated/resources/data/create/advancements/aesthetics.json @@ -28,8 +28,8 @@ "trigger": "create:bracket_apply", "conditions": { "accepted_entries": [ - "create:cogwheel", - "create:large_cogwheel" + "create:large_cogwheel", + "create:cogwheel" ] } }, diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 62fec60ab..e5de33659 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -9,6 +9,8 @@ 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; @@ -600,22 +602,22 @@ public class AllBlocks { .transform(BuilderTransformers.valveHandle(null)) .register(); - public static final BlockEntry[] DYED_VALVE_HANDLES = new BlockEntry[DyeColor.values().length]; + public static final Vector> DYED_VALVE_HANDLES = + new Vector<>(DyeColor.values().length); static { for (DyeColor colour : DyeColor.values()) { String colourName = colour.getString(); - DYED_VALVE_HANDLES[colour.ordinal()] = - REGISTRATE.block(colourName + "_valve_handle", ValveHandleBlock::dyed) - .transform(BuilderTransformers.valveHandle(colour)) - .recipe((c, p) -> ShapedRecipeBuilder.shapedRecipe(c.get()) - .patternLine("#") - .patternLine("-") - .key('#', DyeHelper.getTagOfDye(colour)) - .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(); + DYED_VALVE_HANDLES.add(REGISTRATE.block(colourName + "_valve_handle", ValveHandleBlock::dyed) + .transform(BuilderTransformers.valveHandle(colour)) + .recipe((c, p) -> ShapedRecipeBuilder.shapedRecipe(c.get()) + .patternLine("#") + .patternLine("-") + .key('#', DyeHelper.getTagOfDye(colour)) + .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()); } } diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index be2086c82..33476b929 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -154,6 +154,7 @@ 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 { @@ -245,7 +246,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) + .validBlocks(AllBlocks.DYED_VALVE_HANDLES.toArray(new BlockEntry[AllBlocks.DYED_VALVE_HANDLES.size()])) .renderer(() -> HandCrankRenderer::new) .register(); diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index 213768e90..8d7e91f5f 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -55,7 +55,7 @@ public class Create { public static final String ID = "create"; public static final String NAME = "Create"; - public static final String VERSION = "0.3.1a"; + public static final String VERSION = "0.3.1b"; public static Logger logger = LogManager.getLogger(); public static ItemGroup baseCreativeTab = new CreateItemGroup(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticBlock.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticBlock.java index 8b28d9cce..864737fae 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticBlock.java @@ -1,7 +1,6 @@ package com.simibubi.create.content.contraptions.base; import com.simibubi.create.foundation.item.ItemDescription.Palette; -import com.simibubi.create.foundation.utility.Debug; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -11,7 +10,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.StringTextComponent; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.IWorldReader; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/AttachedActorBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/AttachedActorBlock.java index d9200bca5..c9ea4bac8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/AttachedActorBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/AttachedActorBlock.java @@ -12,6 +12,7 @@ import net.minecraft.block.BlockState; import net.minecraft.block.HorizontalBlock; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemUseContext; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.StateContainer.Builder; import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; @@ -69,4 +70,9 @@ public abstract class AttachedActorBlock extends HorizontalBlock implements IWre return getDefaultState().with(HORIZONTAL_FACING, facing); } + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillBlock.java index ced7a4f2f..b7c9d029a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillBlock.java @@ -13,6 +13,7 @@ import net.minecraft.block.BlockState; import net.minecraft.block.material.PushReaction; import net.minecraft.entity.Entity; import net.minecraft.entity.item.ItemEntity; +import net.minecraft.pathfinding.PathType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; import net.minecraft.util.Direction; @@ -88,6 +89,11 @@ public class DrillBlock extends DirectionalKineticBlock implements ITE getTileEntityClass() { return DrillTileEntity.class; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } public static double getDamage(float speed) { float speedAbs = Math.abs(speed); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterBlock.java index 68a6b5ad8..8f6182917 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterBlock.java @@ -21,4 +21,5 @@ public class HarvesterBlock extends AttachedActorBlock { public TileEntity createTileEntity(BlockState state, IBlockReader world) { return new HarvesterTileEntity(AllTileEntities.HARVESTER.get()); } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/SeatBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/SeatBlock.java index 2219e390b..3cccce364 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/SeatBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/SeatBlock.java @@ -21,6 +21,7 @@ import net.minecraft.item.DyeColor; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.pathfinding.PathNodeType; +import net.minecraft.pathfinding.PathType; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.util.NonNullList; @@ -143,4 +144,9 @@ public class SeatBlock extends Block { entity.startRiding(seat, true); } + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockBlock.java index 960b20d2a..3b179fc49 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockBlock.java @@ -9,6 +9,7 @@ import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; +import net.minecraft.pathfinding.PathType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; @@ -75,5 +76,10 @@ public class CuckooClockBlock extends HorizontalKineticBlock { public Axis getRotationAxis(BlockState state) { return state.get(HORIZONTAL_FACING).getAxis(); } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java index 511be5565..459842898 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java @@ -12,6 +12,7 @@ import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItemUseContext; +import net.minecraft.pathfinding.PathType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; @@ -116,5 +117,10 @@ public class HandCrankBlock extends DirectionalKineticBlock implements ITE getTileEntityClass() { return HandCrankTileEntity.class; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } 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 e622237db..bca18a69a 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,8 @@ public class ValveHandleBlock extends HandCrankBlock { if (worldIn.isRemote) return ActionResultType.SUCCESS; - BlockState newState = AllBlocks.DYED_VALVE_HANDLES[color.ordinal()].getDefaultState() + BlockState newState = AllBlocks.DYED_VALVE_HANDLES.get(color.ordinal()) + .getDefaultState() .with(FACING, state.get(FACING)); if (newState != state) worldIn.setBlockState(pos, newState); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerBlock.java index 0b931c8f5..e1175feba 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerBlock.java @@ -20,6 +20,7 @@ import net.minecraft.item.BlockItemUseContext; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.NBTUtil; import net.minecraft.particles.ParticleTypes; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; @@ -201,5 +202,10 @@ public class CrushingWheelControllerBlock extends DirectionalBlock public Class getTileEntityClass() { return CrushingWheelControllerTileEntity.class; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerBlock.java index f7d42fdef..43d4d656b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerBlock.java @@ -17,6 +17,7 @@ import net.minecraft.block.material.PushReaction; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; +import net.minecraft.pathfinding.PathType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; @@ -120,5 +121,10 @@ public class DeployerBlock extends DirectionalAxisKineticBlock implements ITE getTileEntityClass() { return MillstoneTileEntity.class; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerBlock.java index 93214c68e..1d20436b9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerBlock.java @@ -9,6 +9,7 @@ import com.simibubi.create.foundation.block.ITE; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.pathfinding.PathType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; @@ -71,5 +72,10 @@ public class MechanicalMixerBlock extends KineticBlock implements ITE getTileEntityClass() { return MechanicalMixerTileEntity.class; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/motor/CreativeMotorBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/motor/CreativeMotorBlock.java index f150e692a..7239a505e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/motor/CreativeMotorBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/motor/CreativeMotorBlock.java @@ -6,6 +6,7 @@ import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; +import net.minecraft.pathfinding.PathType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; @@ -57,4 +58,10 @@ public class CreativeMotorBlock extends DirectionalKineticBlock { public boolean hideStressImpact() { return true; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressBlock.java index 25eb3eb20..8de328a78 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressBlock.java @@ -9,6 +9,7 @@ import com.simibubi.create.foundation.block.ITE; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItemUseContext; +import net.minecraft.pathfinding.PathType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; @@ -65,5 +66,10 @@ public class MechanicalPressBlock extends HorizontalKineticBlock implements ITE< public Class getTileEntityClass() { return MechanicalPressTileEntity.class; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawBlock.java index d35b6e79b..a4458acd7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawBlock.java @@ -17,6 +17,7 @@ import net.minecraft.block.material.PushReaction; import net.minecraft.entity.Entity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.item.BlockItemUseContext; +import net.minecraft.pathfinding.PathType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; import net.minecraft.util.Direction; @@ -120,5 +121,10 @@ public class SawBlock extends DirectionalAxisKineticBlock implements ITE getTileEntityClass() { return SawTileEntity.class; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java index 3b1af157c..9edac0058 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java @@ -26,6 +26,7 @@ import com.simibubi.create.content.logistics.block.redstone.RedstoneLinkBlock; import net.minecraft.block.AbstractPressurePlateBlock; import net.minecraft.block.AbstractRailBlock; +import net.minecraft.block.AbstractSignBlock; import net.minecraft.block.BellBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -40,7 +41,9 @@ import net.minecraft.block.LadderBlock; import net.minecraft.block.RedstoneDiodeBlock; import net.minecraft.block.RedstoneWallTorchBlock; import net.minecraft.block.RedstoneWireBlock; +import net.minecraft.block.StandingSignBlock; import net.minecraft.block.TorchBlock; +import net.minecraft.block.WallSignBlock; import net.minecraft.block.WallTorchBlock; import net.minecraft.block.material.PushReaction; import net.minecraft.state.properties.AttachFace; @@ -116,6 +119,8 @@ public class BlockMovementTraits { return true; if (block instanceof TorchBlock) return true; + if (block instanceof AbstractSignBlock) + return true; if (block instanceof AbstractPressurePlateBlock) return true; if (block instanceof HorizontalFaceBlock && !(block instanceof GrindstoneBlock)) @@ -143,6 +148,10 @@ public class BlockMovementTraits { return state.get(LadderBlock.FACING) == direction.getOpposite(); if (block instanceof WallTorchBlock) return state.get(WallTorchBlock.HORIZONTAL_FACING) == direction.getOpposite(); + if (block instanceof WallSignBlock) + return state.get(WallSignBlock.FACING) == direction.getOpposite(); + if (block instanceof StandingSignBlock) + return direction == Direction.DOWN; if (block instanceof AbstractPressurePlateBlock) return direction == Direction.DOWN; if (block instanceof DoorBlock) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java index 9e9d0ff1b..239880bc0 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java @@ -75,6 +75,11 @@ public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity @Override protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + if (wasMoved) { + super.fromTag(state, compound, clientPacket); + return; + } + float angleBefore = angle; running = compound.getBoolean("Running"); angle = compound.getFloat("Angle"); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/SailBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/SailBlock.java index ddc70ae1c..73e80c2e3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/SailBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/SailBlock.java @@ -28,6 +28,7 @@ import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.DyeColor; import net.minecraft.item.ItemStack; import net.minecraft.item.ShearsItem; +import net.minecraft.pathfinding.PathType; import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Hand; @@ -195,6 +196,11 @@ public class SailBlock extends ProperDirectionalBlock { } } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } @MethodsReturnNonnullByDefault private static class PlacementHelper implements IPlacementHelper { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/WindmillBearingTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/WindmillBearingTileEntity.java index 38ecf2346..ccd717284 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/WindmillBearingTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/WindmillBearingTileEntity.java @@ -27,7 +27,7 @@ public class WindmillBearingTileEntity extends MechanicalBearingTileEntity { super.updateGeneratedRotation(); lastGeneratedSpeed = getGeneratedSpeed(); } - + @Override public void onSpeedChanged(float prevSpeed) { boolean cancelAssembly = assembleNextTick; @@ -63,7 +63,8 @@ public class WindmillBearingTileEntity extends MechanicalBearingTileEntity { @Override protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { - lastGeneratedSpeed = compound.getFloat("LastGenerated"); + if (!wasMoved) + lastGeneratedSpeed = compound.getFloat("LastGenerated"); super.fromTag(state, compound, clientPacket); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerBlock.java index 2c0cdaf93..09c2653a2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerBlock.java @@ -42,6 +42,7 @@ import net.minecraft.item.ItemUseContext; import net.minecraft.loot.LootContext; import net.minecraft.loot.LootParameters; import net.minecraft.nbt.CompoundNBT; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.BooleanProperty; import net.minecraft.state.EnumProperty; import net.minecraft.state.Property; @@ -137,54 +138,6 @@ public class CartAssemblerBlock extends AbstractRailBlock return; withTileEntityDo(world, pos, te -> { - /* - } -<<<<<<< HEAD - if (te.isMinecartUpdateValid()) { - switch (state.get(RAIL_TYPE)) { - case POWERED_RAIL: - if (state.get(POWERED)) { - assemble(world, pos, cart); - Direction facing = cart.getAdjustedHorizontalFacing(); - float speed = getRailMaxSpeed(state, world, pos, cart); - cart.setMotion(facing.getXOffset() * speed, facing.getYOffset() * speed, - facing.getZOffset() * speed); - } else { - disassemble(world, pos, cart); - Vector3d diff = VecHelper.getCenterOf(pos) - .subtract(cart.getPositionVec()); - cart.setMotion(diff.x / 16f, 0, diff.z / 16f); - } - break; - case REGULAR: - if (state.get(POWERED)) { - assemble(world, pos, cart); - } else { - disassemble(world, pos, cart); - } - break; - case ACTIVATOR_RAIL: - if (state.get(POWERED)) { - disassemble(world, pos, cart); - } - break; - case DETECTOR_RAIL: - if (cart.getPassengers() - .isEmpty()) { - assemble(world, pos, cart); - Direction facing = cart.getAdjustedHorizontalFacing(); - float speed = getRailMaxSpeed(state, world, pos, cart); - cart.setMotion(facing.getXOffset() * speed, facing.getYOffset() * speed, - facing.getZOffset() * speed); - } else { - disassemble(world, pos, cart); - } - break; - default: - break; - } - te.resetTicksSinceMinecartUpdate(); -=======*/ if (!te.isMinecartUpdateValid()) return; @@ -458,13 +411,6 @@ public class CartAssemblerBlock extends AbstractRailBlock return PushReaction.BLOCK; } - /* FIXME: Is there a 1.16 equivalent to be used? Or is this just removed? - @Override - public boolean isNormalCube(@Nonnull BlockState state, @Nonnull IBlockReader worldIn, @Nonnull BlockPos pos) { - return false; - } - */ - @Override public Class getTileEntityClass() { return CartAssemblerTileEntity.class; @@ -542,6 +488,11 @@ public class CartAssemblerBlock extends AbstractRailBlock } } + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } + @Override public ActionResultType onWrenched(BlockState state, ItemUseContext context) { World world = context.getWorld(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonHeadBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonHeadBlock.java index 6d3b1d754..fe9c50d8a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonHeadBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonHeadBlock.java @@ -16,6 +16,7 @@ import net.minecraft.fluid.FluidState; import net.minecraft.fluid.Fluids; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.EnumProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; @@ -111,4 +112,9 @@ public class MechanicalPistonHeadBlock extends ProperDirectionalBlock implements FluidState FluidState = context.getWorld().getFluidState(context.getPos()); return super.getStateForPlacement(context).with(BlockStateProperties.WATERLOGGED, Boolean.valueOf(FluidState.getFluid() == Fluids.WATER)); } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonExtensionPoleBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonExtensionPoleBlock.java index 06e2f6137..decf128f9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonExtensionPoleBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonExtensionPoleBlock.java @@ -26,6 +26,7 @@ import net.minecraft.fluid.Fluids; import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.ActionResultType; @@ -146,6 +147,11 @@ public class PistonExtensionPoleBlock extends ProperDirectionalBlock implements } return state; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } @MethodsReturnNonnullByDefault public static class PlacementHelper extends PoleHelper { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java index 0152848b4..2aa7b6d13 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java @@ -15,6 +15,7 @@ import net.minecraft.fluid.FluidState; import net.minecraft.fluid.Fluids; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.EnumProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; @@ -97,6 +98,11 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements ITE getTileEntityClass() { return TurntableTileEntity.class; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpBlock.java index e01220fb0..6dd88516a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpBlock.java @@ -17,6 +17,7 @@ import net.minecraft.fluid.Fluids; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemUseContext; import net.minecraft.network.DebugPacketSender; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; @@ -173,4 +174,9 @@ public class PumpBlock extends DirectionalKineticBlock implements IWaterLoggable world.removeTileEntity(pos); } + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/ItemDrainBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/ItemDrainBlock.java index 389d49fca..b91ade7c4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/ItemDrainBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/ItemDrainBlock.java @@ -13,6 +13,7 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.ItemStack; +import net.minecraft.pathfinding.PathType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; @@ -109,5 +110,10 @@ public class ItemDrainBlock extends Block implements IWrenchable, ITE tooltip, boolean isPlayerSneaking, LazyOptional handler) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java index efe51f549..3b42e8a32 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java @@ -23,6 +23,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; import net.minecraft.item.Items; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.DirectionProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; @@ -217,4 +218,9 @@ public class BasinBlock extends Block implements ITE, IWrenchab return false; } + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerBlock.java index 7d18a7709..ddd630313 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerBlock.java @@ -29,6 +29,7 @@ import net.minecraft.loot.LootPool; import net.minecraft.loot.LootTable; import net.minecraft.loot.conditions.BlockStateProperty; import net.minecraft.loot.conditions.ILootCondition.IBuilder; +import net.minecraft.pathfinding.PathType; import net.minecraft.loot.conditions.SurvivesExplosion; import net.minecraft.state.EnumProperty; import net.minecraft.state.Property; @@ -255,4 +256,10 @@ public class BlazeBurnerBlock extends Block implements ITE= heatLevel.ordinal(); } } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/LitBlazeBurnerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/LitBlazeBurnerBlock.java index ee1e315ef..cfe315f79 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/LitBlazeBurnerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/LitBlazeBurnerBlock.java @@ -11,6 +11,7 @@ import net.minecraft.block.Blocks; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.particles.ParticleTypes; +import net.minecraft.pathfinding.PathType; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.util.SoundCategory; @@ -114,5 +115,10 @@ public class LitBlazeBurnerBlock extends Block { return AllBlocks.BLAZE_BURNER.get() .getCollisionShape(state, reader, pos, context); } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/GantryShaftBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/GantryShaftBlock.java index 41a62efb3..9592b9d02 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/GantryShaftBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/GantryShaftBlock.java @@ -24,6 +24,7 @@ import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.BooleanProperty; import net.minecraft.state.EnumProperty; import net.minecraft.state.Property; @@ -269,6 +270,11 @@ public class GantryShaftBlock extends DirectionalKineticBlock { public float getParticleInitialRadius() { return .25f; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } public static class PlacementHelper extends PoleHelper { diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java index fca461c3c..35a1844b1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java @@ -38,6 +38,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; import net.minecraft.loot.LootParameters; import net.minecraft.pathfinding.PathNodeType; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.BooleanProperty; import net.minecraft.state.EnumProperty; import net.minecraft.state.Property; @@ -597,5 +598,10 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE Block.spawnAsEntity(world, pos, stack)); super.onReplaced(state, world, pos, newState, isMoving); } - + // IRotate: @Override @@ -112,4 +114,10 @@ public abstract class AbstractShaftBlock extends RotatedPillarKineticBlock imple return Optional.empty(); return Optional.of(new ItemStack(bracket.getBlock())); } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeBlock.java index 1e39fa783..7278da542 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeBlock.java @@ -15,6 +15,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.particles.RedstoneParticleData; +import net.minecraft.pathfinding.PathType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; @@ -45,11 +46,11 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { public static GaugeBlock speed(Properties properties) { return new GaugeBlock(properties, Type.SPEED); } - + public static GaugeBlock stress(Properties properties) { return new GaugeBlock(properties, Type.STRESS); } - + protected GaugeBlock(Properties properties, Type type) { super(properties); this.type = type; @@ -67,18 +68,24 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { } } - /* FIXME: Is there a new way of doing this in 1.16? Or cn we just delete it? - @SuppressWarnings("deprecation") - @Override - public MaterialColor getMaterialColor(BlockState state, IBlockReader worldIn, BlockPos pos) { - return Blocks.SPRUCE_PLANKS.getMaterialColor(state, worldIn, pos); - } */ + /* + * FIXME: Is there a new way of doing this in 1.16? Or cn we just delete it? + * + * @SuppressWarnings("deprecation") + * + * @Override + * public MaterialColor getMaterialColor(BlockState state, IBlockReader worldIn, BlockPos pos) { + * return Blocks.SPRUCE_PLANKS.getMaterialColor(state, worldIn, pos); + * } + */ @Override public BlockState getStateForPlacement(BlockItemUseContext context) { World world = context.getWorld(); Direction face = context.getFace(); - BlockPos placedOnPos = context.getPos().offset(context.getFace().getOpposite()); + BlockPos placedOnPos = context.getPos() + .offset(context.getFace() + .getOpposite()); BlockState placedOnState = world.getBlockState(placedOnPos); Block block = placedOnState.getBlock(); @@ -88,17 +95,14 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { Direction nearestLookingDirection = context.getNearestLookingDirection(); boolean lookPositive = nearestLookingDirection.getAxisDirection() == AxisDirection.POSITIVE; if (face.getAxis() == Axis.X) { - toPlace = toPlace - .with(FACING, lookPositive ? Direction.NORTH : Direction.SOUTH) - .with(AXIS_ALONG_FIRST_COORDINATE, true); + toPlace = toPlace.with(FACING, lookPositive ? Direction.NORTH : Direction.SOUTH) + .with(AXIS_ALONG_FIRST_COORDINATE, true); } else if (face.getAxis() == Axis.Y) { - toPlace = toPlace - .with(FACING, horizontalFacing.getOpposite()) - .with(AXIS_ALONG_FIRST_COORDINATE, horizontalFacing.getAxis() == Axis.X); + toPlace = toPlace.with(FACING, horizontalFacing.getOpposite()) + .with(AXIS_ALONG_FIRST_COORDINATE, horizontalFacing.getAxis() == Axis.X); } else { - toPlace = toPlace - .with(FACING, lookPositive ? Direction.WEST : Direction.EAST) - .with(AXIS_ALONG_FIRST_COORDINATE, false); + toPlace = toPlace.with(FACING, lookPositive ? Direction.WEST : Direction.EAST) + .with(AXIS_ALONG_FIRST_COORDINATE, false); } return toPlace; @@ -114,20 +118,22 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { @Override protected boolean getAxisAlignmentForPlacement(BlockItemUseContext context) { - return context.getPlacementHorizontalFacing().getAxis() != Axis.X; + return context.getPlacementHorizontalFacing() + .getAxis() != Axis.X; } public boolean shouldRenderHeadOnFace(World world, BlockPos pos, BlockState state, Direction face) { - if (face.getAxis().isVertical()) + if (face.getAxis() + .isVertical()) return false; - if (face == state.get(FACING).getOpposite()) + if (face == state.get(FACING) + .getOpposite()) return false; if (face.getAxis() == getRotationAxis(state)) return false; if (getRotationAxis(state) == Axis.Y && face != state.get(FACING)) return false; - if (!Block.shouldSideBeRendered(state, world, pos, face) - && !(world instanceof WrappedWorld)) + if (!Block.shouldSideBeRendered(state, world, pos, face) && !(world instanceof WrappedWorld)) return false; return true; } @@ -156,15 +162,15 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { continue; for (int i = 0; i < particleCount; i++) { - Vector3d mul = VecHelper - .offsetRandomly(Vector3d.ZERO, rand, .25f) - .mul(new Vector3d(1, 1, 1).subtract(positiveFaceVec)) - .normalize() - .scale(.3f); - Vector3d offset = VecHelper.getCenterOf(pos).add(faceVec.scale(.55)).add(mul); - worldIn - .addParticle(new RedstoneParticleData((float) rgb.x, (float) rgb.y, (float) rgb.z, 1), offset.x, - offset.y, offset.z, mul.x, mul.y, mul.z); + Vector3d mul = VecHelper.offsetRandomly(Vector3d.ZERO, rand, .25f) + .mul(new Vector3d(1, 1, 1).subtract(positiveFaceVec)) + .normalize() + .scale(.3f); + Vector3d offset = VecHelper.getCenterOf(pos) + .add(faceVec.scale(.55)) + .add(mul); + worldIn.addParticle(new RedstoneParticleData((float) rgb.x, (float) rgb.y, (float) rgb.z, 1), offset.x, + offset.y, offset.z, mul.x, mul.y, mul.z); } } @@ -191,4 +197,8 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { return 0; } + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java index acd103510..fb23177aa 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java @@ -20,6 +20,7 @@ import com.simibubi.create.foundation.utility.Iterate; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.block.material.Material; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.FluidState; import net.minecraft.item.BlockItem; @@ -172,8 +173,8 @@ public class SymmetryWandItem extends Item { public static boolean isEnabled(ItemStack stack) { checkNBT(stack); - return stack.getTag() - .getBoolean(ENABLE); + CompoundNBT tag = stack.getTag(); + return tag.getBoolean(ENABLE) && !tag.getBoolean("Simulate"); } public static SymmetryMirror getMirror(ItemStack stack) { @@ -235,11 +236,16 @@ public class SymmetryWandItem extends Item { FluidState ifluidstate = world.getFluidState(position); world.setBlockState(position, ifluidstate.getBlockState(), BlockFlags.UPDATE_NEIGHBORS); world.setBlockState(position, blockState); - if (ForgeEventFactory.onBlockPlace(player, blocksnapshot, Direction.UP)) { + + CompoundNBT wandNbt = wand.getOrCreateTag(); + wandNbt.putBoolean("Simulate", true); + boolean placeInterrupted = ForgeEventFactory.onBlockPlace(player, blocksnapshot, Direction.UP); + wandNbt.putBoolean("Simulate", false); + + if (placeInterrupted) { blocksnapshot.restore(true, false); continue; } - targets.add(position); } } @@ -286,7 +292,7 @@ public class SymmetryWandItem extends Item { continue; BlockState blockstate = world.getBlockState(position); - if (!blockstate.isAir(world, position)) { + if (blockstate.getMaterial() != Material.AIR) { targets.add(position); world.playEvent(2001, position, Block.getStateId(blockstate)); world.setBlockState(position, air, 3); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteBlock.java index e7ded87ac..9926f4ba4 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteBlock.java @@ -12,6 +12,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemUseContext; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.DirectionProperty; import net.minecraft.state.EnumProperty; import net.minecraft.state.Property; @@ -145,5 +146,10 @@ public class ChuteBlock extends AbstractChuteBlock { return state.with(SHAPE, Shape.NORMAL); return state.with(SHAPE, Shape.INTERSECTION); } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotBlock.java index 6b341c902..b9852efb9 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotBlock.java @@ -12,6 +12,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.pathfinding.PathType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; @@ -77,5 +78,10 @@ public class DepotBlock extends Block implements ITE, IWrenchab public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) { return SharedDepotBlockMethods.getComparatorInputOverride(blockState, worldIn, pos); } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/depot/EjectorBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/depot/EjectorBlock.java index 8447b25a8..fcdc894a7 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/depot/EjectorBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/depot/EjectorBlock.java @@ -17,6 +17,7 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.pathfinding.PathType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; @@ -159,5 +160,10 @@ public class EjectorBlock extends HorizontalKineticBlock implements ITE builder) { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/inventories/CrateBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/inventories/CrateBlock.java index 175e0e80d..0cc52ac21 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/inventories/CrateBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/inventories/CrateBlock.java @@ -8,6 +8,7 @@ import com.simibubi.create.foundation.utility.Iterate; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.util.Direction; @@ -33,6 +34,11 @@ public class CrateBlock extends ProperDirectionalBlock implements IWrenchable { return AllShapes.CRATE_BLOCK_SHAPE; } + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } + @Override public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos) { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverBlock.java index 0daa7cef2..3d018cb61 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverBlock.java @@ -11,6 +11,7 @@ import net.minecraft.block.Blocks; import net.minecraft.block.HorizontalFaceBlock; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particles.RedstoneParticleData; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResultType; @@ -136,5 +137,10 @@ public class AnalogLeverBlock extends HorizontalFaceBlock implements ITE getTileEntityClass() { return AnalogLeverTileEntity.class; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/NixieTubeBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/NixieTubeBlock.java index 4cb3ea694..3aa3d7d04 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/NixieTubeBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/NixieTubeBlock.java @@ -12,6 +12,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; @@ -158,6 +159,11 @@ public class NixieTubeBlock extends HorizontalBlock implements ITE getTileEntityClass() { return RedstoneLinkTileEntity.class; diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableBlock.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableBlock.java index 15fc62543..1640a46b0 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableBlock.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableBlock.java @@ -12,6 +12,7 @@ import net.minecraft.block.material.PushReaction; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.item.BlockItemUseContext; +import net.minecraft.pathfinding.PathType; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResultType; @@ -91,5 +92,10 @@ public class SchematicTableBlock extends HorizontalBlock implements ITE getTileEntityClass() { return SchematicTableTileEntity.class; } + + @Override + public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) { + return false; + } } diff --git a/src/main/java/com/simibubi/create/foundation/ponder/PonderRegistry.java b/src/main/java/com/simibubi/create/foundation/ponder/PonderRegistry.java index f349f080b..412eb6ae8 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/PonderRegistry.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/PonderRegistry.java @@ -6,7 +6,6 @@ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -65,6 +64,10 @@ public class PonderRegistry { public static MultiSceneBuilder forComponents(ItemProviderEntry... components) { return new MultiSceneBuilder(Arrays.asList(components)); } + + public static MultiSceneBuilder forComponents(Iterable> components) { + return new MultiSceneBuilder(components); + } public static List compile(ResourceLocation id) { return compile(all.get(id)); @@ -136,9 +139,9 @@ public class PonderRegistry { public static class MultiSceneBuilder { - private final Collection> components; + private final Iterable> components; - MultiSceneBuilder(Collection> components) { + MultiSceneBuilder(Iterable> components) { this.components = components; } diff --git a/src/main/java/com/simibubi/create/foundation/ponder/content/BeltScenes.java b/src/main/java/com/simibubi/create/foundation/ponder/content/BeltScenes.java index 0a5f454b9..dbaeb1718 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/content/BeltScenes.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/content/BeltScenes.java @@ -45,6 +45,7 @@ public class BeltScenes { scene.title("belt_connector", "Using Mechanical Belts"); scene.configureBasePlate(0, 0, 5); scene.showBasePlate(); + scene.world.showSection(util.select.position(3, 0, 5), Direction.UP); scene.idle(5); scene.world.showSection(util.select.fromTo(4, 1, 3, 4, 1, 5), Direction.DOWN); 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 8177eb9b3..3bc0ccf90 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[11].getDefaultState() + scene.world.modifyBlock(util.grid.at(2, 2, 2), s -> AllBlocks.DYED_VALVE_HANDLES.get(11).getDefaultState() .with(ValveHandleBlock.FACING, Direction.UP), true); scene.idle(10); scene.overlay.showText(70) diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 5c2d1bfe9..4a93dd067 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -22,6 +22,6 @@ Technology that empowers the player.''' [[dependencies.create]] modId="minecraft" mandatory=true - versionRange="[1.16.3,1.17)" + versionRange="[1.16.4,1.17)" ordering="NONE" side="BOTH" \ No newline at end of file diff --git a/src/main/resources/assets/create/lang/de_de.json b/src/main/resources/assets/create/lang/de_de.json index 7ed344946..4b4f99959 100644 --- a/src/main/resources/assets/create/lang/de_de.json +++ b/src/main/resources/assets/create/lang/de_de.json @@ -55,7 +55,7 @@ "block.create.clutch": "Kupplung", "block.create.cogwheel": "Zahnrad", "block.create.content_observer": "Inhaltsbeobachter", - "block.create.controller_rail": "Steureungsschiene", + "block.create.controller_rail": "Steuerungsschiene", "block.create.copper_block": "Kupfer Block", "block.create.copper_casing": "Kupferrahmen", "block.create.copper_ore": "Kupfererz",