API compiles
This commit is contained in:
@@ -23,6 +23,9 @@ import java.util.function.Function;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.util.math.Box;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
@@ -38,7 +41,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
@@ -46,8 +48,6 @@ import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.util.AEAxisAlignedBB;
|
||||
@@ -91,7 +91,7 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
if (!AEConfig.instance().isEnableEffects()) {
|
||||
return;
|
||||
@@ -168,21 +168,21 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
|
||||
|
||||
return VoxelShapes.create(bb.getBoundingBox());
|
||||
}
|
||||
return VoxelShapes.create(new AxisAlignedBB(0.0, 0, 0.0, 1.0, 1.0, 1.0));
|
||||
return VoxelShapes.create(new Box(0.0, 0, 0.0, 1.0, 1.0, 1.0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getCollisionShape(BlockState state, BlockView worldIn, BlockPos pos,
|
||||
ShapeContext context) {
|
||||
return VoxelShapes.create(new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 1.0, 1.0));
|
||||
return VoxelShapes.create(new Box(0.0, 0.0, 0.0, 1.0, 1.0, 1.0));
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static Function<TileEntityRendererDispatcher, TileEntityRenderer<ChargerTileEntity>> createTesr() {
|
||||
return dispatcher -> new ModularTESR<>(dispatcher, new ItemRenderable<>(ChargerBlock::getRenderedItem));
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
private static Pair<ItemStack, TransformationMatrix> getRenderedItem(ChargerTileEntity tile) {
|
||||
TransformationMatrix transform = new TransformationMatrix(new Vector3f(0.5f, 0.375f, 0.5f), null, null, null);
|
||||
return new ImmutablePair<>(tile.getInternalInventory().getStackInSlot(0), transform);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
package appeng.block.misc;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.bootstrap.TileEntityRendering;
|
||||
import appeng.bootstrap.TileEntityRenderingCustomizer;
|
||||
@@ -11,7 +11,7 @@ import appeng.tile.misc.InscriberTileEntity;
|
||||
|
||||
public class InscriberRendering extends TileEntityRenderingCustomizer<InscriberTileEntity> {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public void customize(TileEntityRendering<InscriberTileEntity> rendering) {
|
||||
rendering.tileEntityRenderer(InscriberTESR::new);
|
||||
|
||||
@@ -26,14 +26,14 @@ import net.minecraft.block.Material;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -87,7 +87,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
public boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
return this.canPlaceAt(w, pos, up.getOpposite());
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
|
||||
final double yOff = -0.3 * up.getYOffset();
|
||||
final double zOff = -0.3 * up.getZOffset();
|
||||
return VoxelShapes
|
||||
.create(new AxisAlignedBB(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
.create(new Box(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,18 +34,18 @@ import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.DirectionProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
@@ -68,7 +68,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
final double yOff = -0.3 * facing.getYOffset();
|
||||
final double zOff = -0.3 * facing.getZOffset();
|
||||
VoxelShape shape = VoxelShapes
|
||||
.create(new AxisAlignedBB(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
.create(new Box(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
SHAPES.put(facing, shape);
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
// Break the fixture if the block it is attached to is changed so that it could
|
||||
// no longer be placed
|
||||
@Override
|
||||
public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld worldIn,
|
||||
public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, WorldAccess worldIn,
|
||||
BlockPos pos, BlockPos facingPos) {
|
||||
Direction fixtureFacing = state.get(FACING);
|
||||
if (facing.getOpposite() == fixtureFacing && !canPlaceAt(worldIn, pos, facing)) {
|
||||
@@ -127,7 +127,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
public boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
// FIXME: I think this entire method -> not required, but not sure... are quartz
|
||||
// fixtures rotateable???
|
||||
return this.canPlaceAt(w, pos, up.getOpposite());
|
||||
@@ -146,7 +146,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
if (!AEConfig.instance().isEnableEffects()) {
|
||||
return;
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.block.misc;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
@@ -30,8 +31,7 @@ import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
@@ -62,7 +62,7 @@ public class QuartzGrowthAcceleratorBlock extends AEBaseTileBlock<QuartzGrowthAc
|
||||
builder.add(POWERED);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
if (!AEConfig.instance().isEnableEffects()) {
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package appeng.block.misc;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.bootstrap.BlockRenderingCustomizer;
|
||||
@@ -32,7 +32,7 @@ import appeng.client.render.StaticItemColor;
|
||||
public class SecurityStationRendering extends BlockRenderingCustomizer {
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
|
||||
rendering.renderType(RenderType.getCutout());
|
||||
rendering.blockColor(ColorableTileBlockColor.INSTANCE);
|
||||
|
||||
@@ -22,13 +22,13 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
public boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
final SkyCompassTileEntity sc = this.getTileEntity(w, pos);
|
||||
if (sc != null) {
|
||||
return false;
|
||||
@@ -139,7 +139,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
|
||||
break;
|
||||
}
|
||||
|
||||
return VoxelShapes.create(new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
return VoxelShapes.create(new Box(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
}
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package appeng.block.misc;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.bootstrap.TileEntityRendering;
|
||||
import appeng.bootstrap.TileEntityRenderingCustomizer;
|
||||
@@ -29,7 +29,7 @@ import appeng.tile.misc.SkyCompassTileEntity;
|
||||
public class SkyCompassRendering extends TileEntityRenderingCustomizer<SkyCompassTileEntity> {
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void customize(TileEntityRendering<SkyCompassTileEntity> rendering) {
|
||||
rendering.tileEntityRenderer(SkyCompassTESR::new);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
@@ -41,7 +41,7 @@ import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.entity.TinyTNTPrimedEntity;
|
||||
@@ -49,7 +49,7 @@ import appeng.entity.TinyTNTPrimedEntity;
|
||||
public class TinyTNTBlock extends AEBaseBlock {
|
||||
|
||||
private static final VoxelShape SHAPE = VoxelShapes
|
||||
.create(new AxisAlignedBB(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f));
|
||||
.create(new Box(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f));
|
||||
|
||||
public TinyTNTBlock(Settings props) {
|
||||
super(props);
|
||||
|
||||
Reference in New Issue
Block a user