mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-11-13 18:46:15 +00:00
fix: place block core not working with the properties
This commit is contained in:
parent
00d3be8342
commit
b27140951b
1 changed files with 6 additions and 3 deletions
|
|
@ -27,7 +27,10 @@ import net.minecraft.state.property.Property;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.Util;
|
import net.minecraft.util.Util;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.*;
|
import net.minecraft.util.math.BlockBox;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
import net.minecraft.world.dimension.DimensionType;
|
||||||
|
|
||||||
|
|
@ -360,7 +363,7 @@ public class CommandCore implements Listener {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
player.getPos().getY() < dimensionType.minY()
|
player.getPos().getY() < dimensionType.minY()
|
||||||
|| player.getPos().getY() > dimensionType.height() + dimensionType.minY()
|
|| player.getPos().getY() > dimensionType.height() + dimensionType.minY()
|
||||||
) {
|
) {
|
||||||
networkHandler.sendChatCommand(command);
|
networkHandler.sendChatCommand(command);
|
||||||
return;
|
return;
|
||||||
|
|
@ -451,7 +454,7 @@ public class CommandCore implements Listener {
|
||||||
for (final Property<?> property : oldBlockState.getProperties()) {
|
for (final Property<?> property : oldBlockState.getProperties()) {
|
||||||
command.append(property.getName())
|
command.append(property.getName())
|
||||||
.append('=')
|
.append('=')
|
||||||
.append(Util.getValueAsString(property, property.getType()))
|
.append(Util.getValueAsString(property, property.getValues().getLast())) // water[level=15] instead of water[level=0,level=1,....,level=15]
|
||||||
.append(',');
|
.append(',');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue