Some mass renames: onBlockActivated, Entity.posXYZ, etc.

This commit is contained in:
tterrag 2020-03-29 11:46:00 -04:00
parent 3e82cf6a90
commit 53f0524200
42 changed files with 87 additions and 79 deletions

View file

@ -32,7 +32,7 @@ import net.minecraft.util.math.Vec3d;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class ValueBoxRenderer { public class ValueBoxRenderer {
@Deprecated // TODO 1.15 buffered rendering @Deprecated // TODO 1.15 buffered render
public static void renderBox(ValueBox box, boolean highlighted) { public static void renderBox(ValueBox box, boolean highlighted) {
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderSystem.blendFuncSeparate(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA, SourceFactor.ONE, RenderSystem.blendFuncSeparate(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA, SourceFactor.ONE,

View file

@ -57,7 +57,7 @@ public class ColoredVertexModel extends BakedModelWrapper<IBakedModel> {
// continue; // continue;
for (int vertex = 0; vertex < vertexData.length; vertex += format.getIntegerSize()) { 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 x = Float.intBitsToFloat(vertexData[vertex]);
float y = Float.intBitsToFloat(vertexData[vertex + 1]); float y = Float.intBitsToFloat(vertexData[vertex + 1]);
float z = Float.intBitsToFloat(vertexData[vertex + 2]); float z = Float.intBitsToFloat(vertexData[vertex + 2]);

View file

@ -31,7 +31,7 @@ public class ScreenElementRenderer {
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderSystem.enableRescaleNormal(); RenderSystem.enableRescaleNormal();
RenderSystem.enableAlphaTest(); RenderSystem.enableAlphaTest();
RenderHelper.enableGuiDepthLighting(); // TODO 1.15 RenderHelper.enableGuiDepthLighting(); // TODO 1.15 buffered render
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
ItemStack stack = transformsAndStack.get(); ItemStack stack = transformsAndStack.get();
@ -59,7 +59,7 @@ public class ScreenElementRenderer {
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderSystem.enableRescaleNormal(); RenderSystem.enableRescaleNormal();
RenderSystem.enableAlphaTest(); RenderSystem.enableAlphaTest();
RenderHelper.enableGuiDepthLighting(); // TODO 1.15 RenderHelper.enableGuiDepthLighting(); // TODO 1.15 buffered render
RenderSystem.alphaFunc(516, 0.1F); RenderSystem.alphaFunc(516, 0.1F);
RenderSystem.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA); RenderSystem.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);

View file

@ -101,7 +101,7 @@ public class SuperByteBuffer {
if (original.limit() == 0) if (original.limit() == 0)
return; return;
if (!(buffer instanceof BufferBuilder)) { 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!"); throw new IllegalArgumentException("Unsupported buffer type!");
} }
((BufferBuilder)buffer).putBulkData(build(input)); ((BufferBuilder)buffer).putBulkData(build(input));

View file

@ -104,7 +104,7 @@ public abstract class KineticBlock extends Block implements IRotate {
RotationPropagator.handleAdded(worldIn.getWorld(), pos, tileEntity); RotationPropagator.handleAdded(worldIn.getWorld(), pos, tileEntity);
} }
// @Override // TODO register layer // @Override // TODO 1.15 register layer
// public boolean canRenderInLayer(BlockState state, BlockRenderLayer layer) { // public boolean canRenderInLayer(BlockState state, BlockRenderLayer layer) {
// return hasStaticPart() && layer == getRenderLayer(); // return hasStaticPart() && layer == getRenderLayer();
// } // }

View file

@ -33,7 +33,7 @@ public class CuckooClockRenderer extends KineticTileEntityRenderer {
CuckooClockTileEntity clock = (CuckooClockTileEntity) te; CuckooClockTileEntity clock = (CuckooClockTileEntity) te;
BlockState blockState = te.getBlockState(); 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); Direction direction = blockState.get(CuckooClockBlock.HORIZONTAL_FACING);
IVertexBuilder vb = buffer.getBuffer(RenderType.getSolid()); IVertexBuilder vb = buffer.getBuffer(RenderType.getSolid());

View file

@ -37,13 +37,14 @@ import net.minecraft.block.Blocks;
import net.minecraft.block.ChestBlock; import net.minecraft.block.ChestBlock;
import net.minecraft.block.DoorBlock; import net.minecraft.block.DoorBlock;
import net.minecraft.block.SlimeBlock; 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.CompoundNBT;
import net.minecraft.nbt.ListNBT; import net.minecraft.nbt.ListNBT;
import net.minecraft.nbt.NBTUtil; import net.minecraft.nbt.NBTUtil;
import net.minecraft.state.properties.ChestType; import net.minecraft.state.properties.ChestType;
import net.minecraft.state.properties.DoubleBlockHalf; import net.minecraft.state.properties.DoubleBlockHalf;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
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;
@ -270,8 +271,7 @@ public abstract class Contraption {
if (world.isRemote) { if (world.isRemote) {
Block block = info.state.getBlock(); Block block = info.state.getBlock();
BlockRenderLayer renderLayer = block.getRenderLayer(); if (RenderTypeLookup.canRenderInLayer(info.state, RenderType.getTranslucent()))
if (renderLayer == BlockRenderLayer.TRANSLUCENT)
renderOrder.add(info.pos); renderOrder.add(info.pos);
else else
renderOrder.add(0, info.pos); renderOrder.add(0, info.pos);
@ -284,7 +284,7 @@ public abstract class Contraption {
tag.putInt("z", info.pos.getZ()); tag.putInt("z", info.pos.getZ());
TileEntity te = TileEntity.create(tag); TileEntity te = TileEntity.create(tag);
te.setWorld(new WrappedWorld(world) { te.setLocation(new WrappedWorld(world) {
@Override @Override
public BlockState getBlockState(BlockPos pos) { public BlockState getBlockState(BlockPos pos) {
@ -293,7 +293,7 @@ public abstract class Contraption {
return info.state; return info.state;
} }
}); }, te.getPos());
if (te instanceof KineticTileEntity) if (te instanceof KineticTileEntity)
((KineticTileEntity) te).setSpeed(0); ((KineticTileEntity) te).setSpeed(0);
te.getBlockState(); te.getBlockState();

View file

@ -47,7 +47,7 @@ public class ContraptionRenderer {
protected static LightingWorld lightingWorld; protected static LightingWorld lightingWorld;
public static void render(World world, Contraption c, Consumer<SuperByteBuffer> transform, MatrixStack ms, BufferBuilder buffer) { public static void render(World world, Contraption c, Consumer<SuperByteBuffer> 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); transform.accept(contraptionBuffer);
contraptionBuffer.light((lx, ly, lz) -> getLight(world, lx, ly, lz)).renderInto(ms, buffer); contraptionBuffer.light((lx, ly, lz) -> getLight(world, lx, ly, lz)).renderInto(ms, buffer);
renderActors(world, c, transform, ms, buffer); renderActors(world, c, transform, ms, buffer);

View file

@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.particles.ParticleTypes; import net.minecraft.particles.ParticleTypes;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
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;
import net.minecraft.util.Mirror; import net.minecraft.util.Mirror;
@ -38,7 +39,7 @@ public abstract class AbstractChassisBlock extends RotatedPillarBlock {
} }
@Override @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) { BlockRayTraceResult hit) {
if (!player.isAllowEdit()) if (!player.isAllowEdit())
return false; return false;

View file

@ -52,7 +52,7 @@ public class MechanicalPistonBlock extends DirectionalAxisKineticBlock
} }
@Override @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) { BlockRayTraceResult hit) {
if (!player.isAllowEdit()) if (!player.isAllowEdit())
return false; return false;

View file

@ -13,6 +13,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.EnumProperty; import net.minecraft.state.EnumProperty;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
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.Hand; import net.minecraft.util.Hand;
@ -42,7 +43,7 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements IWithTile
} }
@Override @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) { BlockRayTraceResult hit) {
if (!player.isAllowEdit()) if (!player.isAllowEdit())
return false; return false;

View file

@ -13,6 +13,7 @@ import com.simibubi.create.modules.contraptions.components.contraptions.Contrapt
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.WorldRenderer;
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.AxisDirection; 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, public void renderAt(IWorld world, SuperByteBuffer partial, float offset, BlockPos pulleyPos,
MatrixStack ms, IVertexBuilder buffer) { MatrixStack ms, IVertexBuilder buffer) {
BlockPos actualPos = pulleyPos.down((int) offset); 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); partial.translate(0, -offset, 0).light(light).renderInto(ms, buffer);
} }

View file

@ -23,7 +23,6 @@ import net.minecraft.state.EnumProperty;
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;
import net.minecraft.util.BlockRenderLayer;
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;
@ -160,7 +159,7 @@ public class MechanicalCrafterBlock extends HorizontalKineticBlock
} }
@Override @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) { BlockRayTraceResult hit) {
ItemStack heldItem = player.getHeldItem(handIn); ItemStack heldItem = player.getHeldItem(handIn);
boolean isHand = heldItem.isEmpty() && handIn == Hand.MAIN_HAND; boolean isHand = heldItem.isEmpty() && handIn == Hand.MAIN_HAND;

View file

@ -4,7 +4,6 @@ import static com.simibubi.create.modules.contraptions.base.HorizontalKineticBlo
import static com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer.standardKineticRotationTransform; import static com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer.standardKineticRotationTransform;
import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.IVertexBuilder; import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.block.SafeTileEntityRenderer; 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.RenderHelper;
import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.Vector3f; 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.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -190,7 +190,7 @@ public class MechanicalCrafterTileEntityRenderer extends SafeTileEntityRenderer<
float yRot = AngleHelper.horizontalAngle(crafterState.get(HORIZONTAL_FACING)); float yRot = AngleHelper.horizontalAngle(crafterState.get(HORIZONTAL_FACING));
buffer.rotateCentered(Axis.X, (float) ((xRot) / 180 * Math.PI)); buffer.rotateCentered(Axis.X, (float) ((xRot) / 180 * Math.PI));
buffer.rotateCentered(Axis.Y, (float) ((yRot + 90) / 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; return buffer;
} }

View file

@ -10,6 +10,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.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
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.Hand; import net.minecraft.util.Hand;
@ -33,7 +34,7 @@ public class HandCrankBlock extends DirectionalKineticBlock implements IWithTile
} }
@Override @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) { BlockRayTraceResult hit) {
boolean handEmpty = player.getHeldItem(handIn).isEmpty(); boolean handEmpty = player.getHeldItem(handIn).isEmpty();

View file

@ -11,7 +11,6 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
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.BlockPos; import net.minecraft.util.math.BlockPos;
@ -111,7 +110,7 @@ public class CrushingWheelBlock extends RotatedPillarKineticBlock {
KineticTileEntity te = (KineticTileEntity) worldIn.getTileEntity(pos); KineticTileEntity te = (KineticTileEntity) worldIn.getTileEntity(pos);
if (te == null) if (te == null)
return; return;
if (entityIn.posY < pos.getY() + 1.25f || !entityIn.onGround) if (entityIn.getY() < pos.getY() + 1.25f || !entityIn.onGround)
return; return;
double x = 0; double x = 0;
@ -119,11 +118,11 @@ public class CrushingWheelBlock extends RotatedPillarKineticBlock {
if (state.get(AXIS) == Axis.X) { if (state.get(AXIS) == Axis.X) {
z = te.getSpeed() / 20f; z = te.getSpeed() / 20f;
x += (pos.getX() + .5f - entityIn.posX) * .1f; x += (pos.getX() + .5f - entityIn.getX()) * .1f;
} }
if (state.get(AXIS) == Axis.Z) { if (state.get(AXIS) == Axis.Z) {
x = te.getSpeed() / -20f; 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)); entityIn.setMotion(entityIn.getMotion().add(x, 0, z));
} }
@ -150,10 +149,10 @@ public class CrushingWheelBlock extends RotatedPillarKineticBlock {
return face.getAxis() == state.get(AXIS); return face.getAxis() == state.get(AXIS);
} }
@Override // @Override // TODO 1.15 register layer
public BlockRenderLayer getRenderLayer() { // public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT; // return BlockRenderLayer.CUTOUT;
} // }
@Override @Override
protected boolean hasStaticPart() { protected boolean hasStaticPart() {

View file

@ -124,8 +124,8 @@ public class CrushingWheelControllerTileEntity extends SyncedTileEntity implemen
return; return;
} }
double xMotion = ((pos.getX() + .5f) - processingEntity.posX) / 2f; double xMotion = ((pos.getX() + .5f) - processingEntity.getX()) / 2f;
double zMotion = ((pos.getZ() + .5f) - processingEntity.posZ) / 2f; double zMotion = ((pos.getZ() + .5f) - processingEntity.getZ()) / 2f;
if (processingEntity.isSneaking()) if (processingEntity.isSneaking())
xMotion = zMotion = 0; xMotion = zMotion = 0;
@ -145,7 +145,7 @@ public class CrushingWheelControllerTileEntity extends SyncedTileEntity implemen
ItemEntity itemEntity = (ItemEntity) processingEntity; ItemEntity itemEntity = (ItemEntity) processingEntity;
itemEntity.setPickupDelay(20); itemEntity.setPickupDelay(20);
if (processingEntity.posY < pos.getY() + .25f) { if (processingEntity.getY() < pos.getY() + .25f) {
inventory.clear(); inventory.clear();
inventory.setStackInSlot(0, itemEntity.getItem().copy()); inventory.setStackInSlot(0, itemEntity.getItem().copy());
itemInserted(inventory.getStackInSlot(0)); itemInserted(inventory.getStackInSlot(0));

View file

@ -56,7 +56,7 @@ public class CrushingWheelTileEntity extends KineticTileEntity {
public static void crushingTeleportsEntities(LivingDeathEvent event) { public static void crushingTeleportsEntities(LivingDeathEvent event) {
if (event.getSource() != damageSource) if (event.getSource() != damageSource)
return; 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());
} }
} }

View file

@ -82,7 +82,7 @@ public class DeployerBlock extends DirectionalAxisKineticBlock
} }
@Override @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) { BlockRayTraceResult hit) {
ItemStack heldByPlayer = player.getHeldItem(handIn).copy(); ItemStack heldByPlayer = player.getHeldItem(handIn).copy();
if (AllItems.WRENCH.typeOf(heldByPlayer)) if (AllItems.WRENCH.typeOf(heldByPlayer))

View file

@ -73,7 +73,7 @@ public class DeployerFakePlayer extends FakePlayer {
@Override @Override
public Vec3d getPositionVector() { public Vec3d getPositionVector() {
return new Vec3d(posX, posY, posZ); return new Vec3d(getX(), getY(), getZ());
} }
@Override @Override

View file

@ -8,7 +8,6 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
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.BlockPos; import net.minecraft.util.math.BlockPos;
@ -59,10 +58,10 @@ public class EncasedFanBlock extends DirectionalKineticBlock implements IWithTil
withTileEntityDo(world, pos, EncasedFanTileEntity::blockInFrontChanged); withTileEntityDo(world, pos, EncasedFanTileEntity::blockInFrontChanged);
} }
@Override // @Override // TODO 1.15 register layer
public BlockRenderLayer getRenderLayer() { // public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT; // return BlockRenderLayer.CUTOUT;
} // }
@Override @Override
public Axis getRotationAxis(BlockState state) { public Axis getRotationAxis(BlockState state) {

View file

@ -8,7 +8,6 @@ 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.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
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.shapes.ISelectionContext; import net.minecraft.util.math.shapes.ISelectionContext;
@ -38,10 +37,10 @@ public class NozzleBlock extends ProperDirectionalBlock {
return getDefaultState().with(FACING, context.getFace()); return getDefaultState().with(FACING, context.getFace());
} }
@Override // @Override // TODO 1.15 register layer
public BlockRenderLayer getRenderLayer() { // public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT_MIPPED; // return BlockRenderLayer.CUTOUT_MIPPED;
} // }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {

View file

@ -11,9 +11,9 @@ import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.flywheel.FlywheelBlock.ConnectionState; import com.simibubi.create.modules.contraptions.components.flywheel.FlywheelBlock.ConnectionState;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.BufferBuilder;
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.WorldRenderer;
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;
@ -41,7 +41,7 @@ public class FlywheelRenderer extends KineticTileEntityRenderer {
if (FlywheelBlock.isConnected(blockState)) { if (FlywheelBlock.isConnected(blockState)) {
Direction connection = FlywheelBlock.getConnection(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 float rotation = connection.getAxis() == Axis.X ^ connection.getAxisDirection() == AxisDirection.NEGATIVE
? -angle ? -angle
: angle; : angle;

View file

@ -6,6 +6,7 @@ import com.simibubi.create.foundation.utility.AngleHelper;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.WorldRenderer;
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;
@ -27,7 +28,7 @@ public class EngineRenderer<T extends EngineTileEntity> extends SafeTileEntityRe
Direction facing = te.getBlockState().get(EngineBlock.HORIZONTAL_FACING); Direction facing = te.getBlockState().get(EngineBlock.HORIZONTAL_FACING);
float angle = AngleHelper.rad(AngleHelper.horizontalAngle(facing)); float angle = AngleHelper.rad(AngleHelper.horizontalAngle(facing));
frame.renderOn(te.getBlockState()).translate(0, 0, -1).rotateCentered(Axis.Y, angle).translate(x, y, z) 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);
} }
} }
} }

