Port new changes
- Fix incompatible resource pack version
This commit is contained in:
parent
2700832dff
commit
d7a41b7810
23 changed files with 83 additions and 197 deletions
|
@ -207,8 +207,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"axis": "x",
|
"sticky_east": "true",
|
||||||
"sticky_east": "true"
|
"axis": "x"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_x_sticky",
|
"model": "create:block/radial_chassis_side_x_sticky",
|
||||||
|
@ -217,8 +217,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"axis": "y",
|
"sticky_east": "true",
|
||||||
"sticky_east": "true"
|
"axis": "y"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_y_sticky",
|
"model": "create:block/radial_chassis_side_y_sticky",
|
||||||
|
@ -227,8 +227,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"axis": "z",
|
"sticky_east": "true",
|
||||||
"sticky_east": "true"
|
"axis": "z"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_z_sticky"
|
"model": "create:block/radial_chassis_side_z_sticky"
|
||||||
|
@ -236,8 +236,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"axis": "x",
|
"sticky_east": "false",
|
||||||
"sticky_east": "false"
|
"axis": "x"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_x",
|
"model": "create:block/radial_chassis_side_x",
|
||||||
|
@ -246,8 +246,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"axis": "y",
|
"sticky_east": "false",
|
||||||
"sticky_east": "false"
|
"axis": "y"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_y",
|
"model": "create:block/radial_chassis_side_y",
|
||||||
|
@ -256,8 +256,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"axis": "z",
|
"sticky_east": "false",
|
||||||
"sticky_east": "false"
|
"axis": "z"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "create:block/radial_chassis_side_z"
|
"model": "create:block/radial_chassis_side_z"
|
||||||
|
|
|
@ -67,6 +67,8 @@
|
||||||
"block.create.creative_crate": "Caja del Creativo",
|
"block.create.creative_crate": "Caja del Creativo",
|
||||||
"block.create.creative_fluid_tank": "Tanque de Fluido del Creativo",
|
"block.create.creative_fluid_tank": "Tanque de Fluido del Creativo",
|
||||||
"block.create.creative_motor": "Motor del Creativo",
|
"block.create.creative_motor": "Motor del Creativo",
|
||||||
|
"block.create.crimson_window": "Ventana Carmesí",
|
||||||
|
"block.create.crimson_window_pane": "Panel de Ventana Carmesí",
|
||||||
"block.create.crushing_wheel": "Rueda Trituradora",
|
"block.create.crushing_wheel": "Rueda Trituradora",
|
||||||
"block.create.crushing_wheel_controller": "UNLOCALIZED:Crushing Wheel Controller",
|
"block.create.crushing_wheel_controller": "UNLOCALIZED:Crushing Wheel Controller",
|
||||||
"block.create.cuckoo_clock": "Reloj Cuco",
|
"block.create.cuckoo_clock": "Reloj Cuco",
|
||||||
|
@ -384,6 +386,8 @@
|
||||||
"block.create.turntable": "Mesa Giratoria",
|
"block.create.turntable": "Mesa Giratoria",
|
||||||
"block.create.vertical_framed_glass": "Vidrio Enmarcado Vertical",
|
"block.create.vertical_framed_glass": "Vidrio Enmarcado Vertical",
|
||||||
"block.create.vertical_framed_glass_pane": "Panel de Vidrio Enmarcado Vertical",
|
"block.create.vertical_framed_glass_pane": "Panel de Vidrio Enmarcado Vertical",
|
||||||
|
"block.create.warped_window": "Ventana Distorsionada",
|
||||||
|
"block.create.warped_window_pane": "Panel de ventana Distorsionada",
|
||||||
"block.create.water_wheel": "Rueda Hidráulica",
|
"block.create.water_wheel": "Rueda Hidráulica",
|
||||||
"block.create.weathered_limestone": "Caliza Meteorizada",
|
"block.create.weathered_limestone": "Caliza Meteorizada",
|
||||||
"block.create.weathered_limestone_bricks": "Ladrillos de Caliza Meteorizada",
|
"block.create.weathered_limestone_bricks": "Ladrillos de Caliza Meteorizada",
|
||||||
|
|
|
@ -67,6 +67,8 @@
|
||||||
"block.create.creative_crate": "創造板條箱",
|
"block.create.creative_crate": "創造板條箱",
|
||||||
"block.create.creative_fluid_tank": "創造液體儲存罐",
|
"block.create.creative_fluid_tank": "創造液體儲存罐",
|
||||||
"block.create.creative_motor": "創造馬達",
|
"block.create.creative_motor": "創造馬達",
|
||||||
|
"block.create.crimson_window": "赤紅窗戶",
|
||||||
|
"block.create.crimson_window_pane": "赤紅窗戶片",
|
||||||
"block.create.crushing_wheel": "粉碎輪",
|
"block.create.crushing_wheel": "粉碎輪",
|
||||||
"block.create.crushing_wheel_controller": "粉碎輪控制器",
|
"block.create.crushing_wheel_controller": "粉碎輪控制器",
|
||||||
"block.create.cuckoo_clock": "布穀鳥鐘",
|
"block.create.cuckoo_clock": "布穀鳥鐘",
|
||||||
|
@ -384,6 +386,8 @@
|
||||||
"block.create.turntable": "轉盤",
|
"block.create.turntable": "轉盤",
|
||||||
"block.create.vertical_framed_glass": "豎直邊框玻璃",
|
"block.create.vertical_framed_glass": "豎直邊框玻璃",
|
||||||
"block.create.vertical_framed_glass_pane": "豎直邊框玻璃片",
|
"block.create.vertical_framed_glass_pane": "豎直邊框玻璃片",
|
||||||
|
"block.create.warped_window": "扭曲蕈木窗戶",
|
||||||
|
"block.create.warped_window_pane": "扭曲蕈木窗戶片",
|
||||||
"block.create.water_wheel": "水車",
|
"block.create.water_wheel": "水車",
|
||||||
"block.create.weathered_limestone": "風化石灰岩",
|
"block.create.weathered_limestone": "風化石灰岩",
|
||||||
"block.create.weathered_limestone_bricks": "風化石灰岩磚",
|
"block.create.weathered_limestone_bricks": "風化石灰岩磚",
|
||||||
|
|
|
@ -708,7 +708,7 @@ public class AllBlocks {
|
||||||
boolean isFlipped = s.get(GantryShaftBlock.FACING)
|
boolean isFlipped = s.get(GantryShaftBlock.FACING)
|
||||||
.getAxisDirection() == AxisDirection.NEGATIVE;
|
.getAxisDirection() == AxisDirection.NEGATIVE;
|
||||||
String partName = s.get(GantryShaftBlock.PART)
|
String partName = s.get(GantryShaftBlock.PART)
|
||||||
.getName();
|
.getString();
|
||||||
String flipped = isFlipped ? "_flipped" : "";
|
String flipped = isFlipped ? "_flipped" : "";
|
||||||
String powered = isPowered ? "_powered" : "";
|
String powered = isPowered ? "_powered" : "";
|
||||||
ModelFile existing = AssetLookup.partialBaseModel(c, p, partName);
|
ModelFile existing = AssetLookup.partialBaseModel(c, p, partName);
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class AllSpriteShifts {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (DyeColor color : DyeColor.values()) {
|
for (DyeColor color : DyeColor.values()) {
|
||||||
String id = color.getName();
|
String id = color.getString();
|
||||||
DYED_BELTS.put(color, SpriteShifter.get("block/belt", "block/belt/" + id));
|
DYED_BELTS.put(color, SpriteShifter.get("block/belt", "block/belt/" + id));
|
||||||
DYED_OFFSET_BELTS.put(color, SpriteShifter.get("block/belt_offset", "block/belt/" + id));
|
DYED_OFFSET_BELTS.put(color, SpriteShifter.get("block/belt_offset", "block/belt/" + id));
|
||||||
DYED_DIAGONAL_BELTS.put(color, SpriteShifter.get("block/belt_diagonal", "block/belt/" + id + "_diagonal"));
|
DYED_DIAGONAL_BELTS.put(color, SpriteShifter.get("block/belt_diagonal", "block/belt/" + id + "_diagonal"));
|
||||||
|
|
|
@ -13,6 +13,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.tra
|
||||||
import com.simibubi.create.content.logistics.RedstoneLinkNetworkHandler;
|
import com.simibubi.create.content.logistics.RedstoneLinkNetworkHandler;
|
||||||
import com.simibubi.create.content.palettes.AllPaletteBlocks;
|
import com.simibubi.create.content.palettes.AllPaletteBlocks;
|
||||||
import com.simibubi.create.content.palettes.PalettesItemGroup;
|
import com.simibubi.create.content.palettes.PalettesItemGroup;
|
||||||
|
import com.simibubi.create.content.schematics.SchematicProcessor;
|
||||||
import com.simibubi.create.content.schematics.ServerSchematicLoader;
|
import com.simibubi.create.content.schematics.ServerSchematicLoader;
|
||||||
import com.simibubi.create.content.schematics.filtering.SchematicInstances;
|
import com.simibubi.create.content.schematics.filtering.SchematicInstances;
|
||||||
import com.simibubi.create.foundation.advancement.AllAdvancements;
|
import com.simibubi.create.foundation.advancement.AllAdvancements;
|
||||||
|
@ -114,6 +115,10 @@ public class Create {
|
||||||
|
|
||||||
AllPackets.registerPackets();
|
AllPackets.registerPackets();
|
||||||
AllTriggers.register();
|
AllTriggers.register();
|
||||||
|
|
||||||
|
event.enqueueWork(() -> {
|
||||||
|
SchematicProcessor.register();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onBiomeLoad(BiomeLoadingEvent event) {
|
public static void onBiomeLoad(BiomeLoadingEvent event) {
|
||||||
|
|
|
@ -89,11 +89,8 @@ public abstract class KineticBlock extends Block implements IRotate {
|
||||||
@Override
|
@Override
|
||||||
public abstract TileEntity createTileEntity(BlockState state, IBlockReader world);
|
public abstract TileEntity createTileEntity(BlockState state, IBlockReader world);
|
||||||
|
|
||||||
// TODO 1.16 is this the right replacement for updateNeighbors?
|
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
|
||||||
public void updateDiagonalNeighbors(BlockState stateIn, IWorld worldIn, BlockPos pos, int flags, int count) {
|
public void updateDiagonalNeighbors(BlockState stateIn, IWorld worldIn, BlockPos pos, int flags, int count) {
|
||||||
super.updateDiagonalNeighbors(stateIn, worldIn, pos, flags, count);
|
|
||||||
if (worldIn.isRemote())
|
if (worldIn.isRemote())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,8 @@ public class EncasedFanBlock extends DirectionalKineticBlock implements ITE<Enca
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateNeighbors(BlockState stateIn, IWorld worldIn, BlockPos pos, int flags) {
|
public void updateDiagonalNeighbors(BlockState stateIn, IWorld worldIn, BlockPos pos, int flags, int count) {
|
||||||
super.updateNeighbors(stateIn, worldIn, pos, flags);
|
super.updateDiagonalNeighbors(stateIn, worldIn, pos, flags, count);
|
||||||
blockUpdate(stateIn, worldIn, pos);
|
blockUpdate(stateIn, worldIn, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity {
|
||||||
|
|
||||||
for (ItemEntity itemEntity : world.getEntitiesWithinAABB(ItemEntity.class,
|
for (ItemEntity itemEntity : world.getEntitiesWithinAABB(ItemEntity.class,
|
||||||
new AxisAlignedBB(pos.down()).shrink(.125f))) {
|
new AxisAlignedBB(pos.down()).shrink(.125f))) {
|
||||||
if (!itemEntity.isAlive() || !itemEntity.onGround)
|
if (!itemEntity.isAlive() || !itemEntity.isOnGround())
|
||||||
continue;
|
continue;
|
||||||
ItemStack stack = itemEntity.getItem();
|
ItemStack stack = itemEntity.getItem();
|
||||||
Optional<PressingRecipe> recipe = getRecipe(stack);
|
Optional<PressingRecipe> recipe = getRecipe(stack);
|
||||||
|
@ -236,7 +236,7 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity {
|
||||||
for (Entity entity : world.getEntitiesWithinAABBExcludingEntity(null, bb)) {
|
for (Entity entity : world.getEntitiesWithinAABBExcludingEntity(null, bb)) {
|
||||||
if (!(entity instanceof ItemEntity))
|
if (!(entity instanceof ItemEntity))
|
||||||
continue;
|
continue;
|
||||||
if (!entity.isAlive() || !entity.onGround)
|
if (!entity.isAlive() || !entity.isOnGround())
|
||||||
continue;
|
continue;
|
||||||
ItemEntity itemEntity = (ItemEntity) entity;
|
ItemEntity itemEntity = (ItemEntity) entity;
|
||||||
pressedItems.add(itemEntity.getItem());
|
pressedItems.add(itemEntity.getItem());
|
||||||
|
|
|
@ -21,7 +21,7 @@ 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.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.vector.Vector3d;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
@ -57,7 +57,7 @@ public class GantryContraptionEntity extends AbstractContraptionEntity {
|
||||||
|
|
||||||
checkPinionShaft();
|
checkPinionShaft();
|
||||||
tickActors();
|
tickActors();
|
||||||
Vec3d movementVec = getMotion();
|
Vector3d movementVec = getMotion();
|
||||||
|
|
||||||
if (ContraptionCollider.collideBlocks(this)) {
|
if (ContraptionCollider.collideBlocks(this)) {
|
||||||
if (!world.isRemote)
|
if (!world.isRemote)
|
||||||
|
@ -73,15 +73,15 @@ public class GantryContraptionEntity extends AbstractContraptionEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void checkPinionShaft() {
|
protected void checkPinionShaft() {
|
||||||
Vec3d movementVec;
|
Vector3d movementVec;
|
||||||
Direction facing = ((GantryContraption) contraption).getFacing();
|
Direction facing = ((GantryContraption) contraption).getFacing();
|
||||||
Vec3d currentPosition = getAnchorVec().add(.5, .5, .5);
|
Vector3d currentPosition = getAnchorVec().add(.5, .5, .5);
|
||||||
BlockPos gantryShaftPos = new BlockPos(currentPosition).offset(facing.getOpposite());
|
BlockPos gantryShaftPos = new BlockPos(currentPosition).offset(facing.getOpposite());
|
||||||
|
|
||||||
TileEntity te = world.getTileEntity(gantryShaftPos);
|
TileEntity te = world.getTileEntity(gantryShaftPos);
|
||||||
if (!(te instanceof GantryShaftTileEntity) || !AllBlocks.GANTRY_SHAFT.has(te.getBlockState())) {
|
if (!(te instanceof GantryShaftTileEntity) || !AllBlocks.GANTRY_SHAFT.has(te.getBlockState())) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
setContraptionMotion(Vec3d.ZERO);
|
setContraptionMotion(Vector3d.ZERO);
|
||||||
disassemble();
|
disassemble();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -92,16 +92,16 @@ public class GantryContraptionEntity extends AbstractContraptionEntity {
|
||||||
GantryShaftTileEntity gantryShaftTileEntity = (GantryShaftTileEntity) te;
|
GantryShaftTileEntity gantryShaftTileEntity = (GantryShaftTileEntity) te;
|
||||||
|
|
||||||
float pinionMovementSpeed = gantryShaftTileEntity.getPinionMovementSpeed();
|
float pinionMovementSpeed = gantryShaftTileEntity.getPinionMovementSpeed();
|
||||||
movementVec = new Vec3d(direction.getDirectionVec()).scale(pinionMovementSpeed);
|
movementVec = Vector3d.of(direction.getDirectionVec()).scale(pinionMovementSpeed);
|
||||||
|
|
||||||
if (blockState.get(GantryShaftBlock.POWERED) || pinionMovementSpeed == 0) {
|
if (blockState.get(GantryShaftBlock.POWERED) || pinionMovementSpeed == 0) {
|
||||||
setContraptionMotion(Vec3d.ZERO);
|
setContraptionMotion(Vector3d.ZERO);
|
||||||
if (!world.isRemote)
|
if (!world.isRemote)
|
||||||
disassemble();
|
disassemble();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vec3d nextPosition = currentPosition.add(movementVec);
|
Vector3d nextPosition = currentPosition.add(movementVec);
|
||||||
double currentCoord = direction.getAxis()
|
double currentCoord = direction.getAxis()
|
||||||
.getCoordinate(currentPosition.x, currentPosition.y, currentPosition.z);
|
.getCoordinate(currentPosition.x, currentPosition.y, currentPosition.z);
|
||||||
double nextCoord = direction.getAxis()
|
double nextCoord = direction.getAxis()
|
||||||
|
@ -110,7 +110,7 @@ public class GantryContraptionEntity extends AbstractContraptionEntity {
|
||||||
if ((MathHelper.floor(currentCoord) + .5f < nextCoord != (pinionMovementSpeed * direction.getAxisDirection()
|
if ((MathHelper.floor(currentCoord) + .5f < nextCoord != (pinionMovementSpeed * direction.getAxisDirection()
|
||||||
.getOffset() < 0)))
|
.getOffset() < 0)))
|
||||||
if (!gantryShaftTileEntity.canAssembleOn()) {
|
if (!gantryShaftTileEntity.canAssembleOn()) {
|
||||||
setContraptionMotion(Vec3d.ZERO);
|
setContraptionMotion(Vector3d.ZERO);
|
||||||
if (!world.isRemote)
|
if (!world.isRemote)
|
||||||
disassemble();
|
disassemble();
|
||||||
return;
|
return;
|
||||||
|
@ -135,12 +135,12 @@ public class GantryContraptionEntity extends AbstractContraptionEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Vec3d applyRotation(Vec3d localPos, float partialTicks) {
|
public Vector3d applyRotation(Vector3d localPos, float partialTicks) {
|
||||||
return localPos;
|
return localPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Vec3d reverseRotation(Vec3d localPos, float partialTicks) {
|
public Vector3d reverseRotation(Vector3d localPos, float partialTicks) {
|
||||||
return localPos;
|
return localPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,12 +175,12 @@ public class GantryContraptionEntity extends AbstractContraptionEntity {
|
||||||
public void updateClientMotion() {
|
public void updateClientMotion() {
|
||||||
float modifier = movementAxis.getAxisDirection()
|
float modifier = movementAxis.getAxisDirection()
|
||||||
.getOffset();
|
.getOffset();
|
||||||
setContraptionMotion(new Vec3d(movementAxis.getDirectionVec())
|
setContraptionMotion(Vector3d.of(movementAxis.getDirectionVec())
|
||||||
.scale((axisMotion + clientOffsetDiff * modifier / 2f) * ServerSpeedProvider.get()));
|
.scale((axisMotion + clientOffsetDiff * modifier / 2f) * ServerSpeedProvider.get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getAxisCoord() {
|
public double getAxisCoord() {
|
||||||
Vec3d anchorVec = getAnchorVec();
|
Vector3d anchorVec = getAnchorVec();
|
||||||
return movementAxis.getAxis()
|
return movementAxis.getAxis()
|
||||||
.getCoordinate(anchorVec.x, anchorVec.y, anchorVec.z);
|
.getCoordinate(anchorVec.x, anchorVec.y, anchorVec.z);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,8 @@ public class GantryPinionBlock extends DirectionalAxisKineticBlock implements IT
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateNeighbors(BlockState stateIn, IWorld worldIn, BlockPos pos, int flags) {
|
public void updateDiagonalNeighbors(BlockState stateIn, IWorld worldIn, BlockPos pos, int flags, int count) {
|
||||||
super.updateNeighbors(stateIn, worldIn, pos, flags);
|
super.updateDiagonalNeighbors(stateIn, worldIn, pos, flags, count);
|
||||||
withTileEntityDo(worldIn, pos, GantryPinionTileEntity::checkValidGantryShaft);
|
withTileEntityDo(worldIn, pos, GantryPinionTileEntity::checkValidGantryShaft);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,12 @@ import com.simibubi.create.foundation.utility.MatrixStacker;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.client.renderer.Vector3f;
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.Direction.Axis;
|
import net.minecraft.util.Direction.Axis;
|
||||||
import net.minecraft.util.Direction.AxisDirection;
|
import net.minecraft.util.Direction.AxisDirection;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.vector.Vector3f;
|
||||||
|
|
||||||
public class GantryPinionRenderer extends KineticTileEntityRenderer {
|
public class GantryPinionRenderer extends KineticTileEntityRenderer {
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraftforge.common.ForgeMod;
|
||||||
import net.minecraftforge.fml.network.NetworkEvent.Context;
|
import net.minecraftforge.fml.network.NetworkEvent.Context;
|
||||||
|
|
||||||
public class ContraptionInteractionPacket extends SimplePacketBase {
|
public class ContraptionInteractionPacket extends SimplePacketBase {
|
||||||
|
@ -54,7 +55,7 @@ public class ContraptionInteractionPacket extends SimplePacketBase {
|
||||||
if (!(entityByID instanceof AbstractContraptionEntity))
|
if (!(entityByID instanceof AbstractContraptionEntity))
|
||||||
return;
|
return;
|
||||||
AbstractContraptionEntity contraptionEntity = (AbstractContraptionEntity) entityByID;
|
AbstractContraptionEntity contraptionEntity = (AbstractContraptionEntity) entityByID;
|
||||||
double d = sender.getAttribute(PlayerEntity.REACH_DISTANCE).getValue();
|
double d = sender.getAttribute(ForgeMod.REACH_DISTANCE.get()).getValue();
|
||||||
if (!sender.canEntityBeSeen(entityByID))
|
if (!sender.canEntityBeSeen(entityByID))
|
||||||
d -= 3;
|
d -= 3;
|
||||||
d *= d;
|
d *= d;
|
||||||
|
|
|
@ -18,7 +18,7 @@ import net.minecraft.item.BlockItemUseContext;
|
||||||
import net.minecraft.item.ItemUseContext;
|
import net.minecraft.item.ItemUseContext;
|
||||||
import net.minecraft.state.BooleanProperty;
|
import net.minecraft.state.BooleanProperty;
|
||||||
import net.minecraft.state.EnumProperty;
|
import net.minecraft.state.EnumProperty;
|
||||||
import net.minecraft.state.IProperty;
|
import net.minecraft.state.Property;
|
||||||
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;
|
||||||
|
@ -36,14 +36,14 @@ import net.minecraft.world.World;
|
||||||
|
|
||||||
public class GantryShaftBlock extends DirectionalKineticBlock {
|
public class GantryShaftBlock extends DirectionalKineticBlock {
|
||||||
|
|
||||||
public static final IProperty<Part> PART = EnumProperty.create("part", Part.class);
|
public static final Property<Part> PART = EnumProperty.create("part", Part.class);
|
||||||
public static final BooleanProperty POWERED = BlockStateProperties.POWERED;
|
public static final BooleanProperty POWERED = BlockStateProperties.POWERED;
|
||||||
|
|
||||||
public enum Part implements IStringSerializable {
|
public enum Part implements IStringSerializable {
|
||||||
START, MIDDLE, END, SINGLE;
|
START, MIDDLE, END, SINGLE;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getString() {
|
||||||
return Lang.asId(name());
|
return Lang.asId(name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -478,7 +478,7 @@ public class BeltTileEntity extends KineticTileEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canPropagateDiagonally(IRotate block, BlockState state) {
|
protected boolean canPropagateDiagonally(IRotate block, BlockState state) {
|
||||||
return state.has(BeltBlock.SLOPE)
|
return state.contains(BeltBlock.SLOPE)
|
||||||
&& (state.get(BeltBlock.SLOPE) == BeltSlope.UPWARD || state.get(BeltBlock.SLOPE) == BeltSlope.DOWNWARD);
|
&& (state.get(BeltBlock.SLOPE) == BeltSlope.UPWARD || state.get(BeltBlock.SLOPE) == BeltSlope.DOWNWARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class EncasedBeltBlock extends RotatedPillarKineticBlock {
|
||||||
// .updateNeighbors(context.getWorld(), context.getPos(), 1);
|
// .updateNeighbors(context.getWorld(), context.getPos(), 1);
|
||||||
Axis axis = newState.get(AXIS);
|
Axis axis = newState.get(AXIS);
|
||||||
newState = getDefaultState().with(AXIS, axis);
|
newState = getDefaultState().with(AXIS, axis);
|
||||||
if (newState.has(BlockStateProperties.POWERED))
|
if (newState.contains(BlockStateProperties.POWERED))
|
||||||
newState = newState.with(BlockStateProperties.POWERED, context.getWorld()
|
newState = newState.with(BlockStateProperties.POWERED, context.getWorld()
|
||||||
.isBlockPowered(context.getPos()));
|
.isBlockPowered(context.getPos()));
|
||||||
for (Direction facing : Iterate.directions) {
|
for (Direction facing : Iterate.directions) {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.entity.player.ServerPlayerEntity;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.math.vector.Vector3d;
|
import net.minecraft.util.math.vector.Vector3d;
|
||||||
|
import net.minecraftforge.common.ForgeMod;
|
||||||
import net.minecraftforge.fml.network.NetworkEvent.Context;
|
import net.minecraftforge.fml.network.NetworkEvent.Context;
|
||||||
|
|
||||||
public class ExtendoGripInteractionPacket extends SimplePacketBase {
|
public class ExtendoGripInteractionPacket extends SimplePacketBase {
|
||||||
|
@ -60,7 +61,7 @@ public class ExtendoGripInteractionPacket extends SimplePacketBase {
|
||||||
return;
|
return;
|
||||||
Entity entityByID = sender.getServerWorld().getEntityByID(target);
|
Entity entityByID = sender.getServerWorld().getEntityByID(target);
|
||||||
if (entityByID != null && ExtendoGripItem.isHoldingExtendoGrip(sender)) {
|
if (entityByID != null && ExtendoGripItem.isHoldingExtendoGrip(sender)) {
|
||||||
double d = sender.getAttribute(PlayerEntity.REACH_DISTANCE).getValue();
|
double d = sender.getAttribute(ForgeMod.REACH_DISTANCE.get()).getValue();
|
||||||
if (!sender.canEntityBeSeen(entityByID))
|
if (!sender.canEntityBeSeen(entityByID))
|
||||||
d -= 3;
|
d -= 3;
|
||||||
d *= d;
|
d *= d;
|
||||||
|
|
|
@ -7,15 +7,15 @@ import com.simibubi.create.foundation.utility.VecHelper;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.Direction.Axis;
|
import net.minecraft.util.Direction.Axis;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.vector.Vector3d;
|
||||||
|
|
||||||
public class SmartChuteFilterSlotPositioning extends ValueBoxTransform.Sided {
|
public class SmartChuteFilterSlotPositioning extends ValueBoxTransform.Sided {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Vec3d getLocalOffset(BlockState state) {
|
protected Vector3d getLocalOffset(BlockState state) {
|
||||||
Direction side = getSide();
|
Direction side = getSide();
|
||||||
float horizontalAngle = AngleHelper.horizontalAngle(side);
|
float horizontalAngle = AngleHelper.horizontalAngle(side);
|
||||||
Vec3d southLocation = VecHelper.voxelSpace(8, 12, 15.5f);
|
Vector3d southLocation = VecHelper.voxelSpace(8, 12, 15.5f);
|
||||||
return VecHelper.rotateCentered(southLocation, horizontalAngle, Axis.Y);
|
return VecHelper.rotateCentered(southLocation, horizontalAngle, Axis.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ public class SmartChuteFilterSlotPositioning extends ValueBoxTransform.Sided {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Vec3d getSouthLocation() {
|
protected Vector3d getSouthLocation() {
|
||||||
return Vec3d.ZERO;
|
return Vector3d.ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class SmartChuteTileEntity extends ChuteTileEntity {
|
||||||
@Override
|
@Override
|
||||||
protected boolean canCollectItemsFromBelow() {
|
protected boolean canCollectItemsFromBelow() {
|
||||||
BlockState blockState = getBlockState();
|
BlockState blockState = getBlockState();
|
||||||
return blockState.has(SmartChuteBlock.POWERED) && !blockState.get(SmartChuteBlock.POWERED);
|
return blockState.contains(SmartChuteBlock.POWERED) && !blockState.get(SmartChuteBlock.POWERED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,128 +0,0 @@
|
||||||
package com.simibubi.create.content.logistics.block.funnel;
|
|
||||||
|
|
||||||
import com.simibubi.create.AllTileEntities;
|
|
||||||
import com.simibubi.create.content.contraptions.wrench.IWrenchable;
|
|
||||||
import com.tterrag.registrate.util.entry.BlockEntry;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.block.HorizontalBlock;
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
|
||||||
import net.minecraft.item.BlockItemUseContext;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.ItemUseContext;
|
|
||||||
import net.minecraft.state.BooleanProperty;
|
|
||||||
import net.minecraft.state.StateContainer.Builder;
|
|
||||||
import net.minecraft.state.properties.BlockStateProperties;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.ActionResultType;
|
|
||||||
import net.minecraft.util.Direction;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
|
||||||
import net.minecraft.world.IBlockReader;
|
|
||||||
import net.minecraft.world.IWorld;
|
|
||||||
import net.minecraft.world.IWorldReader;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public abstract class HorizontalInteractionFunnelBlock extends HorizontalBlock implements IWrenchable {
|
|
||||||
|
|
||||||
public static final BooleanProperty POWERED = BlockStateProperties.POWERED;
|
|
||||||
public static final BooleanProperty PUSHING = BooleanProperty.create("pushing");
|
|
||||||
private BlockEntry<? extends FunnelBlock> parent;
|
|
||||||
|
|
||||||
public HorizontalInteractionFunnelBlock(BlockEntry<? extends FunnelBlock> parent, Properties p_i48377_1_) {
|
|
||||||
super(p_i48377_1_);
|
|
||||||
this.parent = parent;
|
|
||||||
BlockState defaultState = getDefaultState().with(PUSHING, true);
|
|
||||||
if (hasPoweredProperty())
|
|
||||||
defaultState = defaultState.with(POWERED, false);
|
|
||||||
setDefaultState(defaultState);
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract boolean hasPoweredProperty();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasTileEntity(BlockState state) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
|
||||||
return AllTileEntities.FUNNEL.create();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void fillStateContainer(Builder<Block, BlockState> p_206840_1_) {
|
|
||||||
if (hasPoweredProperty())
|
|
||||||
p_206840_1_.add(POWERED);
|
|
||||||
super.fillStateContainer(p_206840_1_.add(HORIZONTAL_FACING, PUSHING));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState getStateForPlacement(BlockItemUseContext ctx) {
|
|
||||||
BlockState stateForPlacement = super.getStateForPlacement(ctx);
|
|
||||||
if (hasPoweredProperty())
|
|
||||||
stateForPlacement = stateForPlacement.with(POWERED, ctx.getWorld()
|
|
||||||
.isBlockPowered(ctx.getPos()));
|
|
||||||
return stateForPlacement;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReplaced(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_,
|
|
||||||
boolean p_196243_5_) {
|
|
||||||
if (p_196243_1_.hasTileEntity()
|
|
||||||
&& (p_196243_1_.getBlock() != p_196243_4_.getBlock() && !FunnelBlock.isFunnel(p_196243_4_)
|
|
||||||
|| !p_196243_4_.hasTileEntity())) {
|
|
||||||
p_196243_2_.removeTileEntity(p_196243_3_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos,
|
|
||||||
PlayerEntity player) {
|
|
||||||
return parent.asStack();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState updatePostPlacement(BlockState state, Direction direction, BlockState neighbour, IWorld world,
|
|
||||||
BlockPos pos, BlockPos p_196271_6_) {
|
|
||||||
if (!canStillInteract(state, world, pos)) {
|
|
||||||
BlockState parentState = parent.getDefaultState();
|
|
||||||
if (state.method_28500(POWERED).orElse(false))
|
|
||||||
parentState = parentState.with(POWERED, true);
|
|
||||||
return parentState.with(FunnelBlock.FACING, state.get(HORIZONTAL_FACING));
|
|
||||||
}
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isValidPosition(BlockState state, IWorldReader world, BlockPos pos) {
|
|
||||||
return !world.getBlockState(pos.offset(state.get(HORIZONTAL_FACING)
|
|
||||||
.getOpposite()))
|
|
||||||
.getShape(world, pos)
|
|
||||||
.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract boolean canStillInteract(BlockState state, IWorldReader world, BlockPos pos);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void neighborChanged(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos,
|
|
||||||
boolean isMoving) {
|
|
||||||
if (!hasPoweredProperty())
|
|
||||||
return;
|
|
||||||
if (worldIn.isRemote)
|
|
||||||
return;
|
|
||||||
boolean previouslyPowered = state.get(POWERED);
|
|
||||||
if (previouslyPowered != worldIn.isBlockPowered(pos))
|
|
||||||
worldIn.setBlockState(pos, state.cycle(POWERED), 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ActionResultType onWrenched(BlockState state, ItemUseContext context) {
|
|
||||||
if (!context.getWorld().isRemote)
|
|
||||||
context.getWorld()
|
|
||||||
.setBlockState(context.getPos(), state.cycle(PUSHING));
|
|
||||||
return ActionResultType.SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,7 +1,10 @@
|
||||||
package com.simibubi.create.content.schematics;
|
package com.simibubi.create.content.schematics;
|
||||||
|
|
||||||
import com.mojang.datafixers.Dynamic;
|
import java.util.Optional;
|
||||||
import com.mojang.datafixers.types.DynamicOps;
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.mojang.serialization.Codec;
|
||||||
import com.simibubi.create.foundation.utility.NBTProcessors;
|
import com.simibubi.create.foundation.utility.NBTProcessors;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
@ -16,15 +19,22 @@ import net.minecraft.world.gen.feature.template.PlacementSettings;
|
||||||
import net.minecraft.world.gen.feature.template.StructureProcessor;
|
import net.minecraft.world.gen.feature.template.StructureProcessor;
|
||||||
import net.minecraft.world.gen.feature.template.Template;
|
import net.minecraft.world.gen.feature.template.Template;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class SchematicProcessor extends StructureProcessor {
|
public class SchematicProcessor extends StructureProcessor {
|
||||||
|
|
||||||
public static final SchematicProcessor INSTANCE = new SchematicProcessor();
|
public static final SchematicProcessor INSTANCE = new SchematicProcessor();
|
||||||
|
public static final Codec<SchematicProcessor> CODEC = Codec.unit(() -> {
|
||||||
|
return INSTANCE;
|
||||||
|
});
|
||||||
|
|
||||||
|
public static IStructureProcessorType<SchematicProcessor> TYPE;
|
||||||
|
|
||||||
|
public static void register() {
|
||||||
|
TYPE = IStructureProcessorType.register("schematic", CODEC);
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public Template.BlockInfo process(IWorldReader world, BlockPos pos, Template.BlockInfo rawInfo,
|
public Template.BlockInfo process(IWorldReader world, BlockPos pos, BlockPos anotherPos, Template.BlockInfo rawInfo,
|
||||||
Template.BlockInfo info, PlacementSettings settings, @Nullable Template template) {
|
Template.BlockInfo info, PlacementSettings settings, @Nullable Template template) {
|
||||||
if (info.nbt != null) {
|
if (info.nbt != null) {
|
||||||
TileEntity te = info.state.createTileEntity(world);
|
TileEntity te = info.state.createTileEntity(world);
|
||||||
|
@ -53,12 +63,8 @@ public class SchematicProcessor extends StructureProcessor {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected IStructureProcessorType getType() {
|
protected IStructureProcessorType<?> getType() {
|
||||||
return dynamic -> INSTANCE;
|
return TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected <T> Dynamic<T> serialize0(DynamicOps<T> ops) {
|
|
||||||
return new Dynamic<>(ops, ops.emptyMap());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,11 +61,7 @@ public class SchematicInstances {
|
||||||
.getCompound("Anchor"));
|
.getCompound("Anchor"));
|
||||||
SchematicWorld world = new SchematicWorld(anchor, wrapped);
|
SchematicWorld world = new SchematicWorld(anchor, wrapped);
|
||||||
PlacementSettings settings = SchematicItem.getSettings(schematic);
|
PlacementSettings settings = SchematicItem.getSettings(schematic);
|
||||||
activeTemplate.addBlocksToWorld(world, anchor, settings);
|
activeTemplate.place(world, anchor, settings, wrapped.getRandom());
|
||||||
|
|
||||||
Debug.debugChat("Loading Schematic Instance of " + schematic.getTag()
|
|
||||||
.getString("File") + ". Total active instances: " + (loadedSchematics.get(wrapped).size() + 1));
|
|
||||||
|
|
||||||
|
|
||||||
return world;
|
return world;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"pack": {
|
"pack": {
|
||||||
"description": "create resources",
|
"description": "create resources",
|
||||||
"pack_format": 5
|
"pack_format": 6
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue