diff --git a/src/main/java/com/simibubi/create/foundation/behaviour/ValueBoxRenderer.java b/src/main/java/com/simibubi/create/foundation/behaviour/ValueBoxRenderer.java index b7057e27f..9be26177d 100644 --- a/src/main/java/com/simibubi/create/foundation/behaviour/ValueBoxRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/behaviour/ValueBoxRenderer.java @@ -32,7 +32,7 @@ import net.minecraft.util.math.Vec3d; @SuppressWarnings("deprecation") public class ValueBoxRenderer { - @Deprecated // TODO 1.15 buffered rendering + @Deprecated // TODO 1.15 buffered render public static void renderBox(ValueBox box, boolean highlighted) { RenderSystem.enableBlend(); RenderSystem.blendFuncSeparate(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA, SourceFactor.ONE, diff --git a/src/main/java/com/simibubi/create/foundation/block/render/ColoredVertexModel.java b/src/main/java/com/simibubi/create/foundation/block/render/ColoredVertexModel.java index 81d660ca9..5f6ed7714 100644 --- a/src/main/java/com/simibubi/create/foundation/block/render/ColoredVertexModel.java +++ b/src/main/java/com/simibubi/create/foundation/block/render/ColoredVertexModel.java @@ -57,7 +57,7 @@ public class ColoredVertexModel extends BakedModelWrapper { // continue; for (int vertex = 0; vertex < vertexData.length; vertex += format.getIntegerSize()) { - int colorOffset = 16 / 4; // TODO 1.15 is this the right offset + int colorOffset = 16 / 4; // TODO 1.15 is this the right offset? float x = Float.intBitsToFloat(vertexData[vertex]); float y = Float.intBitsToFloat(vertexData[vertex + 1]); float z = Float.intBitsToFloat(vertexData[vertex + 2]); diff --git a/src/main/java/com/simibubi/create/foundation/gui/ScreenElementRenderer.java b/src/main/java/com/simibubi/create/foundation/gui/ScreenElementRenderer.java index 768d54e3c..71caa68bb 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/ScreenElementRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/gui/ScreenElementRenderer.java @@ -31,7 +31,7 @@ public class ScreenElementRenderer { RenderSystem.enableBlend(); RenderSystem.enableRescaleNormal(); RenderSystem.enableAlphaTest(); - RenderHelper.enableGuiDepthLighting(); // TODO 1.15 + RenderHelper.enableGuiDepthLighting(); // TODO 1.15 buffered render RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); ItemStack stack = transformsAndStack.get(); @@ -59,7 +59,7 @@ public class ScreenElementRenderer { RenderSystem.enableBlend(); RenderSystem.enableRescaleNormal(); RenderSystem.enableAlphaTest(); - RenderHelper.enableGuiDepthLighting(); // TODO 1.15 + RenderHelper.enableGuiDepthLighting(); // TODO 1.15 buffered render RenderSystem.alphaFunc(516, 0.1F); RenderSystem.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); diff --git a/src/main/java/com/simibubi/create/foundation/utility/SuperByteBuffer.java b/src/main/java/com/simibubi/create/foundation/utility/SuperByteBuffer.java index 4dd93b679..f1a839a34 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/SuperByteBuffer.java +++ b/src/main/java/com/simibubi/create/foundation/utility/SuperByteBuffer.java @@ -101,7 +101,7 @@ public class SuperByteBuffer { if (original.limit() == 0) return; if (!(buffer instanceof BufferBuilder)) { - // TODO add "slow" path that writes all the data instead of using bulk put + // TODO 1.15 add "slow" path that writes all the data instead of using bulk put throw new IllegalArgumentException("Unsupported buffer type!"); } ((BufferBuilder)buffer).putBulkData(build(input)); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java index 14e0b9495..486f97d9e 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java @@ -104,7 +104,7 @@ public abstract class KineticBlock extends Block implements IRotate { RotationPropagator.handleAdded(worldIn.getWorld(), pos, tileEntity); } -// @Override // TODO register layer +// @Override // TODO 1.15 register layer // public boolean canRenderInLayer(BlockState state, BlockRenderLayer layer) { // return hasStaticPart() && layer == getRenderLayer(); // } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/clock/CuckooClockRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/components/clock/CuckooClockRenderer.java index e5ce0f9fe..977ad0c2a 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/clock/CuckooClockRenderer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/clock/CuckooClockRenderer.java @@ -33,7 +33,7 @@ public class CuckooClockRenderer extends KineticTileEntityRenderer { CuckooClockTileEntity clock = (CuckooClockTileEntity) te; BlockState blockState = te.getBlockState(); - int packedLightmapCoords = blockState.getPackedLightmapCoords(te.getWorld(), te.getPos()); + int packedLightmapCoords =WorldRenderer.getLightmapCoordinates(te.getWorld(), blockState, te.getPos()); Direction direction = blockState.get(CuckooClockBlock.HORIZONTAL_FACING); IVertexBuilder vb = buffer.getBuffer(RenderType.getSolid()); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/Contraption.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/Contraption.java index 84dd90e5f..2ed6ecef1 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/Contraption.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/Contraption.java @@ -37,13 +37,14 @@ import net.minecraft.block.Blocks; import net.minecraft.block.ChestBlock; import net.minecraft.block.DoorBlock; import net.minecraft.block.SlimeBlock; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.RenderTypeLookup; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.ListNBT; import net.minecraft.nbt.NBTUtil; import net.minecraft.state.properties.ChestType; import net.minecraft.state.properties.DoubleBlockHalf; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; @@ -270,8 +271,7 @@ public abstract class Contraption { if (world.isRemote) { Block block = info.state.getBlock(); - BlockRenderLayer renderLayer = block.getRenderLayer(); - if (renderLayer == BlockRenderLayer.TRANSLUCENT) + if (RenderTypeLookup.canRenderInLayer(info.state, RenderType.getTranslucent())) renderOrder.add(info.pos); else renderOrder.add(0, info.pos); @@ -284,7 +284,7 @@ public abstract class Contraption { tag.putInt("z", info.pos.getZ()); TileEntity te = TileEntity.create(tag); - te.setWorld(new WrappedWorld(world) { + te.setLocation(new WrappedWorld(world) { @Override public BlockState getBlockState(BlockPos pos) { @@ -293,7 +293,7 @@ public abstract class Contraption { return info.state; } - }); + }, te.getPos()); if (te instanceof KineticTileEntity) ((KineticTileEntity) te).setSpeed(0); te.getBlockState(); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ContraptionRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ContraptionRenderer.java index 09203f4bc..bef766dcb 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ContraptionRenderer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ContraptionRenderer.java @@ -47,7 +47,7 @@ public class ContraptionRenderer { protected static LightingWorld lightingWorld; public static void render(World world, Contraption c, Consumer transform, MatrixStack ms, BufferBuilder buffer) { - SuperByteBuffer contraptionBuffer = CreateClient.bufferCache.get(CONTRAPTION, c, () -> renderContraption(c)); + SuperByteBuffer contraptionBuffer = CreateClient.bufferCache.get(CONTRAPTION, c, () -> renderContraption(c, ms)); transform.accept(contraptionBuffer); contraptionBuffer.light((lx, ly, lz) -> getLight(world, lx, ly, lz)).renderInto(ms, buffer); renderActors(world, c, transform, ms, buffer); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java index e11ca9928..b7682a3e4 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java @@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.particles.ParticleTypes; import net.minecraft.state.BooleanProperty; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Hand; import net.minecraft.util.Mirror; @@ -38,7 +39,7 @@ public abstract class AbstractChassisBlock extends RotatedPillarBlock { } @Override - public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, + public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!player.isAllowEdit()) return false; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/MechanicalPistonBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/MechanicalPistonBlock.java index e22d7d932..bbd56e6ac 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/MechanicalPistonBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/MechanicalPistonBlock.java @@ -52,7 +52,7 @@ public class MechanicalPistonBlock extends DirectionalAxisKineticBlock } @Override - public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, + public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!player.isAllowEdit()) return false; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/pulley/PulleyBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/pulley/PulleyBlock.java index 2f4e36170..54681a560 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/pulley/PulleyBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/pulley/PulleyBlock.java @@ -13,6 +13,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.state.EnumProperty; 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.Direction.Axis; import net.minecraft.util.Hand; @@ -42,7 +43,7 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements IWithTile } @Override - public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, + public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!player.isAllowEdit()) return false; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/pulley/PulleyRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/pulley/PulleyRenderer.java index 27d95a524..1b26d0447 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/pulley/PulleyRenderer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/pulley/PulleyRenderer.java @@ -13,6 +13,7 @@ import com.simibubi.create.modules.contraptions.components.contraptions.Contrapt import net.minecraft.block.BlockState; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.Direction; import net.minecraft.util.Direction.AxisDirection; @@ -69,7 +70,7 @@ public class PulleyRenderer extends KineticTileEntityRenderer { public void renderAt(IWorld world, SuperByteBuffer partial, float offset, BlockPos pulleyPos, MatrixStack ms, IVertexBuilder buffer) { BlockPos actualPos = pulleyPos.down((int) offset); - int light = world.getBlockState(actualPos).getPackedLightmapCoords(world, actualPos); + int light = WorldRenderer.getLightmapCoordinates(world, world.getBlockState(actualPos), actualPos); partial.translate(0, -offset, 0).light(light).renderInto(ms, buffer); } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterBlock.java index d7db989e0..edf2e1795 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterBlock.java @@ -23,7 +23,6 @@ import net.minecraft.state.EnumProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResultType; -import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; @@ -160,7 +159,7 @@ public class MechanicalCrafterBlock extends HorizontalKineticBlock } @Override - public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, + public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { ItemStack heldItem = player.getHeldItem(handIn); boolean isHand = heldItem.isEmpty() && handIn == Hand.MAIN_HAND; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterTileEntityRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterTileEntityRenderer.java index c1fd42c85..81989a918 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterTileEntityRenderer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterTileEntityRenderer.java @@ -4,7 +4,6 @@ import static com.simibubi.create.modules.contraptions.base.HorizontalKineticBlo import static com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer.standardKineticRotationTransform; import com.mojang.blaze3d.matrix.MatrixStack; -import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.IVertexBuilder; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.foundation.block.SafeTileEntityRenderer; @@ -23,6 +22,7 @@ import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.Vector3f; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.item.ItemStack; @@ -190,7 +190,7 @@ public class MechanicalCrafterTileEntityRenderer extends SafeTileEntityRenderer< float yRot = AngleHelper.horizontalAngle(crafterState.get(HORIZONTAL_FACING)); buffer.rotateCentered(Axis.X, (float) ((xRot) / 180 * Math.PI)); buffer.rotateCentered(Axis.Y, (float) ((yRot + 90) / 180 * Math.PI)); - buffer.light(crafterState.getPackedLightmapCoords(te.getWorld(), pos)); + buffer.light(WorldRenderer.getLightmapCoordinates(te.getWorld(), crafterState, pos)); return buffer; } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/crank/HandCrankBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/crank/HandCrankBlock.java index f9e8ae9f7..933d5376f 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/crank/HandCrankBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/crank/HandCrankBlock.java @@ -10,6 +10,7 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItemUseContext; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Hand; @@ -33,7 +34,7 @@ public class HandCrankBlock extends DirectionalKineticBlock implements IWithTile } @Override - public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, + public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { boolean handEmpty = player.getHeldItem(handIn).isEmpty(); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/crusher/CrushingWheelBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/crusher/CrushingWheelBlock.java index f4e64a5eb..1ae490d34 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/crusher/CrushingWheelBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/crusher/CrushingWheelBlock.java @@ -11,7 +11,6 @@ import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; @@ -111,7 +110,7 @@ public class CrushingWheelBlock extends RotatedPillarKineticBlock { KineticTileEntity te = (KineticTileEntity) worldIn.getTileEntity(pos); if (te == null) return; - if (entityIn.posY < pos.getY() + 1.25f || !entityIn.onGround) + if (entityIn.getY() < pos.getY() + 1.25f || !entityIn.onGround) return; double x = 0; @@ -119,11 +118,11 @@ public class CrushingWheelBlock extends RotatedPillarKineticBlock { if (state.get(AXIS) == Axis.X) { z = te.getSpeed() / 20f; - x += (pos.getX() + .5f - entityIn.posX) * .1f; + x += (pos.getX() + .5f - entityIn.getX()) * .1f; } if (state.get(AXIS) == Axis.Z) { x = te.getSpeed() / -20f; - z += (pos.getZ() + .5f - entityIn.posZ) * .1f; + z += (pos.getZ() + .5f - entityIn.getZ()) * .1f; } entityIn.setMotion(entityIn.getMotion().add(x, 0, z)); } @@ -150,10 +149,10 @@ public class CrushingWheelBlock extends RotatedPillarKineticBlock { return face.getAxis() == state.get(AXIS); } - @Override - public BlockRenderLayer getRenderLayer() { - return BlockRenderLayer.CUTOUT; - } +// @Override // TODO 1.15 register layer +// public BlockRenderLayer getRenderLayer() { +// return BlockRenderLayer.CUTOUT; +// } @Override protected boolean hasStaticPart() { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/crusher/CrushingWheelControllerTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/components/crusher/CrushingWheelControllerTileEntity.java index 9f2feb3af..13230664f 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/crusher/CrushingWheelControllerTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/crusher/CrushingWheelControllerTileEntity.java @@ -124,8 +124,8 @@ public class CrushingWheelControllerTileEntity extends SyncedTileEntity implemen return; } - double xMotion = ((pos.getX() + .5f) - processingEntity.posX) / 2f; - double zMotion = ((pos.getZ() + .5f) - processingEntity.posZ) / 2f; + double xMotion = ((pos.getX() + .5f) - processingEntity.getX()) / 2f; + double zMotion = ((pos.getZ() + .5f) - processingEntity.getZ()) / 2f; if (processingEntity.isSneaking()) xMotion = zMotion = 0; @@ -145,7 +145,7 @@ public class CrushingWheelControllerTileEntity extends SyncedTileEntity implemen ItemEntity itemEntity = (ItemEntity) processingEntity; itemEntity.setPickupDelay(20); - if (processingEntity.posY < pos.getY() + .25f) { + if (processingEntity.getY() < pos.getY() + .25f) { inventory.clear(); inventory.setStackInSlot(0, itemEntity.getItem().copy()); itemInserted(inventory.getStackInSlot(0)); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/crusher/CrushingWheelTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/components/crusher/CrushingWheelTileEntity.java index d2736fd58..dee0b5d97 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/crusher/CrushingWheelTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/crusher/CrushingWheelTileEntity.java @@ -56,7 +56,7 @@ public class CrushingWheelTileEntity extends KineticTileEntity { public static void crushingTeleportsEntities(LivingDeathEvent event) { if (event.getSource() != damageSource) return; - event.getEntity().posY = Math.floor(event.getEntity().posY) - .5f; + event.getEntity().setPos(event.getEntity().getX(), Math.floor(event.getEntity().getY()) - .5f, event.getEntity().getZ()); } } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerBlock.java index 79c815217..e3eb12a26 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerBlock.java @@ -82,7 +82,7 @@ public class DeployerBlock extends DirectionalAxisKineticBlock } @Override - public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, + public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { ItemStack heldByPlayer = player.getHeldItem(handIn).copy(); if (AllItems.WRENCH.typeOf(heldByPlayer)) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerFakePlayer.java b/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerFakePlayer.java index fa8e15b89..d0efa7c77 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerFakePlayer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerFakePlayer.java @@ -73,7 +73,7 @@ public class DeployerFakePlayer extends FakePlayer { @Override public Vec3d getPositionVector() { - return new Vec3d(posX, posY, posZ); + return new Vec3d(getX(), getY(), getZ()); } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanBlock.java index 6feba93d6..69ef42ca1 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanBlock.java @@ -8,7 +8,6 @@ import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.item.BlockItemUseContext; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; @@ -59,10 +58,10 @@ public class EncasedFanBlock extends DirectionalKineticBlock implements IWithTil withTileEntityDo(world, pos, EncasedFanTileEntity::blockInFrontChanged); } - @Override - public BlockRenderLayer getRenderLayer() { - return BlockRenderLayer.CUTOUT; - } +// @Override // TODO 1.15 register layer +// public BlockRenderLayer getRenderLayer() { +// return BlockRenderLayer.CUTOUT; +// } @Override public Axis getRotationAxis(BlockState state) { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/NozzleBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/NozzleBlock.java index 2e5e91fa3..a17724244 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/NozzleBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/NozzleBlock.java @@ -8,7 +8,6 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.shapes.ISelectionContext; @@ -38,10 +37,10 @@ public class NozzleBlock extends ProperDirectionalBlock { return getDefaultState().with(FACING, context.getFace()); } - @Override - public BlockRenderLayer getRenderLayer() { - return BlockRenderLayer.CUTOUT_MIPPED; - } +// @Override // TODO 1.15 register layer +// public BlockRenderLayer getRenderLayer() { +// return BlockRenderLayer.CUTOUT_MIPPED; +// } @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/flywheel/FlywheelRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/components/flywheel/FlywheelRenderer.java index 4be403d1b..3663a8123 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/flywheel/FlywheelRenderer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/flywheel/FlywheelRenderer.java @@ -11,9 +11,9 @@ import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer; import com.simibubi.create.modules.contraptions.components.flywheel.FlywheelBlock.ConnectionState; import net.minecraft.block.BlockState; -import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; @@ -41,7 +41,7 @@ public class FlywheelRenderer extends KineticTileEntityRenderer { if (FlywheelBlock.isConnected(blockState)) { Direction connection = FlywheelBlock.getConnection(blockState); - int light = blockState.getPackedLightmapCoords(te.getWorld(), te.getPos().offset(connection)); + light = WorldRenderer.getLightmapCoordinates(te.getWorld(), blockState, te.getPos().offset(connection)); float rotation = connection.getAxis() == Axis.X ^ connection.getAxisDirection() == AxisDirection.NEGATIVE ? -angle : angle; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/flywheel/engine/EngineRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/components/flywheel/engine/EngineRenderer.java index b384bf273..bf435bd72 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/flywheel/engine/EngineRenderer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/flywheel/engine/EngineRenderer.java @@ -6,6 +6,7 @@ import com.simibubi.create.foundation.utility.AngleHelper; import net.minecraft.block.Block; import net.minecraft.client.renderer.BufferBuilder; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; @@ -27,7 +28,7 @@ public class EngineRenderer extends SafeTileEntityRe Direction facing = te.getBlockState().get(EngineBlock.HORIZONTAL_FACING); float angle = AngleHelper.rad(AngleHelper.horizontalAngle(facing)); frame.renderOn(te.getBlockState()).translate(0, 0, -1).rotateCentered(Axis.Y, angle).translate(x, y, z) - .light(te.getBlockState().getPackedLightmapCoords(getWorld(), te.getPos())).renderInto(buffer); + .light(WorldRenderer.getLightmapCoordinates(te.getWorld(), te.getBlockState(), te.getPos())).renderInto(buffer); } } } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/millstone/MillstoneBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/millstone/MillstoneBlock.java index 71d707646..fd7d0a0a7 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/millstone/MillstoneBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/millstone/MillstoneBlock.java @@ -11,6 +11,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Hand; @@ -54,7 +55,7 @@ public class MillstoneBlock extends KineticBlock { } @Override - public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, + public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!player.getHeldItem(handIn).isEmpty()) return false; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/mixer/MechanicalMixerBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/mixer/MechanicalMixerBlock.java index f4558e1e4..16355d719 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/mixer/MechanicalMixerBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/mixer/MechanicalMixerBlock.java @@ -11,7 +11,6 @@ import net.minecraft.block.Blocks; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItem; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; @@ -50,10 +49,10 @@ public class MechanicalMixerBlock extends KineticBlock return AllShapes.MECHANICAL_PROCESSOR_SHAPE; } - @Override - public BlockRenderLayer getRenderLayer() { - return BlockRenderLayer.CUTOUT_MIPPED; - } +// @Override // TODO 1.15 register layer +// public BlockRenderLayer getRenderLayer() { +// return BlockRenderLayer.CUTOUT_MIPPED; +// } @Override public Axis getRotationAxis(BlockState state) { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/mixer/MechanicalMixerTileEntityRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/components/mixer/MechanicalMixerTileEntityRenderer.java index a97b3f2b9..aa000ac90 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/mixer/MechanicalMixerTileEntityRenderer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/mixer/MechanicalMixerTileEntityRenderer.java @@ -34,7 +34,7 @@ public class MechanicalMixerTileEntityRenderer extends KineticTileEntityRenderer SuperByteBuffer superBuffer = AllBlockPartials.SHAFTLESS_COGWHEEL.renderOn(blockState); standardKineticRotationTransform(superBuffer, te).renderInto(ms, vb); - int packedLightmapCoords = blockState.getPackedLightmapCoords(te.getWorld(), pos); + int packedLightmapCoords =WorldRenderer.getLightmapCoordinates(te.getWorld(), blockState, pos); float renderedHeadOffset = mixer.getRenderedHeadOffset(partialTicks); float speed = mixer.getRenderedHeadRotationSpeed(partialTicks); float time = AnimationTickHolder.getRenderTick(); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/press/MechanicalPressTileEntityRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/components/press/MechanicalPressTileEntityRenderer.java index 362573c8a..c037e664c 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/press/MechanicalPressTileEntityRenderer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/press/MechanicalPressTileEntityRenderer.java @@ -30,7 +30,7 @@ public class MechanicalPressTileEntityRenderer extends KineticTileEntityRenderer BlockPos pos = te.getPos(); BlockState blockState = te.getBlockState(); - int packedLightmapCoords = blockState.getPackedLightmapCoords(te.getWorld(), pos); + int packedLightmapCoords =WorldRenderer.getLightmapCoordinates(te.getWorld(), blockState, pos); float renderedHeadOffset = ((MechanicalPressTileEntity) te).getRenderedHeadOffset(partialTicks); SuperByteBuffer headRender = AllBlockPartials.MECHANICAL_PRESS_HEAD.renderOnHorizontal(blockState); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/saw/SawBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/saw/SawBlock.java index 562b65710..e9b57ad4d 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/saw/SawBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/saw/SawBlock.java @@ -20,7 +20,6 @@ import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.DamageSource; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; @@ -44,10 +43,10 @@ public class SawBlock extends DirectionalAxisKineticBlock implements IWithTileEn setDefaultState(getDefaultState().with(RUNNING, false)); } - @Override - public BlockRenderLayer getRenderLayer() { - return BlockRenderLayer.CUTOUT_MIPPED; - } +// @Override // TODO 1.15 register layer +// public BlockRenderLayer getRenderLayer() { +// return BlockRenderLayer.CUTOUT_MIPPED; +// } @Override public BlockState getStateForPlacement(BlockItemUseContext context) { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/turntable/TurntableBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/turntable/TurntableBlock.java index f61cc151b..70e5c1395 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/turntable/TurntableBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/turntable/TurntableBlock.java @@ -53,7 +53,7 @@ public class TurntableBlock extends KineticBlock { if (speed == 0) return; - if (e.posY < pos.getY() + .5f) + if (e.getY() < pos.getY() + .5f) return; if (world.isRemote && (e instanceof PlayerEntity)) { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java index cc9913a09..c173bb78a 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/waterwheel/WaterWheelBlock.java @@ -9,7 +9,6 @@ import net.minecraft.block.Blocks; import net.minecraft.fluid.IFluidState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; @@ -31,10 +30,10 @@ public class WaterWheelBlock extends HorizontalKineticBlock { return new WaterWheelTileEntity(); } - @Override - public BlockRenderLayer getRenderLayer() { - return BlockRenderLayer.CUTOUT; - } +// @Override // TODO 1.15 register layer +// public BlockRenderLayer getRenderLayer() { +// return BlockRenderLayer.CUTOUT; +// } @Override protected boolean hasStaticPart() { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinBlock.java index 329e5a25c..7427e615a 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinBlock.java @@ -15,6 +15,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; @@ -48,7 +49,7 @@ public class BasinBlock extends Block implements IWithTileEntity