View file

@ -11,6 +11,7 @@ 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.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
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.Hand; import net.minecraft.util.Hand;
@ -54,7 +55,7 @@ public class MillstoneBlock extends KineticBlock {
} }
@Override @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) { BlockRayTraceResult hit) {
if (!player.getHeldItem(handIn).isEmpty()) if (!player.getHeldItem(handIn).isEmpty())
return false; return false;

View file

@ -11,7 +11,6 @@ import net.minecraft.block.Blocks;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
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.BlockPos; import net.minecraft.util.math.BlockPos;
@ -50,10 +49,10 @@ public class MechanicalMixerBlock extends KineticBlock
return AllShapes.MECHANICAL_PROCESSOR_SHAPE; return AllShapes.MECHANICAL_PROCESSOR_SHAPE;
} }
@Override // @Override // TODO 1.15 register layer
public BlockRenderLayer getRenderLayer() { // public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT_MIPPED; // return BlockRenderLayer.CUTOUT_MIPPED;
} // }
@Override @Override
public Axis getRotationAxis(BlockState state) { public Axis getRotationAxis(BlockState state) {

View file

@ -34,7 +34,7 @@ public class MechanicalMixerTileEntityRenderer extends KineticTileEntityRenderer
SuperByteBuffer superBuffer = AllBlockPartials.SHAFTLESS_COGWHEEL.renderOn(blockState); SuperByteBuffer superBuffer = AllBlockPartials.SHAFTLESS_COGWHEEL.renderOn(blockState);
standardKineticRotationTransform(superBuffer, te).renderInto(ms, vb); 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 renderedHeadOffset = mixer.getRenderedHeadOffset(partialTicks);
float speed = mixer.getRenderedHeadRotationSpeed(partialTicks); float speed = mixer.getRenderedHeadRotationSpeed(partialTicks);
float time = AnimationTickHolder.getRenderTick(); float time = AnimationTickHolder.getRenderTick();

View file

@ -30,7 +30,7 @@ public class MechanicalPressTileEntityRenderer extends KineticTileEntityRenderer
BlockPos pos = te.getPos(); BlockPos pos = te.getPos();
BlockState blockState = te.getBlockState(); 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); float renderedHeadOffset = ((MechanicalPressTileEntity) te).getRenderedHeadOffset(partialTicks);
SuperByteBuffer headRender = AllBlockPartials.MECHANICAL_PRESS_HEAD.renderOnHorizontal(blockState); SuperByteBuffer headRender = AllBlockPartials.MECHANICAL_PRESS_HEAD.renderOnHorizontal(blockState);

View file

@ -20,7 +20,6 @@ import net.minecraft.item.BlockItemUseContext;
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;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.Axis;
@ -44,10 +43,10 @@ public class SawBlock extends DirectionalAxisKineticBlock implements IWithTileEn
setDefaultState(getDefaultState().with(RUNNING, false)); setDefaultState(getDefaultState().with(RUNNING, false));
} }
@Override // @Override // TODO 1.15 register layer
public BlockRenderLayer getRenderLayer() { // public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT_MIPPED; // return BlockRenderLayer.CUTOUT_MIPPED;
} // }
@Override @Override
public BlockState getStateForPlacement(BlockItemUseContext context) { public BlockState getStateForPlacement(BlockItemUseContext context) {

View file

@ -53,7 +53,7 @@ public class TurntableBlock extends KineticBlock {
if (speed == 0) if (speed == 0)
return; return;
if (e.posY < pos.getY() + .5f) if (e.getY() < pos.getY() + .5f)
return; return;
if (world.isRemote && (e instanceof PlayerEntity)) { if (world.isRemote && (e instanceof PlayerEntity)) {

View file

@ -9,7 +9,6 @@ import net.minecraft.block.Blocks;
import net.minecraft.fluid.IFluidState; import net.minecraft.fluid.IFluidState;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
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;
@ -31,10 +30,10 @@ public class WaterWheelBlock extends HorizontalKineticBlock {
return new WaterWheelTileEntity(); return new WaterWheelTileEntity();
} }
@Override // @Override // TODO 1.15 register layer
public BlockRenderLayer getRenderLayer() { // public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT; // return BlockRenderLayer.CUTOUT;
} // }
@Override @Override
protected boolean hasStaticPart() { protected boolean hasStaticPart() {

View file

@ -15,6 +15,7 @@ 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.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@ -48,7 +49,7 @@ public class BasinBlock extends Block implements IWithTileEntity<BasinTileEntity
} }
@Override @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) { BlockRayTraceResult hit) {
if (!player.getHeldItem(handIn).isEmpty()) if (!player.getHeldItem(handIn).isEmpty())
return false; return false;

View file

@ -12,6 +12,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.particles.RedstoneParticleData; import net.minecraft.particles.RedstoneParticleData;
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.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
@ -43,7 +44,7 @@ public class AnalogLeverBlock extends HorizontalFaceBlock implements IWithTileEn
} }
@Override @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) { BlockRayTraceResult hit) {
if (worldIn.isRemote) { if (worldIn.isRemote) {
addParticles(state, worldIn, pos, 1.0F); addParticles(state, worldIn, pos, 1.0F);

View file

@ -8,6 +8,7 @@ import com.simibubi.create.foundation.utility.SuperByteBuffer;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.state.properties.AttachFace; import net.minecraft.state.properties.AttachFace;
import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.Axis;
@ -22,7 +23,7 @@ public class AnalogLeverTileEntityRenderer extends SafeTileEntityRenderer<Analog
public void renderFast(AnalogLeverTileEntity te, double x, double y, double z, float partialTicks, public void renderFast(AnalogLeverTileEntity te, double x, double y, double z, float partialTicks,
int destroyStage, BufferBuilder buffer) { int destroyStage, BufferBuilder buffer) {
BlockState leverState = te.getBlockState(); BlockState leverState = te.getBlockState();
int lightCoords = leverState.getPackedLightmapCoords(getWorld(), te.getPos()); int lightCoords = WorldRenderer.getLightmapCoordinates(te.getWorld(), leverState, te.getPos());
float state = te.clientState.get(partialTicks); float state = te.clientState.get(partialTicks);
// Handle // Handle

View file

@ -77,7 +77,7 @@ public class SequencedGearshiftBlock extends HorizontalAxisKineticBlock
} }
@Override @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) { BlockRayTraceResult hit) {
ItemStack held = player.getHeldItemMainhand(); ItemStack held = player.getHeldItemMainhand();
if (AllItems.WRENCH.typeOf(held)) if (AllItems.WRENCH.typeOf(held))

View file

@ -199,7 +199,7 @@ public class BeltBlock extends HorizontalKineticBlock
} }
@Override @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) { BlockRayTraceResult hit) {
if (player.isSneaking() || !player.isAllowEdit()) if (player.isSneaking() || !player.isAllowEdit())
return false; return false;

View file

@ -14,6 +14,7 @@ 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;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
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;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -115,7 +116,7 @@ public class RedstoneLinkBlock extends ProperDirectionalBlock {
} }
@Override @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) { BlockRayTraceResult hit) {
if (player.isSneaking()) { if (player.isSneaking()) {

View file

@ -26,6 +26,7 @@ import net.minecraft.item.ItemStack;
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;
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;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -180,7 +181,7 @@ public class FunnelBlock extends AttachedLogisticalBlock implements IBeltAttachm
} }
@Override @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) { BlockRayTraceResult hit) {
if (hit.getFace() == getBlockFacing(state).getOpposite()) { if (hit.getFace() == getBlockFacing(state).getOpposite()) {

View file

@ -9,6 +9,7 @@ import net.minecraft.block.RedstoneDiodeBlock;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
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.ActionResultType;
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;
@ -42,7 +43,7 @@ public class ToggleLatchBlock extends RedstoneDiodeBlock {
} }
@Override @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) { BlockRayTraceResult hit) {
if (!player.isAllowEdit()) if (!player.isAllowEdit())
return false; return false;

View file

@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack;
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;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.Direction.AxisDirection;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
@ -112,7 +113,7 @@ public class FlexcrateBlock extends ProperDirectionalBlock {
} }
@Override @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) { BlockRayTraceResult hit) {
if (worldIn.isRemote) { if (worldIn.isRemote) {

View file

@ -13,6 +13,7 @@ import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
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.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@ -60,7 +61,7 @@ public class SchematicTableBlock extends HorizontalBlock {
} }
@Override @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) { BlockRayTraceResult hit) {
if (worldIn.isRemote) { if (worldIn.isRemote) {

View file

@ -12,6 +12,7 @@ import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.InventoryHelper; import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@ -55,7 +56,7 @@ public class SchematicannonBlock extends Block {
} }
@Override @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) { BlockRayTraceResult hit) {
if (worldIn.isRemote) { if (worldIn.isRemote) {