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
This commit is contained in:
simibubi 2021-04-10 18:23:42 +02:00
parent 9ee42c1824
commit 976be3470f
65 changed files with 367 additions and 131 deletions

View file

@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false org.gradle.daemon=false
# mod version info # mod version info
mod_version=0.3.1a mod_version=0.3.1b
minecraft_version=1.16.5 minecraft_version=1.16.5
forge_version=36.0.42 forge_version=36.0.42

View file

@ -408,7 +408,7 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
768a724d6c921cb92790364cf7a692fe8742a885 assets/create/lang/en_ud.json 768a724d6c921cb92790364cf7a692fe8742a885 assets/create/lang/en_ud.json
3060ba1eee371d642e0590c3d6e99c2be397c7f5 assets/create/lang/en_us.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 3b3e7b694b75ab50acfe911935f80da0b3234010 assets/create/lang/unfinished/es_es.json
20d7a808b485b9140bce1c4c483c7fc2218a0611 assets/create/lang/unfinished/es_mx.json 20d7a808b485b9140bce1c4c483c7fc2218a0611 assets/create/lang/unfinished/es_mx.json
1e9f530d590556eac0c4d08750d3ebbd83b504f2 assets/create/lang/unfinished/fr_fr.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 a80fb25a0b655e76be986b5b49fcb0f03461a1ab assets/create/models/item/zinc_nugget.json
b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json
e76041b7ae829fdd7dc0524f6ca4d2f89fca51bb assets/create/sounds.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 187921fa131b06721bfaf63f2623a28c141aae9a data/create/advancements/andesite_alloy.json
0ea2db7173b5be28b289ea7c9a6a0cf5805c60c7 data/create/advancements/andesite_casing.json 0ea2db7173b5be28b289ea7c9a6a0cf5805c60c7 data/create/advancements/andesite_casing.json
83c046bd200623933545c9e4326f782fb02c87fa data/create/advancements/arm_blaze_burner.json 83c046bd200623933545c9e4326f782fb02c87fa data/create/advancements/arm_blaze_burner.json

View file

@ -57,7 +57,7 @@
"block.create.clutch": "Kupplung", "block.create.clutch": "Kupplung",
"block.create.cogwheel": "Zahnrad", "block.create.cogwheel": "Zahnrad",
"block.create.content_observer": "Inhaltsbeobachter", "block.create.content_observer": "Inhaltsbeobachter",
"block.create.controller_rail": "Steureungsschiene", "block.create.controller_rail": "Steuerungsschiene",
"block.create.copper_block": "Kupfer Block", "block.create.copper_block": "Kupfer Block",
"block.create.copper_casing": "Kupferrahmen", "block.create.copper_casing": "Kupferrahmen",
"block.create.copper_ore": "Kupfererz", "block.create.copper_ore": "Kupfererz",

View file

@ -28,8 +28,8 @@
"trigger": "create:bracket_apply", "trigger": "create:bracket_apply",
"conditions": { "conditions": {
"accepted_entries": [ "accepted_entries": [
"create:cogwheel", "create:large_cogwheel",
"create:large_cogwheel" "create:cogwheel"
] ]
} }
}, },

View file

