mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-18 16:02:19 +01:00
Some mass renames: onBlockActivated, Entity.posXYZ, etc.
This commit is contained in:
parent
3e82cf6a90
commit
53f0524200
42 changed files with 87 additions and 79 deletions
|
@ -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,
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ColoredVertexModel extends BakedModelWrapper<IBakedModel> {
|
|||
// 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]);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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();
|
||||
// }
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -47,7 +47,7 @@ public class ContraptionRenderer {
|
|||
protected static LightingWorld lightingWorld;
|
||||
|
||||
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);
|
||||
contraptionBuffer.light((lx, ly, lz) -> getLight(world, lx, ly, lz)).renderInto(ms, buffer);
|
||||
renderActors(world, c, transform, ms, buffer);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<T extends EngineTileEntity> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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<BasinTileEntity
|
|||
}
|
||||
|
||||
@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;
|
||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.particles.RedstoneParticleData;
|
||||
import net.minecraft.state.StateContainer.Builder;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
|
@ -43,7 +44,7 @@ public class AnalogLeverBlock extends HorizontalFaceBlock implements IWithTileEn
|
|||
}
|
||||
|
||||
@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 (worldIn.isRemote) {
|
||||
addParticles(state, worldIn, pos, 1.0F);
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.simibubi.create.foundation.utility.SuperByteBuffer;
|
|||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.state.properties.AttachFace;
|
||||
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,
|
||||
int destroyStage, BufferBuilder buffer) {
|
||||
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);
|
||||
|
||||
// Handle
|
||||
|
|
|
@ -77,7 +77,7 @@ public class SequencedGearshiftBlock extends HorizontalAxisKineticBlock
|
|||
}
|
||||
|
||||
@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 held = player.getHeldItemMainhand();
|
||||
if (AllItems.WRENCH.typeOf(held))
|
||||
|
|
|
@ -199,7 +199,7 @@ public class BeltBlock 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) {
|
||||
if (player.isSneaking() || !player.isAllowEdit())
|
||||
return false;
|
||||
|
|
|
@ -14,6 +14,7 @@ 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.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -115,7 +116,7 @@ public class RedstoneLinkBlock extends ProperDirectionalBlock {
|
|||
}
|
||||
|
||||
@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.isSneaking()) {
|
||||
|
|
|
@ -26,6 +26,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer.Builder;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -180,7 +181,7 @@ public class FunnelBlock extends AttachedLogisticalBlock implements IBeltAttachm
|
|||
}
|
||||
|
||||
@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 (hit.getFace() == getBlockFacing(state).getOpposite()) {
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.RedstoneDiodeBlock;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer.Builder;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -42,7 +43,7 @@ public class ToggleLatchBlock extends RedstoneDiodeBlock {
|
|||
}
|
||||
|
||||
@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;
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer.Builder;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.AxisDirection;
|
||||
import net.minecraft.util.Hand;
|
||||
|
@ -112,7 +113,7 @@ public class FlexcrateBlock extends ProperDirectionalBlock {
|
|||
}
|
||||
|
||||
@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 (worldIn.isRemote) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.inventory.InventoryHelper;
|
|||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.StateContainer.Builder;
|
||||
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;
|
||||
|
@ -60,7 +61,7 @@ public class SchematicTableBlock extends HorizontalBlock {
|
|||
}
|
||||
|
||||
@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 (worldIn.isRemote) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.entity.player.ServerPlayerEntity;
|
|||
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;
|
||||
|
@ -55,7 +56,7 @@ public class SchematicannonBlock extends Block {
|
|||
}
|
||||
|
||||
@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 (worldIn.isRemote) {
|
||||
|
|
Loading…
Reference in a new issue