mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-05 23:23:43 +01:00
Port new changes
This commit is contained in:
parent
7760db875c
commit
a50b9bc6d1
5 changed files with 44 additions and 44 deletions
|
@ -29,8 +29,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_south": "true",
|
"axis": "x",
|
||||||
"axis": "x"
|
"sticky_south": "true"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_x_sticky",
|
"model": "create:block/radial_chassis_side_x_sticky",
|
||||||
|
@ -39,8 +39,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_south": "true",
|
"axis": "y",
|
||||||
"axis": "y"
|
"sticky_south": "true"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_y_sticky"
|
"model": "create:block/radial_chassis_side_y_sticky"
|
||||||
|
@ -48,8 +48,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_south": "true",
|
"axis": "z",
|
||||||
"axis": "z"
|
"sticky_south": "true"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_x_sticky",
|
"model": "create:block/radial_chassis_side_x_sticky",
|
||||||
|
@ -59,8 +59,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_south": "false",
|
"axis": "x",
|
||||||
"axis": "x"
|
"sticky_south": "false"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_x",
|
"model": "create:block/radial_chassis_side_x",
|
||||||
|
@ -69,8 +69,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_south": "false",
|
"axis": "y",
|
||||||
"axis": "y"
|
"sticky_south": "false"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_y"
|
"model": "create:block/radial_chassis_side_y"
|
||||||
|
@ -78,8 +78,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_south": "false",
|
"axis": "z",
|
||||||
"axis": "z"
|
"sticky_south": "false"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_x",
|
"model": "create:block/radial_chassis_side_x",
|
||||||
|
@ -149,8 +149,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_north": "true",
|
"axis": "x",
|
||||||
"axis": "x"
|
"sticky_north": "true"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_x_sticky"
|
"model": "create:block/radial_chassis_side_x_sticky"
|
||||||
|
@ -158,8 +158,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_north": "true",
|
"axis": "y",
|
||||||
"axis": "y"
|
"sticky_north": "true"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_y_sticky",
|
"model": "create:block/radial_chassis_side_y_sticky",
|
||||||
|
@ -168,8 +168,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_north": "true",
|
"axis": "z",
|
||||||
"axis": "z"
|
"sticky_north": "true"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_x_sticky",
|
"model": "create:block/radial_chassis_side_x_sticky",
|
||||||
|
@ -178,8 +178,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_north": "false",
|
"axis": "x",
|
||||||
"axis": "x"
|
"sticky_north": "false"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_x"
|
"model": "create:block/radial_chassis_side_x"
|
||||||
|
@ -187,8 +187,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_north": "false",
|
"axis": "y",
|
||||||
"axis": "y"
|
"sticky_north": "false"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_y",
|
"model": "create:block/radial_chassis_side_y",
|
||||||
|
@ -197,8 +197,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_north": "false",
|
"axis": "z",
|
||||||
"axis": "z"
|
"sticky_north": "false"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_x",
|
"model": "create:block/radial_chassis_side_x",
|
||||||
|
@ -207,8 +207,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_east": "true",
|
"axis": "x",
|
||||||
"axis": "x"
|
"sticky_east": "true"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_x_sticky",
|
"model": "create:block/radial_chassis_side_x_sticky",
|
||||||
|
@ -217,8 +217,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_east": "true",
|
"axis": "y",
|
||||||
"axis": "y"
|
"sticky_east": "true"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_y_sticky",
|
"model": "create:block/radial_chassis_side_y_sticky",
|
||||||
|
@ -227,8 +227,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_east": "true",
|
"axis": "z",
|
||||||
"axis": "z"
|
"sticky_east": "true"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_z_sticky"
|
"model": "create:block/radial_chassis_side_z_sticky"
|
||||||
|
@ -236,8 +236,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_east": "false",
|
"axis": "x",
|
||||||
"axis": "x"
|
"sticky_east": "false"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_x",
|
"model": "create:block/radial_chassis_side_x",
|
||||||
|
@ -246,8 +246,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_east": "false",
|
"axis": "y",
|
||||||
"axis": "y"
|
"sticky_east": "false"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_y",
|
"model": "create:block/radial_chassis_side_y",
|
||||||
|
@ -256,8 +256,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"sticky_east": "false",
|
"axis": "z",
|
||||||
"axis": "z"
|
"sticky_east": "false"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_z"
|
"model": "create:block/radial_chassis_side_z"
|
||||||
|
|
|
@ -242,14 +242,14 @@ public abstract class ZapperItem extends Item {
|
||||||
return UseAction.NONE;
|
return UseAction.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setTileData(World world, BlockPos pos, CompoundNBT data) {
|
public static void setTileData(World world, BlockPos pos, BlockState state, CompoundNBT data) {
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
TileEntity tile = world.getTileEntity(pos);
|
TileEntity tile = world.getTileEntity(pos);
|
||||||
if (tile != null && !tile.onlyOpsCanSetNbt()) {
|
if (tile != null && !tile.onlyOpsCanSetNbt()) {
|
||||||
data.putInt("x", pos.getX());
|
data.putInt("x", pos.getX());
|
||||||
data.putInt("y", pos.getY());
|
data.putInt("y", pos.getY());
|
||||||
data.putInt("z", pos.getZ());
|
data.putInt("z", pos.getZ());
|
||||||
tile.read(data);
|
tile.fromTag(state, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class BlockzapperItem extends ZapperItem {
|
||||||
blocksnapshot.restore(true, false);
|
blocksnapshot.restore(true, false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
setTileData(world, placed, data);
|
setTileData(world, placed, state, data);
|
||||||
|
|
||||||
if (player instanceof ServerPlayerEntity && world instanceof ServerWorld) {
|
if (player instanceof ServerPlayerEntity && world instanceof ServerWorld) {
|
||||||
ServerPlayerEntity serverPlayer = (ServerPlayerEntity) player;
|
ServerPlayerEntity serverPlayer = (ServerPlayerEntity) player;
|
||||||
|
|
|
@ -47,7 +47,7 @@ public enum TerrainTools {
|
||||||
if (!isReplaceable(toReplace))
|
if (!isReplaceable(toReplace))
|
||||||
return;
|
return;
|
||||||
world.setBlockState(p, paintedState);
|
world.setBlockState(p, paintedState);
|
||||||
ZapperItem.setTileData(world, p, data);
|
ZapperItem.setTileData(world, p, paintedState, data);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case Flatten:
|
case Flatten:
|
||||||
|
@ -67,13 +67,13 @@ public enum TerrainTools {
|
||||||
if (!isReplaceable(toReplace))
|
if (!isReplaceable(toReplace))
|
||||||
return;
|
return;
|
||||||
world.setBlockState(p, paintedState);
|
world.setBlockState(p, paintedState);
|
||||||
ZapperItem.setTileData(world, p, data);
|
ZapperItem.setTileData(world, p, paintedState, data);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case Place:
|
case Place:
|
||||||
targetPositions.forEach(p -> {
|
targetPositions.forEach(p -> {
|
||||||
world.setBlockState(p, paintedState);
|
world.setBlockState(p, paintedState);
|
||||||
ZapperItem.setTileData(world, p, data);
|
ZapperItem.setTileData(world, p, paintedState, data);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case Replace:
|
case Replace:
|
||||||
|
@ -82,7 +82,7 @@ public enum TerrainTools {
|
||||||
if (isReplaceable(toReplace))
|
if (isReplaceable(toReplace))
|
||||||
return;
|
return;
|
||||||
world.setBlockState(p, paintedState);
|
world.setBlockState(p, paintedState);
|
||||||
ZapperItem.setTileData(world, p, data);
|
ZapperItem.setTileData(world, p, paintedState, data);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,7 +162,7 @@ public abstract class LaunchedItem {
|
||||||
data.putInt("x", target.getX());
|
data.putInt("x", target.getX());
|
||||||
data.putInt("y", target.getY());
|
data.putInt("y", target.getY());
|
||||||
data.putInt("z", target.getZ());
|
data.putInt("z", target.getZ());
|
||||||
tile.read(data);
|
tile.fromTag(state, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
state.getBlock().onBlockPlacedBy(world, target, state, null, stack);
|
state.getBlock().onBlockPlacedBy(world, target, state, null, stack);
|
||||||
|
|
Loading…
Reference in a new issue