@ -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.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;
@ -600,22 +602,22 @@ public class AllBlocks {
.transform(BuilderTransformers.valveHandle(null)) .transform(BuilderTransformers.valveHandle(null))
.register(); .register();
public static final BlockEntry<ValveHandleBlock>[] DYED_VALVE_HANDLES = new BlockEntry[DyeColor.values().length]; public static final Vector<BlockEntry<ValveHandleBlock>> DYED_VALVE_HANDLES =
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[colour.ordinal()] = DYED_VALVE_HANDLES.add(REGISTRATE.block(colourName + "_valve_handle", ValveHandleBlock::dyed)
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("#") .patternLine("-")
.patternLine("-") .key('#', DyeHelper.getTagOfDye(colour))
.key('#', DyeHelper.getTagOfDye(colour)) .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

@ -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.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 {
@ -245,7 +246,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) .validBlocks(AllBlocks.DYED_VALVE_HANDLES.toArray(new BlockEntry<?>[AllBlocks.DYED_VALVE_HANDLES.size()]))
.renderer(() -> HandCrankRenderer::new) .renderer(() -> HandCrankRenderer::new)
.register(); .register();

View file

@ -55,7 +55,7 @@ public class Create {
public static final String ID = "create"; public static final String ID = "create";
public static final String NAME = "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 Logger logger = LogManager.getLogger();
public static ItemGroup baseCreativeTab = new CreateItemGroup(); public static ItemGroup baseCreativeTab = new CreateItemGroup();

View file

@ -1,7 +1,6 @@
package com.simibubi.create.content.contraptions.base; package com.simibubi.create.content.contraptions.base;
import com.simibubi.create.foundation.item.ItemDescription.Palette; import com.simibubi.create.foundation.item.ItemDescription.Palette;
import com.simibubi.create.foundation.utility.Debug;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
@ -11,7 +10,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;

View file

@ -12,6 +12,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.HorizontalBlock; import net.minecraft.block.HorizontalBlock;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -69,4 +70,9 @@ public abstract class AttachedActorBlock extends HorizontalBlock implements IWre
return getDefaultState().with(HORIZONTAL_FACING, facing); return getDefaultState().with(HORIZONTAL_FACING, facing);
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -13,6 +13,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.material.PushReaction; import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.item.ItemEntity;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -88,6 +89,11 @@ public class DrillBlock extends DirectionalKineticBlock implements ITE<DrillTile
public Class<DrillTileEntity> getTileEntityClass() { public Class<DrillTileEntity> getTileEntityClass() {
return DrillTileEntity.class; return DrillTileEntity.class;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
public static double getDamage(float speed) { public static double getDamage(float speed) {
float speedAbs = Math.abs(speed); float speedAbs = Math.abs(speed);

View file

@ -21,4 +21,5 @@ public class HarvesterBlock extends AttachedActorBlock {
public TileEntity createTileEntity(BlockState state, IBlockReader world) { public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new HarvesterTileEntity(AllTileEntities.HARVESTER.get()); return new HarvesterTileEntity(AllTileEntities.HARVESTER.get());
} }
} }

View file

@ -21,6 +21,7 @@ import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.pathfinding.PathNodeType; import net.minecraft.pathfinding.PathNodeType;
import net.minecraft.pathfinding.PathType;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
@ -143,4 +144,9 @@ public class SeatBlock extends Block {
entity.startRiding(seat, true); entity.startRiding(seat, true);
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -9,6 +9,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.Axis;
@ -75,5 +76,10 @@ public class CuckooClockBlock extends HorizontalKineticBlock {
public Axis getRotationAxis(BlockState state) { public Axis getRotationAxis(BlockState state) {
return state.get(HORIZONTAL_FACING).getAxis(); return state.get(HORIZONTAL_FACING).getAxis();
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -12,6 +12,7 @@ import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -116,5 +117,10 @@ public class HandCrankBlock extends DirectionalKineticBlock implements ITE<HandC
public Class<HandCrankTileEntity> getTileEntityClass() { public Class<HandCrankTileEntity> getTileEntityClass() {
return HandCrankTileEntity.class; return HandCrankTileEntity.class;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -48,7 +48,8 @@ public class ValveHandleBlock extends HandCrankBlock {
if (worldIn.isRemote) if (worldIn.isRemote)
return ActionResultType.SUCCESS; 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)); .with(FACING, state.get(FACING));
if (newState != state) if (newState != state)
worldIn.setBlockState(pos, newState); worldIn.setBlockState(pos, newState);

View file

@ -20,6 +20,7 @@ import net.minecraft.item.BlockItemUseContext;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil; import net.minecraft.nbt.NBTUtil;
import net.minecraft.particles.ParticleTypes; import net.minecraft.particles.ParticleTypes;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
@ -201,5 +202,10 @@ public class CrushingWheelControllerBlock extends DirectionalBlock
public Class<CrushingWheelControllerTileEntity> getTileEntityClass() { public Class<CrushingWheelControllerTileEntity> getTileEntityClass() {
return CrushingWheelControllerTileEntity.class; return CrushingWheelControllerTileEntity.class;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -17,6 +17,7 @@ import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
@ -120,5 +121,10 @@ public class DeployerBlock extends DirectionalAxisKineticBlock implements ITE<De
BlockPos p_220069_5_, boolean p_220069_6_) { BlockPos p_220069_5_, boolean p_220069_6_) {
withTileEntityDo(world, pos, DeployerTileEntity::redstoneUpdate); withTileEntityDo(world, pos, DeployerTileEntity::redstoneUpdate);
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -54,7 +54,7 @@ public class EncasedFanTileEntity extends GeneratingKineticTileEntity implements
@Override @Override
public float calculateAddedStressCapacity() { public float calculateAddedStressCapacity() {
return isGenerator ? super.calculateAddedStressCapacity() : 0; return lastCapacityProvided = (isGenerator ? super.calculateAddedStressCapacity() : 0);
} }
@Override @Override

View file

@ -11,6 +11,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -74,5 +75,10 @@ public class NozzleBlock extends ProperDirectionalBlock {
return te instanceof IAirCurrentSource return te instanceof IAirCurrentSource
&& ((IAirCurrentSource) te).getAirflowOriginSide() == towardsFan.getOpposite(); && ((IAirCurrentSource) te).getAirflowOriginSide() == towardsFan.getOpposite();
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -45,7 +45,7 @@ public class FlywheelTileEntity extends GeneratingKineticTileEntity {
@Override @Override
public float calculateAddedStressCapacity() { public float calculateAddedStressCapacity() {
return generatedCapacity; return lastCapacityProvided = generatedCapacity;
} }
@Override @Override

View file

@ -13,6 +13,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -141,5 +142,10 @@ public class MillstoneBlock extends KineticBlock implements ITE<MillstoneTileEnt
public Class<MillstoneTileEntity> getTileEntityClass() { public Class<MillstoneTileEntity> getTileEntityClass() {
return MillstoneTileEntity.class; return MillstoneTileEntity.class;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -9,6 +9,7 @@ import com.simibubi.create.foundation.block.ITE;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.Axis;
@ -71,5 +72,10 @@ public class MechanicalMixerBlock extends KineticBlock implements ITE<Mechanical
public Class<MechanicalMixerTileEntity> getTileEntityClass() { public Class<MechanicalMixerTileEntity> getTileEntityClass() {
return MechanicalMixerTileEntity.class; return MechanicalMixerTileEntity.class;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -6,6 +6,7 @@ import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.Axis;
@ -57,4 +58,10 @@ public class CreativeMotorBlock extends DirectionalKineticBlock {
public boolean hideStressImpact() { public boolean hideStressImpact() {
return true; return true;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -9,6 +9,7 @@ import com.simibubi.create.foundation.block.ITE;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.Axis;
@ -65,5 +66,10 @@ public class MechanicalPressBlock extends HorizontalKineticBlock implements ITE<
public Class<MechanicalPressTileEntity> getTileEntityClass() { public Class<MechanicalPressTileEntity> getTileEntityClass() {
return MechanicalPressTileEntity.class; return MechanicalPressTileEntity.class;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -17,6 +17,7 @@ import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -120,5 +121,10 @@ public class SawBlock extends DirectionalAxisKineticBlock implements ITE<SawTile
public Class<SawTileEntity> getTileEntityClass() { public Class<SawTileEntity> getTileEntityClass() {
return SawTileEntity.class; return SawTileEntity.class;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -26,6 +26,7 @@ import com.simibubi.create.content.logistics.block.redstone.RedstoneLinkBlock;
import net.minecraft.block.AbstractPressurePlateBlock; import net.minecraft.block.AbstractPressurePlateBlock;
import net.minecraft.block.AbstractRailBlock; import net.minecraft.block.AbstractRailBlock;
import net.minecraft.block.AbstractSignBlock;
import net.minecraft.block.BellBlock; import net.minecraft.block.BellBlock;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
@ -40,7 +41,9 @@ import net.minecraft.block.LadderBlock;
import net.minecraft.block.RedstoneDiodeBlock; import net.minecraft.block.RedstoneDiodeBlock;
import net.minecraft.block.RedstoneWallTorchBlock; import net.minecraft.block.RedstoneWallTorchBlock;
import net.minecraft.block.RedstoneWireBlock; import net.minecraft.block.RedstoneWireBlock;
import net.minecraft.block.StandingSignBlock;
import net.minecraft.block.TorchBlock; import net.minecraft.block.TorchBlock;
import net.minecraft.block.WallSignBlock;
import net.minecraft.block.WallTorchBlock; import net.minecraft.block.WallTorchBlock;
import net.minecraft.block.material.PushReaction; import net.minecraft.block.material.PushReaction;
import net.minecraft.state.properties.AttachFace; import net.minecraft.state.properties.AttachFace;
@ -116,6 +119,8 @@ public class BlockMovementTraits {
return true; return true;
if (block instanceof TorchBlock) if (block instanceof TorchBlock)
return true; return true;
if (block instanceof AbstractSignBlock)
return true;
if (block instanceof AbstractPressurePlateBlock) if (block instanceof AbstractPressurePlateBlock)
return true; return true;
if (block instanceof HorizontalFaceBlock && !(block instanceof GrindstoneBlock)) if (block instanceof HorizontalFaceBlock && !(block instanceof GrindstoneBlock))
@ -143,6 +148,10 @@ public class BlockMovementTraits {
return state.get(LadderBlock.FACING) == direction.getOpposite(); return state.get(LadderBlock.FACING) == direction.getOpposite();
if (block instanceof WallTorchBlock) if (block instanceof WallTorchBlock)
return state.get(WallTorchBlock.HORIZONTAL_FACING) == direction.getOpposite(); 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) if (block instanceof AbstractPressurePlateBlock)
return direction == Direction.DOWN; return direction == Direction.DOWN;
if (block instanceof DoorBlock) if (block instanceof DoorBlock)

View file

@ -75,6 +75,11 @@ public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity
@Override @Override
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
if (wasMoved) {
super.fromTag(state, compound, clientPacket);
return;
}
float angleBefore = angle; float angleBefore = angle;
running = compound.getBoolean("Running"); running = compound.getBoolean("Running");
angle = compound.getFloat("Angle"); angle = compound.getFloat("Angle");

View file

@ -28,6 +28,7 @@ import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.DyeColor; import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.ShearsItem; import net.minecraft.item.ShearsItem;
import net.minecraft.pathfinding.PathType;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Hand; 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 @MethodsReturnNonnullByDefault
private static class PlacementHelper implements IPlacementHelper { private static class PlacementHelper implements IPlacementHelper {

View file

@ -27,7 +27,7 @@ public class WindmillBearingTileEntity extends MechanicalBearingTileEntity {
super.updateGeneratedRotation(); super.updateGeneratedRotation();
lastGeneratedSpeed = getGeneratedSpeed(); lastGeneratedSpeed = getGeneratedSpeed();
} }
@Override @Override
public void onSpeedChanged(float prevSpeed) { public void onSpeedChanged(float prevSpeed) {
boolean cancelAssembly = assembleNextTick; boolean cancelAssembly = assembleNextTick;
@ -63,7 +63,8 @@ public class WindmillBearingTileEntity extends MechanicalBearingTileEntity {
@Override @Override
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
lastGeneratedSpeed = compound.getFloat("LastGenerated"); if (!wasMoved)
lastGeneratedSpeed = compound.getFloat("LastGenerated");
super.fromTag(state, compound, clientPacket); super.fromTag(state, compound, clientPacket);
} }

View file

@ -42,6 +42,7 @@ import net.minecraft.item.ItemUseContext;
import net.minecraft.loot.LootContext; import net.minecraft.loot.LootContext;
import net.minecraft.loot.LootParameters; import net.minecraft.loot.LootParameters;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.EnumProperty; import net.minecraft.state.EnumProperty;
import net.minecraft.state.Property; import net.minecraft.state.Property;
@ -137,54 +138,6 @@ public class CartAssemblerBlock extends AbstractRailBlock
return; return;
withTileEntityDo(world, pos, te -> { 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()) if (!te.isMinecartUpdateValid())
return; return;
@ -458,13 +411,6 @@ public class CartAssemblerBlock extends AbstractRailBlock
return PushReaction.BLOCK; 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 @Override
public Class<CartAssemblerTileEntity> getTileEntityClass() { public Class<CartAssemblerTileEntity> getTileEntityClass() {
return CartAssemblerTileEntity.class; 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 @Override
public ActionResultType onWrenched(BlockState state, ItemUseContext context) { public ActionResultType onWrenched(BlockState state, ItemUseContext context) {
World world = context.getWorld(); World world = context.getWorld();

View file

@ -16,6 +16,7 @@ import net.minecraft.fluid.FluidState;
import net.minecraft.fluid.Fluids; import net.minecraft.fluid.Fluids;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.EnumProperty; import net.minecraft.state.EnumProperty;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
@ -111,4 +112,9 @@ public class MechanicalPistonHeadBlock extends ProperDirectionalBlock implements
FluidState FluidState = context.getWorld().getFluidState(context.getPos()); FluidState FluidState = context.getWorld().getFluidState(context.getPos());
return super.getStateForPlacement(context).with(BlockStateProperties.WATERLOGGED, Boolean.valueOf(FluidState.getFluid() == Fluids.WATER)); 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;
}
} }

View file

@ -26,6 +26,7 @@ import net.minecraft.fluid.Fluids;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
@ -146,6 +147,11 @@ public class PistonExtensionPoleBlock extends ProperDirectionalBlock implements
} }
return state; return state;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
@MethodsReturnNonnullByDefault @MethodsReturnNonnullByDefault
public static class PlacementHelper extends PoleHelper<Direction> { public static class PlacementHelper extends PoleHelper<Direction> {

View file

@ -15,6 +15,7 @@ import net.minecraft.fluid.FluidState;
import net.minecraft.fluid.Fluids; import net.minecraft.fluid.Fluids;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.EnumProperty; import net.minecraft.state.EnumProperty;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
@ -97,6 +98,11 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements ITE<Pulle
super(properties); super(properties);
setDefaultState(super.getDefaultState().with(BlockStateProperties.WATERLOGGED, false)); setDefaultState(super.getDefaultState().with(BlockStateProperties.WATERLOGGED, false));
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
@Override @Override
public PushReaction getPushReaction(BlockState state) { public PushReaction getPushReaction(BlockState state) {

View file

@ -12,6 +12,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.Axis;
@ -106,5 +107,10 @@ public class TurntableBlock extends KineticBlock implements ITE<TurntableTileEnt
public Class<TurntableTileEntity> getTileEntityClass() { public Class<TurntableTileEntity> getTileEntityClass() {
return TurntableTileEntity.class; return TurntableTileEntity.class;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -17,6 +17,7 @@ import net.minecraft.fluid.Fluids;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
import net.minecraft.network.DebugPacketSender; import net.minecraft.network.DebugPacketSender;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -173,4 +174,9 @@ public class PumpBlock extends DirectionalKineticBlock implements IWaterLoggable
world.removeTileEntity(pos); world.removeTileEntity(pos);
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -13,6 +13,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.InventoryHelper; import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -109,5 +110,10 @@ public class ItemDrainBlock extends Block implements IWrenchable, ITE<ItemDrainT
public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) { public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) {
return ComparatorUtil.levelOfSmartFluidTank(worldIn, pos); return ComparatorUtil.levelOfSmartFluidTank(worldIn, pos);
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -7,6 +7,7 @@ import com.simibubi.create.foundation.tileEntity.ComparatorUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.ISelectionContext;
@ -45,5 +46,10 @@ public class SpoutBlock extends Block implements IWrenchable {
public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) { public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) {
return ComparatorUtil.levelOfSmartFluidTank(worldIn, pos); return ComparatorUtil.levelOfSmartFluidTank(worldIn, pos);
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -27,6 +27,7 @@ import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
import net.minecraft.network.DebugPacketSender; import net.minecraft.network.DebugPacketSender;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -274,4 +275,10 @@ public class FluidPipeBlock extends SixWayBlock implements IWaterLoggable, IWren
return Optional.empty(); return Optional.empty();
return Optional.of(new ItemStack(bracket.getBlock())); return Optional.of(new ItemStack(bracket.getBlock()));
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -13,6 +13,7 @@ import com.simibubi.create.foundation.utility.Iterate;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.network.DebugPacketSender; import net.minecraft.network.DebugPacketSender;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -129,5 +130,10 @@ public class FluidValveBlock extends DirectionalAxisKineticBlock implements IAxi
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random r) { public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random r) {
FluidPropagator.propagateChangedPipe(world, pos, state); FluidPropagator.propagateChangedPipe(world, pos, state);
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -15,6 +15,7 @@ import net.minecraft.fluid.FluidState;
import net.minecraft.fluid.Fluids; import net.minecraft.fluid.Fluids;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
@ -82,4 +83,10 @@ public class GlassFluidPipeBlock extends AxisPipeBlock implements IWaterLoggable
public ItemRequirement getRequiredItems(BlockState state) { public ItemRequirement getRequiredItems(BlockState state) {
return ItemRequirement.of(AllBlocks.FLUID_PIPE.getDefaultState()); return ItemRequirement.of(AllBlocks.FLUID_PIPE.getDefaultState());
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -13,6 +13,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.HorizontalFaceBlock; import net.minecraft.block.HorizontalFaceBlock;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.network.DebugPacketSender; import net.minecraft.network.DebugPacketSender;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.AttachFace; import net.minecraft.state.properties.AttachFace;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -152,5 +153,10 @@ public class SmartFluidPipeBlock extends HorizontalFaceBlock implements IAxisPip
public Axis getAxis(BlockState state) { public Axis getAxis(BlockState state) {
return getPipeAxis(state); return getPipeAxis(state);
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -33,7 +33,6 @@ import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.ITextProperties; import net.minecraft.util.text.ITextProperties;
import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.Style;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;

View file

@ -38,7 +38,7 @@ public interface IHaveGoggleInformation {
static String format(double d) { static String format(double d) {
return numberFormat.get() return numberFormat.get()
.format(d); .format(d).replace("\u00A0", " ");
} }
default boolean containedFluidTooltip(List<ITextComponent> tooltip, boolean isPlayerSneaking, LazyOptional<IFluidHandler> handler) { default boolean containedFluidTooltip(List<ITextComponent> tooltip, boolean isPlayerSneaking, LazyOptional<IFluidHandler> handler) {

View file

@ -23,6 +23,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.DirectionProperty; import net.minecraft.state.DirectionProperty;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
@ -217,4 +218,9 @@ public class BasinBlock extends Block implements ITE<BasinTileEntity>, IWrenchab
return false; return false;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -29,6 +29,7 @@ import net.minecraft.loot.LootPool;
import net.minecraft.loot.LootTable; import net.minecraft.loot.LootTable;
import net.minecraft.loot.conditions.BlockStateProperty; import net.minecraft.loot.conditions.BlockStateProperty;
import net.minecraft.loot.conditions.ILootCondition.IBuilder; import net.minecraft.loot.conditions.ILootCondition.IBuilder;
import net.minecraft.pathfinding.PathType;
import net.minecraft.loot.conditions.SurvivesExplosion; import net.minecraft.loot.conditions.SurvivesExplosion;
import net.minecraft.state.EnumProperty; import net.minecraft.state.EnumProperty;
import net.minecraft.state.Property; import net.minecraft.state.Property;
@ -255,4 +256,10 @@ public class BlazeBurnerBlock extends Block implements ITE<BlazeBurnerTileEntity
return this.ordinal() >= heatLevel.ordinal(); return this.ordinal() >= heatLevel.ordinal();
} }
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -11,6 +11,7 @@ import net.minecraft.block.Blocks;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.particles.ParticleTypes; import net.minecraft.particles.ParticleTypes;
import net.minecraft.pathfinding.PathType;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
@ -114,5 +115,10 @@ public class LitBlazeBurnerBlock extends Block {
return AllBlocks.BLAZE_BURNER.get() return AllBlocks.BLAZE_BURNER.get()
.getCollisionShape(state, reader, pos, context); .getCollisionShape(state, reader, pos, context);
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -24,6 +24,7 @@ import net.minecraft.item.BlockItem;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.EnumProperty; import net.minecraft.state.EnumProperty;
import net.minecraft.state.Property; import net.minecraft.state.Property;
@ -269,6 +270,11 @@ public class GantryShaftBlock extends DirectionalKineticBlock {
public float getParticleInitialRadius() { public float getParticleInitialRadius() {
return .25f; return .25f;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
public static class PlacementHelper extends PoleHelper<Direction> { public static class PlacementHelper extends PoleHelper<Direction> {

View file

@ -38,6 +38,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
import net.minecraft.loot.LootParameters; import net.minecraft.loot.LootParameters;
import net.minecraft.pathfinding.PathNodeType; import net.minecraft.pathfinding.PathNodeType;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.EnumProperty; import net.minecraft.state.EnumProperty;
import net.minecraft.state.Property; import net.minecraft.state.Property;
@ -597,5 +598,10 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
return rotate; return rotate;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -17,6 +17,7 @@ import net.minecraft.fluid.Fluids;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -29,13 +30,14 @@ import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
public abstract class AbstractShaftBlock extends RotatedPillarKineticBlock implements IWaterLoggable, IWrenchableWithBracket { public abstract class AbstractShaftBlock extends RotatedPillarKineticBlock
implements IWaterLoggable, IWrenchableWithBracket {
public AbstractShaftBlock(Properties properties) { public AbstractShaftBlock(Properties properties) {
super(properties); super(properties);
setDefaultState(super.getDefaultState().with(BlockStateProperties.WATERLOGGED, false)); setDefaultState(super.getDefaultState().with(BlockStateProperties.WATERLOGGED, false));
} }
@Override @Override
public ActionResultType onWrenched(BlockState state, ItemUseContext context) { public ActionResultType onWrenched(BlockState state, ItemUseContext context) {
return IWrenchableWithBracket.super.onWrenched(state, context); return IWrenchableWithBracket.super.onWrenched(state, context);
@ -58,7 +60,7 @@ public abstract class AbstractShaftBlock extends RotatedPillarKineticBlock imple
removeBracket(world, pos, true).ifPresent(stack -> Block.spawnAsEntity(world, pos, stack)); removeBracket(world, pos, true).ifPresent(stack -> Block.spawnAsEntity(world, pos, stack));
super.onReplaced(state, world, pos, newState, isMoving); super.onReplaced(state, world, pos, newState, isMoving);
} }
// IRotate: // IRotate:
@Override @Override
@ -112,4 +114,10 @@ public abstract class AbstractShaftBlock extends RotatedPillarKineticBlock imple
return Optional.empty(); return Optional.empty();
return Optional.of(new ItemStack(bracket.getBlock())); return Optional.of(new ItemStack(bracket.getBlock()));
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -15,6 +15,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.particles.RedstoneParticleData; import net.minecraft.particles.RedstoneParticleData;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.Axis;
@ -45,11 +46,11 @@ public class GaugeBlock extends DirectionalAxisKineticBlock {
public static GaugeBlock speed(Properties properties) { public static GaugeBlock speed(Properties properties) {
return new GaugeBlock(properties, Type.SPEED); return new GaugeBlock(properties, Type.SPEED);
} }
public static GaugeBlock stress(Properties properties) { public static GaugeBlock stress(Properties properties) {
return new GaugeBlock(properties, Type.STRESS); return new GaugeBlock(properties, Type.STRESS);
} }
protected GaugeBlock(Properties properties, Type type) { protected GaugeBlock(Properties properties, Type type) {
super(properties); super(properties);
this.type = type; 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") * FIXME: Is there a new way of doing this in 1.16? Or cn we just delete it?
@Override *
public MaterialColor getMaterialColor(BlockState state, IBlockReader worldIn, BlockPos pos) { * @SuppressWarnings("deprecation")
return Blocks.SPRUCE_PLANKS.getMaterialColor(state, worldIn, pos); *
} */ * @Override
* public MaterialColor getMaterialColor(BlockState state, IBlockReader worldIn, BlockPos pos) {
* return Blocks.SPRUCE_PLANKS.getMaterialColor(state, worldIn, pos);
* }
*/
@Override @Override
public BlockState getStateForPlacement(BlockItemUseContext context) { public BlockState getStateForPlacement(BlockItemUseContext context) {
World world = context.getWorld(); World world = context.getWorld();
Direction face = context.getFace(); 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); BlockState placedOnState = world.getBlockState(placedOnPos);
Block block = placedOnState.getBlock(); Block block = placedOnState.getBlock();
@ -88,17 +95,14 @@ public class GaugeBlock extends DirectionalAxisKineticBlock {
Direction nearestLookingDirection = context.getNearestLookingDirection(); Direction nearestLookingDirection = context.getNearestLookingDirection();
boolean lookPositive = nearestLookingDirection.getAxisDirection() == AxisDirection.POSITIVE; boolean lookPositive = nearestLookingDirection.getAxisDirection() == AxisDirection.POSITIVE;
if (face.getAxis() == Axis.X) { if (face.getAxis() == Axis.X) {
toPlace = toPlace toPlace = toPlace.with(FACING, lookPositive ? Direction.NORTH : Direction.SOUTH)
.with(FACING, lookPositive ? Direction.NORTH : Direction.SOUTH) .with(AXIS_ALONG_FIRST_COORDINATE, true);
.with(AXIS_ALONG_FIRST_COORDINATE, true);
} else if (face.getAxis() == Axis.Y) { } else if (face.getAxis() == Axis.Y) {
toPlace = toPlace toPlace = toPlace.with(FACING, horizontalFacing.getOpposite())
.with(FACING, horizontalFacing.getOpposite()) .with(AXIS_ALONG_FIRST_COORDINATE, horizontalFacing.getAxis() == Axis.X);
.with(AXIS_ALONG_FIRST_COORDINATE, horizontalFacing.getAxis() == Axis.X);
} else { } else {
toPlace = toPlace toPlace = toPlace.with(FACING, lookPositive ? Direction.WEST : Direction.EAST)
.with(FACING, lookPositive ? Direction.WEST : Direction.EAST) .with(AXIS_ALONG_FIRST_COORDINATE, false);
.with(AXIS_ALONG_FIRST_COORDINATE, false);
} }
return toPlace; return toPlace;
@ -114,20 +118,22 @@ public class GaugeBlock extends DirectionalAxisKineticBlock {
@Override @Override
protected boolean getAxisAlignmentForPlacement(BlockItemUseContext context) { 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) { public boolean shouldRenderHeadOnFace(World world, BlockPos pos, BlockState state, Direction face) {
if (face.getAxis().isVertical()) if (face.getAxis()
.isVertical())
return false; return false;
if (face == state.get(FACING).getOpposite()) if (face == state.get(FACING)
.getOpposite())
return false; return false;
if (face.getAxis() == getRotationAxis(state)) if (face.getAxis() == getRotationAxis(state))
return false; return false;
if (getRotationAxis(state) == Axis.Y && face != state.get(FACING)) if (getRotationAxis(state) == Axis.Y && face != state.get(FACING))
return false; return false;
if (!Block.shouldSideBeRendered(state, world, pos, face) if (!Block.shouldSideBeRendered(state, world, pos, face) && !(world instanceof WrappedWorld))
&& !(world instanceof WrappedWorld))
return false; return false;
return true; return true;
} }
@ -156,15 +162,15 @@ public class GaugeBlock extends DirectionalAxisKineticBlock {
continue; continue;
for (int i = 0; i < particleCount; i++) { for (int i = 0; i < particleCount; i++) {
Vector3d mul = VecHelper Vector3d mul = VecHelper.offsetRandomly(Vector3d.ZERO, rand, .25f)
.offsetRandomly(Vector3d.ZERO, rand, .25f) .mul(new Vector3d(1, 1, 1).subtract(positiveFaceVec))
.mul(new Vector3d(1, 1, 1).subtract(positiveFaceVec)) .normalize()
.normalize() .scale(.3f);
.scale(.3f); Vector3d offset = VecHelper.getCenterOf(pos)
Vector3d offset = VecHelper.getCenterOf(pos).add(faceVec.scale(.55)).add(mul); .add(faceVec.scale(.55))
worldIn .add(mul);
.addParticle(new RedstoneParticleData((float) rgb.x, (float) rgb.y, (float) rgb.z, 1), offset.x, 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); offset.y, offset.z, mul.x, mul.y, mul.z);
} }
} }
@ -191,4 +197,8 @@ public class GaugeBlock extends DirectionalAxisKineticBlock {
return 0; return 0;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -20,6 +20,7 @@ import com.simibubi.create.foundation.utility.Iterate;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.FluidState; import net.minecraft.fluid.FluidState;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
@ -172,8 +173,8 @@ public class SymmetryWandItem extends Item {
public static boolean isEnabled(ItemStack stack) { public static boolean isEnabled(ItemStack stack) {
checkNBT(stack); checkNBT(stack);
return stack.getTag() CompoundNBT tag = stack.getTag();
.getBoolean(ENABLE); return tag.getBoolean(ENABLE) && !tag.getBoolean("Simulate");
} }
public static SymmetryMirror getMirror(ItemStack stack) { public static SymmetryMirror getMirror(ItemStack stack) {
@ -235,11 +236,16 @@ public class SymmetryWandItem extends Item {
FluidState ifluidstate = world.getFluidState(position); FluidState ifluidstate = world.getFluidState(position);
world.setBlockState(position, ifluidstate.getBlockState(), BlockFlags.UPDATE_NEIGHBORS); world.setBlockState(position, ifluidstate.getBlockState(), BlockFlags.UPDATE_NEIGHBORS);
world.setBlockState(position, blockState); 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); blocksnapshot.restore(true, false);
continue; continue;
} }
targets.add(position); targets.add(position);
} }
} }
@ -286,7 +292,7 @@ public class SymmetryWandItem extends Item {
continue; continue;
BlockState blockstate = world.getBlockState(position); BlockState blockstate = world.getBlockState(position);
if (!blockstate.isAir(world, position)) { if (blockstate.getMaterial() != Material.AIR) {
targets.add(position); targets.add(position);
world.playEvent(2001, position, Block.getStateId(blockstate)); world.playEvent(2001, position, Block.getStateId(blockstate));
world.setBlockState(position, air, 3); world.setBlockState(position, air, 3);

View file

@ -12,6 +12,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.DirectionProperty; import net.minecraft.state.DirectionProperty;
import net.minecraft.state.EnumProperty; import net.minecraft.state.EnumProperty;
import net.minecraft.state.Property; 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.NORMAL);
return state.with(SHAPE, Shape.INTERSECTION); return state.with(SHAPE, Shape.INTERSECTION);
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -12,6 +12,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
@ -77,5 +78,10 @@ public class DepotBlock extends Block implements ITE<DepotTileEntity>, IWrenchab
public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) { public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) {
return SharedDepotBlockMethods.getComparatorInputOverride(blockState, worldIn, pos); return SharedDepotBlockMethods.getComparatorInputOverride(blockState, worldIn, pos);
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -17,6 +17,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.pathfinding.PathType;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -159,5 +160,10 @@ public class EjectorBlock extends HorizontalKineticBlock implements ITE<EjectorT
public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) { public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) {
return SharedDepotBlockMethods.getComparatorInputOverride(blockState, worldIn, pos); return SharedDepotBlockMethods.getComparatorInputOverride(blockState, worldIn, pos);
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -15,6 +15,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.particle.ParticleManager; import net.minecraft.client.particle.ParticleManager;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
@ -41,6 +42,11 @@ public abstract class AbstractFunnelBlock extends Block implements ITE<FunnelTil
return getDefaultState().with(POWERED, context.getWorld() return getDefaultState().with(POWERED, context.getWorld()
.isBlockPowered(context.getPos())); .isBlockPowered(context.getPos()));
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
@Override @Override
protected void fillStateContainer(Builder<Block, BlockState> builder) { protected void fillStateContainer(Builder<Block, BlockState> builder) {

View file

@ -8,6 +8,7 @@ import com.simibubi.create.foundation.utility.Iterate;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -33,6 +34,11 @@ public class CrateBlock extends ProperDirectionalBlock implements IWrenchable {
return AllShapes.CRATE_BLOCK_SHAPE; return AllShapes.CRATE_BLOCK_SHAPE;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
@Override @Override
public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn,
BlockPos currentPos, BlockPos facingPos) { BlockPos currentPos, BlockPos facingPos) {

View file

@ -11,6 +11,7 @@ import net.minecraft.block.Blocks;
import net.minecraft.block.HorizontalFaceBlock; import net.minecraft.block.HorizontalFaceBlock;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.particles.RedstoneParticleData; import net.minecraft.particles.RedstoneParticleData;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
@ -136,5 +137,10 @@ public class AnalogLeverBlock extends HorizontalFaceBlock implements ITE<AnalogL
public Class<AnalogLeverTileEntity> getTileEntityClass() { public Class<AnalogLeverTileEntity> getTileEntityClass() {
return AnalogLeverTileEntity.class; return AnalogLeverTileEntity.class;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -12,6 +12,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -158,6 +159,11 @@ public class NixieTubeBlock extends HorizontalBlock implements ITE<NixieTubeTile
power = Math.max(worldIn.getRedstonePower(pos.offset(direction), Direction.UP), power); power = Math.max(worldIn.getRedstonePower(pos.offset(direction), Direction.UP), power);
return power; return power;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
@Override @Override
public boolean canConnectRedstone(BlockState state, IBlockReader world, BlockPos pos, Direction side) { public boolean canConnectRedstone(BlockState state, IBlockReader world, BlockPos pos, Direction side) {

View file

@ -11,6 +11,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
@ -54,10 +55,12 @@ public class RedstoneLinkBlock extends ProperDirectionalBlock implements ITE<Red
@Override @Override
public void onBlockAdded(BlockState state, World worldIn, BlockPos pos, BlockState oldState, boolean isMoving) { public void onBlockAdded(BlockState state, World worldIn, BlockPos pos, BlockState oldState, boolean isMoving) {
if (state.getBlock() == oldState.getBlock() || isMoving)
return;
updateTransmittedSignal(state, worldIn, pos, state.get(FACING)); updateTransmittedSignal(state, worldIn, pos, state.get(FACING));
} }
private void updateTransmittedSignal(BlockState state, World worldIn, BlockPos pos, Direction blockFacing) { public void updateTransmittedSignal(BlockState state, World worldIn, BlockPos pos, Direction blockFacing) {
if (worldIn.isRemote) if (worldIn.isRemote)
return; return;
if (state.get(RECEIVER)) if (state.get(RECEIVER))
@ -183,6 +186,11 @@ public class RedstoneLinkBlock extends ProperDirectionalBlock implements ITE<Red
return AllShapes.REDSTONE_BRIDGE.get(state.get(FACING)); return AllShapes.REDSTONE_BRIDGE.get(state.get(FACING));
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
@Override @Override
public Class<RedstoneLinkTileEntity> getTileEntityClass() { public Class<RedstoneLinkTileEntity> getTileEntityClass() {
return RedstoneLinkTileEntity.class; return RedstoneLinkTileEntity.class;

View file

@ -12,6 +12,7 @@ import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.StateContainer.Builder;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
@ -91,5 +92,10 @@ public class SchematicTableBlock extends HorizontalBlock implements ITE<Schemati
public Class<SchematicTableTileEntity> getTileEntityClass() { public Class<SchematicTableTileEntity> getTileEntityClass() {
return SchematicTableTileEntity.class; return SchematicTableTileEntity.class;
} }
@Override
public boolean allowsMovement(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;
}
} }

View file

@ -6,7 +6,6 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -65,6 +64,10 @@ public class PonderRegistry {
public static MultiSceneBuilder forComponents(ItemProviderEntry<?>... components) { public static MultiSceneBuilder forComponents(ItemProviderEntry<?>... components) {
return new MultiSceneBuilder(Arrays.asList(components)); return new MultiSceneBuilder(Arrays.asList(components));
} }
public static MultiSceneBuilder forComponents(Iterable<? extends ItemProviderEntry<?>> components) {
return new MultiSceneBuilder(components);
}
public static List<PonderScene> compile(ResourceLocation id) { public static List<PonderScene> compile(ResourceLocation id) {
return compile(all.get(id)); return compile(all.get(id));
@ -136,9 +139,9 @@ public class PonderRegistry {
public static class MultiSceneBuilder { public static class MultiSceneBuilder {
private final Collection<ItemProviderEntry<?>> components; private final Iterable<? extends ItemProviderEntry<?>> components;
MultiSceneBuilder(Collection<ItemProviderEntry<?>> components) { MultiSceneBuilder(Iterable<? extends ItemProviderEntry<?>> components) {
this.components = components; this.components = components;
} }

View file

@ -45,6 +45,7 @@ public class BeltScenes {
scene.title("belt_connector", "Using Mechanical Belts"); scene.title("belt_connector", "Using Mechanical Belts");
scene.configureBasePlate(0, 0, 5); scene.configureBasePlate(0, 0, 5);
scene.showBasePlate(); scene.showBasePlate();
scene.world.showSection(util.select.position(3, 0, 5), Direction.UP);
scene.idle(5); scene.idle(5);
scene.world.showSection(util.select.fromTo(4, 1, 3, 4, 1, 5), Direction.DOWN); scene.world.showSection(util.select.fromTo(4, 1, 3, 4, 1, 5), Direction.DOWN);

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[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); .with(ValveHandleBlock.FACING, Direction.UP), true);
scene.idle(10); scene.idle(10);
scene.overlay.showText(70) scene.overlay.showText(70)

View file

@ -22,6 +22,6 @@ Technology that empowers the player.'''
[[dependencies.create]] [[dependencies.create]]
modId="minecraft" modId="minecraft"
mandatory=true mandatory=true
versionRange="[1.16.3,1.17)" versionRange="[1.16.4,1.17)"
ordering="NONE" ordering="NONE"
side="BOTH" side="BOTH"

View file

@ -55,7 +55,7 @@
"block.create.clutch": "Kupplung", "block.create.clutch": "Kupplung",
"block.create.cogwheel": "Zahnrad", "block.create.cogwheel": "Zahnrad",
"block.create.content_observer": "Inhaltsbeobachter", "block.create.content_observer": "Inhaltsbeobachter",
"block.create.controller_rail": "Steureungsschiene", "block.create.controller_rail": "Steuerungsschiene",
"block.create.copper_block": "Kupfer Block", "block.create.copper_block": "Kupfer Block",
"block.create.copper_casing": "Kupferrahmen", "block.create.copper_casing": "Kupferrahmen",
"block.create.copper_ore": "Kupfererz", "block.create.copper_ore": "Kupfererz",