Utils ported
This commit is contained in:
@@ -21,8 +21,8 @@ package appeng.block.crafting;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -36,8 +36,8 @@ import appeng.container.implementations.CraftingCPUContainer;
|
||||
import appeng.tile.crafting.CraftingBlockEntity;
|
||||
|
||||
public abstract class AbstractCraftingUnitBlock<T extends CraftingBlockEntity> extends AEBaseTileBlock<T> {
|
||||
public static final BooleanProperty FORMED = BooleanProperty.create("formed");
|
||||
public static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||
public static final BooleanProperty FORMED = BooleanProperty.of("formed");
|
||||
public static final BooleanProperty POWERED = BooleanProperty.of("powered");
|
||||
|
||||
public final CraftingUnitType type;
|
||||
|
||||
@@ -48,14 +48,14 @@ public abstract class AbstractCraftingUnitBlock<T extends CraftingBlockEntity> e
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(POWERED);
|
||||
builder.add(FORMED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(final BlockState state, final World worldIn, final BlockPos pos, final Block blockIn,
|
||||
public void neighborUpdate(final BlockState state, final World worldIn, final BlockPos pos, final Block blockIn,
|
||||
final BlockPos fromPos, boolean isMoving) {
|
||||
final CraftingBlockEntity cp = this.getBlockEntity(worldIn, pos);
|
||||
if (cp != null) {
|
||||
@@ -85,7 +85,7 @@ public abstract class AbstractCraftingUnitBlock<T extends CraftingBlockEntity> e
|
||||
if (tg != null && !p.isInSneakingPose() && tg.isFormed() && tg.isActive()) {
|
||||
if (!w.isClient()) {
|
||||
ContainerOpener.openContainer(CraftingCPUContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getSide()));
|
||||
}
|
||||
|
||||
return ActionResult.SUCCESS;
|
||||
|
||||
@@ -21,8 +21,8 @@ package appeng.block.crafting;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
@@ -37,7 +37,7 @@ import appeng.tile.crafting.MolecularAssemblerBlockEntity;
|
||||
|
||||
public class MolecularAssemblerBlock extends AEBaseTileBlock<MolecularAssemblerBlockEntity> {
|
||||
|
||||
public static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||
public static final BooleanProperty POWERED = BooleanProperty.of("powered");
|
||||
|
||||
public MolecularAssemblerBlock(Settings props) {
|
||||
super(props);
|
||||
@@ -45,8 +45,8 @@ public class MolecularAssemblerBlock extends AEBaseTileBlock<MolecularAssemblerB
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(POWERED);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class MolecularAssemblerBlock extends AEBaseTileBlock<MolecularAssemblerB
|
||||
if (tg != null && !p.isInSneakingPose()) {
|
||||
if (!tg.isClient()) {
|
||||
ContainerOpener.openContainer(MolecularAssemblerContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getSide()));
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
|
||||
@@ -122,7 +122,7 @@ public class CrankBlock extends AEBaseTileBlock<CrankBlockEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final AEBaseBlockEntity tile = this.getBlockEntity(world, pos);
|
||||
if (tile != null) {
|
||||
@@ -135,7 +135,7 @@ public class CrankBlock extends AEBaseTileBlock<CrankBlockEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidPosition(BlockState state, IWorldReader w, BlockPos pos) {
|
||||
public boolean canPlaceAt(BlockState state, WorldView w, BlockPos pos) {
|
||||
return this.findCrankable(w, pos) != null;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public class CrankBlock extends AEBaseTileBlock<CrankBlockEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||
Direction up = getUp(world, pos);
|
||||
|
||||
if (up == null) {
|
||||
@@ -155,7 +155,7 @@ public class CrankBlock extends AEBaseTileBlock<CrankBlockEntity> {
|
||||
final double xOff = -0.15 * up.getOffsetX();
|
||||
final double yOff = -0.15 * up.getOffsetY();
|
||||
final double zOff = -0.15 * up.getOffsetZ();
|
||||
return VoxelShapes.create(
|
||||
return VoxelShapes.cuboid(
|
||||
new Box(xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85));
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class GrinderBlock extends AEBaseTileBlock<GrinderBlockEntity> {
|
||||
if (tg != null && !p.isInSneakingPose()) {
|
||||
if (p instanceof ServerPlayerEntity) {
|
||||
ContainerOpener.openContainer(GrinderContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getSide()));
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import appeng.util.Platform;
|
||||
public class CellWorkbenchBlock extends AEBaseTileBlock<CellWorkbenchBlockEntity> {
|
||||
|
||||
public CellWorkbenchBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,6 +25,8 @@ import javax.annotation.Nullable;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.render.model.json.Transformation;
|
||||
import net.minecraft.client.util.math.AffineTransformation;
|
||||
import net.minecraft.util.math.Box;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
@@ -32,8 +34,7 @@ import org.apache.commons.lang3.tuple.Pair;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.renderer.TransformationMatrix;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -63,9 +64,7 @@ import appeng.util.Platform;
|
||||
public class ChargerBlock extends AEBaseTileBlock<ChargerBlockEntity> {
|
||||
|
||||
public ChargerBlock() {
|
||||
super(defaultProps(Material.IRON).notSolid());
|
||||
|
||||
this.setFullSize(this.setOpaque(false));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -92,7 +91,7 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerBlockEntity> {
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
public void randomDisplayTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
if (!AEConfig.instance().isEnableEffects()) {
|
||||
return;
|
||||
}
|
||||
@@ -111,7 +110,7 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerBlockEntity> {
|
||||
|
||||
for (int bolts = 0; bolts < 3; bolts++) {
|
||||
if (AppEng.proxy.shouldAddParticles(r)) {
|
||||
MinecraftClient.getInstance().particles.addParticle(ParticleTypes.LIGHTNING, xOff + 0.5 + pos.getX(),
|
||||
MinecraftClient.getInstance().particleManager.addParticle(ParticleTypes.LIGHTNING, xOff + 0.5 + pos.getX(),
|
||||
yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0, 0.0, 0.0);
|
||||
}
|
||||
}
|
||||
@@ -120,7 +119,7 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerBlockEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
|
||||
final ChargerBlockEntity tile = this.getBlockEntity(w, pos);
|
||||
if (tile != null) {
|
||||
@@ -166,15 +165,15 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerBlockEntity> {
|
||||
break;
|
||||
}
|
||||
|
||||
return VoxelShapes.create(bb.getBoundingBox());
|
||||
return VoxelShapes.cuboid(bb.getBoundingBox());
|
||||
}
|
||||
return VoxelShapes.create(new Box(0.0, 0, 0.0, 1.0, 1.0, 1.0));
|
||||
return VoxelShapes.cuboid(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 Box(0.0, 0.0, 0.0, 1.0, 1.0, 1.0));
|
||||
return VoxelShapes.cuboid(new Box(0.0, 0.0, 0.0, 1.0, 1.0, 1.0));
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@@ -183,8 +182,8 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerBlockEntity> {
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
private static Pair<ItemStack, TransformationMatrix> getRenderedItem(ChargerBlockEntity tile) {
|
||||
TransformationMatrix transform = new TransformationMatrix(new Vector3f(0.5f, 0.375f, 0.5f), null, null, null);
|
||||
private static Pair<ItemStack, Transformation> getRenderedItem(ChargerBlockEntity tile) {
|
||||
Transformation transform = new Transformation(new Vector3f(), new Vector3f(0.5f, 0.375f, 0.5f), new Vector3f(1f, 1f, 1f));
|
||||
return new ImmutablePair<>(tile.getInternalInventory().getInvStack(0), transform);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import appeng.util.Platform;
|
||||
public class CondenserBlock extends AEBaseTileBlock<CondenserBlockEntity> {
|
||||
|
||||
public CondenserBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,7 +53,7 @@ public class CondenserBlock extends AEBaseTileBlock<CondenserBlockEntity> {
|
||||
final CondenserBlockEntity tc = this.getBlockEntity(w, pos);
|
||||
if (tc != null && !player.isInSneakingPose()) {
|
||||
ContainerOpener.openContainer(CondenserContainer.TYPE, player,
|
||||
ContainerLocator.forTileEntitySide(tc, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tc, hit.getSide()));
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class InscriberBlock extends AEBaseTileBlock<InscriberBlockEntity> {
|
||||
if (tg != null) {
|
||||
if (!tg.isClient()) {
|
||||
ContainerOpener.openContainer(InscriberContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getSide()));
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import appeng.bootstrap.TileEntityRenderingCustomizer;
|
||||
import appeng.client.render.tesr.InscriberTESR;
|
||||
import appeng.tile.misc.InscriberBlockEntity;
|
||||
|
||||
public class InscriberRendering extends TileEntityRenderingCustomizer<InscriberBlockEntity> {
|
||||
public class InscriberRendering implements TileEntityRenderingCustomizer<InscriberBlockEntity> {
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
|
||||
@@ -25,8 +25,8 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
@@ -44,15 +44,15 @@ import appeng.util.Platform;
|
||||
|
||||
public class InterfaceBlock extends AEBaseTileBlock<InterfaceBlockEntity> {
|
||||
|
||||
private static final BooleanProperty OMNIDIRECTIONAL = BooleanProperty.create("omnidirectional");
|
||||
private static final BooleanProperty OMNIDIRECTIONAL = BooleanProperty.of("omnidirectional");
|
||||
|
||||
public InterfaceBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(OMNIDIRECTIONAL);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class InterfaceBlock extends AEBaseTileBlock<InterfaceBlockEntity> {
|
||||
if (tg != null) {
|
||||
if (Platform.isServer()) {
|
||||
ContainerOpener.openContainer(InterfaceContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getSide()));
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -18,23 +18,18 @@
|
||||
|
||||
package appeng.block.misc;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Direction;
|
||||
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.WorldAccess;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
@@ -46,44 +41,48 @@ import appeng.tile.misc.LightDetectorBlockEntity;
|
||||
public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorBlockEntity> implements IOrientableBlock {
|
||||
|
||||
// Used to alternate between two variants of the fixture on adjacent blocks
|
||||
public static final BooleanProperty ODD = BooleanProperty.create("odd");
|
||||
public static final BooleanProperty ODD = BooleanProperty.of("odd");
|
||||
|
||||
public LightDetectorBlock() {
|
||||
super(defaultProps(Material.MISCELLANEOUS).notSolid());
|
||||
|
||||
this.setDefaultState(this.getDefaultState().with(BlockStateProperties.FACING, Direction.UP).with(ODD, false));
|
||||
super(defaultProps(Material.SUPPORTED));
|
||||
this.setDefaultState(this.getDefaultState().with(Properties.FACING, Direction.UP).with(ODD, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
builder.add(BlockStateProperties.FACING);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(Properties.FACING);
|
||||
builder.add(ODD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(final BlockState state, final BlockView w, final BlockPos pos, final Direction side) {
|
||||
public int getWeakRedstonePower(final BlockState state, final BlockView w, final BlockPos pos, final Direction side) {
|
||||
if (w instanceof World && this.getBlockEntity(w, pos).isReady()) {
|
||||
// FIXME: This is ... uhm... fishy
|
||||
return ((World) w).getLight(pos) - 6;
|
||||
return ((World) w).getLightLevel(pos) - 6;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChange(BlockState state, IWorldReader world, BlockPos pos, BlockPos neighbor) {
|
||||
super.onNeighborChange(state, world, pos, neighbor);
|
||||
public boolean emitsRedstonePower(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) {
|
||||
final Direction up = this.getOrientable(world, pos).getUp();
|
||||
if (!this.canPlaceAt(world, pos, up.getOpposite())) {
|
||||
// FIXME: Double check that this actually updates neighbors
|
||||
return Blocks.AIR.getDefaultState();
|
||||
}
|
||||
|
||||
final LightDetectorBlockEntity tld = this.getBlockEntity(world, pos);
|
||||
if (tld != null) {
|
||||
tld.updateLight();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTick(final BlockState state, final World worldIn, final BlockPos pos, final Random rand) {
|
||||
// cancel out lightning
|
||||
return state;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,11 +93,11 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorBlockEntity
|
||||
private boolean canPlaceAt(final BlockView w, final BlockPos pos, final Direction dir) {
|
||||
final BlockPos test = pos.offset(dir);
|
||||
BlockState blockstate = w.getBlockState(test);
|
||||
return blockstate.isSolidSide(w, test, dir.getOpposite());
|
||||
return blockstate.isSideSolidFullSquare(w, test, dir.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
|
||||
// FIXME: We should / rather MUST use state here because at startup, this gets
|
||||
// called without a world
|
||||
@@ -108,7 +107,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorBlockEntity
|
||||
final double yOff = -0.3 * up.getOffsetY();
|
||||
final double zOff = -0.3 * up.getOffsetZ();
|
||||
return VoxelShapes
|
||||
.create(new Box(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
.cuboid(new Box(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,22 +117,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorBlockEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final Direction up = this.getOrientable(world, pos).getUp();
|
||||
if (!this.canPlaceAt(world, pos, up.getOpposite())) {
|
||||
this.dropTorch(world, pos);
|
||||
}
|
||||
}
|
||||
|
||||
private void dropTorch(final World w, final BlockPos pos) {
|
||||
final BlockState prev = w.getBlockState(pos);
|
||||
w.breakBlock(pos, true);
|
||||
w.updateListeners(pos, prev, w.getBlockState(pos), 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidPosition(BlockState state, IWorldReader w, BlockPos pos) {
|
||||
public boolean canPlaceAt(BlockState state, WorldView w, BlockPos pos) {
|
||||
for (final Direction dir : Direction.values()) {
|
||||
if (this.canPlaceAt(w, pos, dir)) {
|
||||
return true;
|
||||
@@ -144,7 +128,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorBlockEntity
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable(final BlockView w, final BlockPos pos) {
|
||||
return new MetaRotation(w, pos, BlockStateProperties.FACING);
|
||||
return new MetaRotation(w, pos, Properties.FACING);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,10 +30,10 @@ import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.DirectionProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.property.DirectionProperty;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -42,7 +42,7 @@ import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.World;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
@@ -68,42 +68,42 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
final double yOff = -0.3 * facing.getOffsetY();
|
||||
final double zOff = -0.3 * facing.getOffsetZ();
|
||||
VoxelShape shape = VoxelShapes
|
||||
.create(new Box(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
.cuboid(new Box(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
|
||||
SHAPES.put(facing, shape);
|
||||
}
|
||||
}
|
||||
|
||||
// Cannot use the vanilla FACING property here because it excludes facing DOWN
|
||||
public static final DirectionProperty FACING = BlockStateProperties.FACING;
|
||||
public static final DirectionProperty FACING = Properties.FACING;
|
||||
|
||||
// Used to alternate between two variants of the fixture on adjacent blocks
|
||||
public static final BooleanProperty ODD = BooleanProperty.create("odd");
|
||||
public static final BooleanProperty ODD = BooleanProperty.of("odd");
|
||||
|
||||
public QuartzFixtureBlock() {
|
||||
super(defaultProps(Material.MISCELLANEOUS).doesNotBlockMovement().strength(0).lightValue(14)
|
||||
super(defaultProps(Material.SUPPORTED).noCollision().strength(0).lightLevel(14)
|
||||
.sounds(BlockSoundGroup.GLASS));
|
||||
|
||||
this.setDefaultState(getDefaultState().with(FACING, Direction.UP).with(ODD, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
builder.add(FACING, ODD);
|
||||
}
|
||||
|
||||
// For reference, see WallTorchBlock
|
||||
@Override
|
||||
@Nullable
|
||||
public BlockState getStateForPlacement(ItemPlacementContext context) {
|
||||
BlockState blockstate = super.getStateForPlacement(context);
|
||||
public BlockState getPlacementState(ItemPlacementContext context) {
|
||||
BlockState blockstate = super.getPlacementState(context);
|
||||
BlockPos pos = context.getBlockPos();
|
||||
|
||||
// Set the even/odd property
|
||||
boolean oddPlacement = ((pos.getX() + pos.getY() + pos.getZ()) % 2) != 0;
|
||||
blockstate = blockstate.with(ODD, oddPlacement);
|
||||
|
||||
IWorldReader iworldreader = context.getWorld();
|
||||
Direction[] adirection = context.getNearestLookingDirections();
|
||||
WorldView iworldreader = context.getWorld();
|
||||
Direction[] adirection = context.getPlacementDirections();
|
||||
|
||||
for (Direction direction : adirection) {
|
||||
if (canPlaceAt(iworldreader, pos, direction)) {
|
||||
@@ -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, WorldAccess worldIn,
|
||||
public BlockState getStateForNeighborUpdate(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)) {
|
||||
@@ -133,21 +133,21 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
return this.canPlaceAt(w, pos, up.getOpposite());
|
||||
}
|
||||
|
||||
private boolean canPlaceAt(final IWorldReader w, final BlockPos pos, final Direction dir) {
|
||||
private boolean canPlaceAt(final WorldView w, final BlockPos pos, final Direction dir) {
|
||||
final BlockPos test = pos.offset(dir);
|
||||
BlockState blockstate = w.getBlockState(test);
|
||||
return blockstate.isSolidSide(w, test, dir.getOpposite());
|
||||
return blockstate.isSideSolidFullSquare(w, test, dir.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
Direction facing = state.get(FACING);
|
||||
return SHAPES.get(facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
public void randomDisplayTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
if (!AEConfig.instance().isEnableEffects()) {
|
||||
return;
|
||||
}
|
||||
@@ -170,7 +170,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
|
||||
// FIXME: Replaced by the postPlaceupdate stuff above, but check item drops!
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final Direction up = this.getOrientable(world, pos).getUp();
|
||||
if (!this.canPlaceAt(world, pos, up.getOpposite())) {
|
||||
@@ -185,7 +185,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidPosition(BlockState state, IWorldReader w, BlockPos pos) {
|
||||
public boolean canPlaceAt(BlockState state, WorldView w, BlockPos pos) {
|
||||
for (final Direction dir : Direction.values()) {
|
||||
if (this.canPlaceAt(w, pos, dir)) {
|
||||
return true;
|
||||
@@ -199,9 +199,4 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
return new MetaRotation(w, pos, FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaque() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -44,7 +44,7 @@ import appeng.util.Platform;
|
||||
public class QuartzGrowthAcceleratorBlock extends AEBaseTileBlock<QuartzGrowthAcceleratorBlockEntity>
|
||||
implements IOrientableBlock {
|
||||
|
||||
private static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||
private static final BooleanProperty POWERED = BooleanProperty.of("powered");
|
||||
|
||||
public QuartzGrowthAcceleratorBlock() {
|
||||
super(defaultProps(Material.STONE).sounds(BlockSoundGroup.METAL));
|
||||
@@ -57,14 +57,14 @@ public class QuartzGrowthAcceleratorBlock extends AEBaseTileBlock<QuartzGrowthAc
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(POWERED);
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
public void randomDisplayTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
if (!AEConfig.instance().isEnableEffects()) {
|
||||
return;
|
||||
}
|
||||
@@ -99,30 +99,30 @@ public class QuartzGrowthAcceleratorBlock extends AEBaseTileBlock<QuartzGrowthAc
|
||||
case 0:
|
||||
dx = 0.6;
|
||||
dz = d1;
|
||||
pt = new BlockPos(x + west.getOffsetX(), y + west.getOffsetY(), z + west.getZOffset());
|
||||
pt = new BlockPos(x + west.getOffsetX(), y + west.getOffsetY(), z + west.getOffsetZ());
|
||||
|
||||
break;
|
||||
case 1:
|
||||
dx = d1;
|
||||
dz += 0.6;
|
||||
pt = new BlockPos(x + forward.getOffsetX(), y + forward.getOffsetY(), z + forward.getZOffset());
|
||||
pt = new BlockPos(x + forward.getOffsetX(), y + forward.getOffsetY(), z + forward.getOffsetZ());
|
||||
|
||||
break;
|
||||
case 2:
|
||||
dx = d1;
|
||||
dz = -0.6;
|
||||
pt = new BlockPos(x - forward.getOffsetX(), y - forward.getOffsetY(), z - forward.getZOffset());
|
||||
pt = new BlockPos(x - forward.getOffsetX(), y - forward.getOffsetY(), z - forward.getOffsetZ());
|
||||
|
||||
break;
|
||||
case 3:
|
||||
dx = -0.6;
|
||||
dz = d1;
|
||||
pt = new BlockPos(x - west.getOffsetX(), y - west.getOffsetY(), z - west.getZOffset());
|
||||
pt = new BlockPos(x - west.getOffsetX(), y - west.getOffsetY(), z - west.getOffsetZ());
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (!w.getBlockState(pt).getBlock().isAir(w.getBlockState(pt), w, pt)) {
|
||||
if (!w.getBlockState(pt).isAir()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public class QuartzGrowthAcceleratorBlock extends AEBaseTileBlock<QuartzGrowthAc
|
||||
ry += dz * forward.getOffsetY();
|
||||
rz += dz * forward.getOffsetZ();
|
||||
|
||||
MinecraftClient.getInstance().particles.addParticle(ParticleTypes.LIGHTNING, rx, ry, rz, 0.0D, 0.0D, 0.0D);
|
||||
MinecraftClient.getInstance().particleManager.addParticle(ParticleTypes.LIGHTNING, rx, ry, rz, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -41,17 +41,17 @@ import appeng.tile.misc.SecurityStationBlockEntity;
|
||||
|
||||
public class SecurityStationBlock extends AEBaseTileBlock<SecurityStationBlockEntity> {
|
||||
|
||||
private static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||
private static final BooleanProperty POWERED = BooleanProperty.of("powered");
|
||||
|
||||
public SecurityStationBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
|
||||
this.setDefaultState(this.getDefaultState().with(POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(POWERED);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class SecurityStationBlock extends AEBaseTileBlock<SecurityStationBlockEn
|
||||
}
|
||||
|
||||
ContainerOpener.openContainer(SecurityStationContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getSide()));
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
return ActionResult.PASS;
|
||||
|
||||
@@ -29,7 +29,7 @@ import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
@@ -53,11 +53,11 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassBlockEntity> {
|
||||
private boolean canPlaceAt(final BlockView w, final BlockPos pos, final Direction dir) {
|
||||
final BlockPos test = pos.offset(dir);
|
||||
BlockState blockstate = w.getBlockState(test);
|
||||
return blockstate.isSolidSide(w, test, dir.getOpposite());
|
||||
return blockstate.isSideSolidFullSquare(w, test, dir.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final SkyCompassBlockEntity sc = this.getBlockEntity(world, pos);
|
||||
final Direction forward = sc.getForward();
|
||||
@@ -73,7 +73,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassBlockEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidPosition(BlockState state, IWorldReader w, BlockPos pos) {
|
||||
public boolean canPlaceAt(BlockState state, WorldView w, BlockPos pos) {
|
||||
for (final Direction dir : Direction.values()) {
|
||||
if (this.canPlaceAt(w, pos, dir)) {
|
||||
return true;
|
||||
@@ -83,7 +83,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassBlockEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
|
||||
// TODO: This definitely needs to be memoized
|
||||
|
||||
@@ -139,7 +139,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassBlockEntity> {
|
||||
break;
|
||||
}
|
||||
|
||||
return VoxelShapes.create(new Box(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
return VoxelShapes.cuboid(new Box(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
}
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import appeng.bootstrap.TileEntityRenderingCustomizer;
|
||||
import appeng.client.render.tesr.SkyCompassTESR;
|
||||
import appeng.tile.misc.SkyCompassBlockEntity;
|
||||
|
||||
public class SkyCompassRendering extends TileEntityRenderingCustomizer<SkyCompassBlockEntity> {
|
||||
public class SkyCompassRendering implements TileEntityRenderingCustomizer<SkyCompassBlockEntity> {
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
|
||||
@@ -25,23 +25,22 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.projectile.AbstractArrowEntity;
|
||||
import net.minecraft.entity.projectile.PersistentProjectileEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.explosion.Explosion;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.entity.TinyTNTPrimedEntity;
|
||||
@@ -49,11 +48,10 @@ import appeng.entity.TinyTNTPrimedEntity;
|
||||
public class TinyTNTBlock extends AEBaseBlock {
|
||||
|
||||
private static final VoxelShape SHAPE = VoxelShapes
|
||||
.create(new Box(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f));
|
||||
.cuboid(new Box(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f));
|
||||
|
||||
public TinyTNTBlock(Settings props) {
|
||||
super(props);
|
||||
setFullSize(setOpaque(false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,7 +60,7 @@ public class TinyTNTBlock extends AEBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@@ -72,8 +70,8 @@ public class TinyTNTBlock extends AEBaseBlock {
|
||||
if (heldItem != null && heldItem.getItem() == Items.FLINT_AND_STEEL) {
|
||||
this.startFuse(w, pos, player);
|
||||
w.removeBlock(pos, false);
|
||||
heldItem.damageItem(1, player, p -> {
|
||||
p.sendBreakAnimation(hand);
|
||||
heldItem.damage(1, player, p -> {
|
||||
p.sendToolBreakStatus(hand);
|
||||
}); // FIXME Check if onBroken is equivalent
|
||||
return ActionResult.SUCCESS;
|
||||
} else {
|
||||
@@ -92,9 +90,8 @@ public class TinyTNTBlock extends AEBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
if (world.getRedstonePowerFromNeighbors(pos) > 0) {
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify) {
|
||||
if (world.isReceivingRedstonePower(pos)) {
|
||||
this.startFuse(world, pos, null);
|
||||
world.removeBlock(pos, false);
|
||||
}
|
||||
@@ -104,27 +101,23 @@ public class TinyTNTBlock extends AEBaseBlock {
|
||||
public void onBlockAdded(BlockState state, World w, BlockPos pos, BlockState oldState, boolean isMoving) {
|
||||
super.onBlockAdded(state, w, pos, oldState, isMoving);
|
||||
|
||||
if (w.getRedstonePowerFromNeighbors(pos) > 0) {
|
||||
if (w.getReceivedStrongRedstonePower(pos) > 0) {
|
||||
this.startFuse(w, pos, null);
|
||||
w.removeBlock(pos, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityWalk(final World w, final BlockPos pos, final Entity entity) {
|
||||
if (entity instanceof AbstractArrowEntity && !w.isClient) {
|
||||
final AbstractArrowEntity entityarrow = (AbstractArrowEntity) entity;
|
||||
public void onSteppedOn(final World w, final BlockPos pos, final Entity entity) {
|
||||
if (entity instanceof PersistentProjectileEntity && !w.isClient) {
|
||||
final PersistentProjectileEntity entityarrow = (PersistentProjectileEntity) entity;
|
||||
|
||||
if (entityarrow.isBurning()) {
|
||||
if (entityarrow.isOnFire()) {
|
||||
LivingEntity igniter = null;
|
||||
// Check if the shooter still exists
|
||||
if (w instanceof ServerWorld) {
|
||||
ServerWorld serverWorld = (ServerWorld) w;
|
||||
Entity shooter = serverWorld.getEntityByUuid(entityarrow.shootingEntity);
|
||||
if (shooter instanceof LivingEntity) {
|
||||
igniter = (LivingEntity) shooter;
|
||||
}
|
||||
|
||||
Entity shooter = entityarrow.getOwner();
|
||||
if (shooter instanceof LivingEntity) {
|
||||
igniter = (LivingEntity) shooter;
|
||||
}
|
||||
this.startFuse(w, pos, igniter);
|
||||
w.removeBlock(pos, false);
|
||||
@@ -133,18 +126,18 @@ public class TinyTNTBlock extends AEBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDropFromExplosion(final Explosion exp) {
|
||||
public boolean shouldDropItemsOnExplosion(final Explosion exp) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExplosionDestroy(final World w, final BlockPos pos, final Explosion exp) {
|
||||
super.onExplosionDestroy(w, pos, exp);
|
||||
public void onDestroyedByExplosion(final World w, final BlockPos pos, final Explosion exp) {
|
||||
super.onDestroyedByExplosion(w, pos, exp);
|
||||
if (!w.isClient) {
|
||||
final TinyTNTPrimedEntity primedTinyTNTEntity = new TinyTNTPrimedEntity(w, pos.getX() + 0.5F,
|
||||
pos.getY() + 0.5F, pos.getZ() + 0.5F, exp.getExplosivePlacedBy());
|
||||
pos.getY() + 0.5F, pos.getZ() + 0.5F, exp.getCausingEntity());
|
||||
primedTinyTNTEntity
|
||||
.setFuse(w.rand.nextInt(primedTinyTNTEntity.getFuse() / 4) + primedTinyTNTEntity.getFuse() / 8);
|
||||
.setFuse(w.random.nextInt(primedTinyTNTEntity.getFuse() / 4) + primedTinyTNTEntity.getFuse() / 8);
|
||||
w.spawnEntity(primedTinyTNTEntity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
@@ -42,17 +42,16 @@ import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.VibrationChamberContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.tile.AEBaseBlockEntity;
|
||||
import appeng.tile.misc.VibrationChamberBlockEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public final class VibrationChamberBlock extends AEBaseTileBlock<VibrationChamberBlockEntity> {
|
||||
|
||||
// Indicates that the vibration chamber is currently working
|
||||
private static final BooleanProperty ACTIVE = BooleanProperty.create("active");
|
||||
private static final BooleanProperty ACTIVE = BooleanProperty.of("active");
|
||||
|
||||
public VibrationChamberBlock() {
|
||||
super(defaultProps(Material.IRON).strength(4.2F));
|
||||
super(defaultProps(Material.METAL).strength(4.2F));
|
||||
this.setDefaultState(this.getDefaultState().with(ACTIVE, false));
|
||||
}
|
||||
|
||||
@@ -62,8 +61,8 @@ public final class VibrationChamberBlock extends AEBaseTileBlock<VibrationChambe
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(ACTIVE);
|
||||
}
|
||||
|
||||
@@ -78,7 +77,7 @@ public final class VibrationChamberBlock extends AEBaseTileBlock<VibrationChambe
|
||||
final VibrationChamberBlockEntity tc = this.getBlockEntity(w, pos);
|
||||
if (tc != null && !player.isInSneakingPose()) {
|
||||
ContainerOpener.openContainer(VibrationChamberContainer.TYPE, player,
|
||||
ContainerLocator.forTileEntitySide(tc, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tc, hit.getSide()));
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -87,44 +86,41 @@ public final class VibrationChamberBlock extends AEBaseTileBlock<VibrationChambe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
public void randomDisplayTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
if (!AEConfig.instance().isEnableEffects()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final AEBaseBlockEntity tile = this.getBlockEntity(w, pos);
|
||||
if (tile instanceof VibrationChamberBlockEntity) {
|
||||
final VibrationChamberBlockEntity tc = (VibrationChamberBlockEntity) tile;
|
||||
if (tc.isOn) {
|
||||
double f1 = pos.getX() + 0.5F;
|
||||
double f2 = pos.getY() + 0.5F;
|
||||
double f3 = pos.getZ() + 0.5F;
|
||||
final VibrationChamberBlockEntity tile = this.getBlockEntity(w, pos);
|
||||
if (tile != null && tile.isOn) {
|
||||
double f1 = pos.getX() + 0.5F;
|
||||
double f2 = pos.getY() + 0.5F;
|
||||
double f3 = pos.getZ() + 0.5F;
|
||||
|
||||
final Direction forward = tc.getForward();
|
||||
final Direction up = tc.getUp();
|
||||
final Direction forward = tile.getForward();
|
||||
final Direction up = tile.getUp();
|
||||
|
||||
final int west_x = forward.getOffsetY() * up.getOffsetZ() - forward.getOffsetZ() * up.getOffsetY();
|
||||
final int west_y = forward.getOffsetZ() * up.getOffsetX() - forward.getOffsetX() * up.getOffsetZ();
|
||||
final int west_z = forward.getOffsetX() * up.getOffsetY() - forward.getOffsetY() * up.getOffsetX();
|
||||
final int west_x = forward.getOffsetY() * up.getOffsetZ() - forward.getOffsetZ() * up.getOffsetY();
|
||||
final int west_y = forward.getOffsetZ() * up.getOffsetX() - forward.getOffsetX() * up.getOffsetZ();
|
||||
final int west_z = forward.getOffsetX() * up.getOffsetY() - forward.getOffsetY() * up.getOffsetX();
|
||||
|
||||
f1 += forward.getOffsetX() * 0.6;
|
||||
f2 += forward.getOffsetY() * 0.6;
|
||||
f3 += forward.getOffsetZ() * 0.6;
|
||||
f1 += forward.getOffsetX() * 0.6;
|
||||
f2 += forward.getOffsetY() * 0.6;
|
||||
f3 += forward.getOffsetZ() * 0.6;
|
||||
|
||||
final double ox = r.nextDouble();
|
||||
final double oy = r.nextDouble() * 0.2f;
|
||||
final double ox = r.nextDouble();
|
||||
final double oy = r.nextDouble() * 0.2f;
|
||||
|
||||
f1 += up.getOffsetX() * (-0.3 + oy);
|
||||
f2 += up.getOffsetY() * (-0.3 + oy);
|
||||
f3 += up.getOffsetZ() * (-0.3 + oy);
|
||||
f1 += up.getOffsetX() * (-0.3 + oy);
|
||||
f2 += up.getOffsetY() * (-0.3 + oy);
|
||||
f3 += up.getOffsetZ() * (-0.3 + oy);
|
||||
|
||||
f1 += west_x * (0.3 * ox - 0.15);
|
||||
f2 += west_y * (0.3 * ox - 0.15);
|
||||
f3 += west_z * (0.3 * ox - 0.15);
|
||||
f1 += west_x * (0.3 * ox - 0.15);
|
||||
f2 += west_y * (0.3 * ox - 0.15);
|
||||
f3 += west_z * (0.3 * ox - 0.15);
|
||||
|
||||
w.addParticle(ParticleTypes.SMOKE, f1, f2, f3, 0.0D, 0.0D, 0.0D);
|
||||
w.addParticle(ParticleTypes.FLAME, f1, f2, f3, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
w.addParticle(ParticleTypes.SMOKE, f1, f2, f3, 0.0D, 0.0D, 0.0D);
|
||||
w.addParticle(ParticleTypes.FLAME, f1, f2, f3, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ 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.IWorldReader;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.parts.IFacadeContainer;
|
||||
@@ -81,7 +81,9 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusBlockEntity> implemen
|
||||
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
|
||||
|
||||
public CableBusBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE).notSolid().noDrops());
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE)
|
||||
.nonOpaque()
|
||||
.dropsNothing());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,17 +92,17 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusBlockEntity> implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTick(final BlockState state, final World worldIn, final BlockPos pos, final Random rand) {
|
||||
this.cb(worldIn, pos).animateTick(worldIn, pos, rand);
|
||||
public void randomDisplayTick(final BlockState state, final World worldIn, final BlockPos pos, final Random rand) {
|
||||
this.cb(worldIn, pos).randomDisplayTick(worldIn, pos, rand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChange(BlockState state, IWorldReader w, BlockPos pos, BlockPos neighbor) {
|
||||
this.cb(w, pos).onNeighborChanged(w, pos, neighbor);
|
||||
public void onNeighborChange(BlockState state, WorldView w, BlockPos pos, BlockPos neighbor) {
|
||||
this.cb(w, pos).onneighborUpdate(w, pos, neighbor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(final BlockState state, final BlockView w, final BlockPos pos, final Direction side) {
|
||||
public int getWeakRedstonePower(final BlockState state, final BlockView w, final BlockPos pos, final Direction side) {
|
||||
return this.cb(w, pos).isProvidingWeakPower(side.getOpposite()); // TODO:
|
||||
// IS
|
||||
// OPPOSITE!?
|
||||
@@ -126,13 +128,13 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusBlockEntity> implemen
|
||||
@Override
|
||||
public int getLightValue(final BlockState state, final BlockView world, final BlockPos pos) {
|
||||
if (state.getBlock() != this) {
|
||||
return state.getBlock().getLightValue(state, world, pos);
|
||||
return state.getLuminance();
|
||||
}
|
||||
return this.cb(world, pos).getLightValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, LivingEntity entity) {
|
||||
public boolean isLadder(BlockState state, WorldView world, BlockPos pos, LivingEntity entity) {
|
||||
return this.cb(world, pos).isLadder(entity);
|
||||
}
|
||||
|
||||
@@ -273,10 +275,10 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusBlockEntity> implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
if (Platform.isServer()) {
|
||||
this.cb(world, pos).onNeighborChanged(world, pos, fromPos);
|
||||
this.cb(world, pos).onneighborUpdate(world, pos, fromPos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,7 +366,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusBlockEntity> implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
CableBusBlockEntity te = getBlockEntity(w, pos);
|
||||
if (te == null) {
|
||||
return VoxelShapes.empty();
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -67,14 +67,14 @@ public class ControllerBlock extends AEBaseTileBlock<ControllerBlockEntity> {
|
||||
ControllerRenderType.class);
|
||||
|
||||
public ControllerBlock() {
|
||||
super(defaultProps(Material.IRON).strength(6));
|
||||
super(defaultProps(Material.METAL).strength(6));
|
||||
this.setDefaultState(this.getDefaultState().with(CONTROLLER_STATE, ControllerBlockState.offline)
|
||||
.with(CONTROLLER_TYPE, ControllerRenderType.block));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(CONTROLLER_STATE);
|
||||
builder.add(CONTROLLER_TYPE);
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class ControllerBlock extends AEBaseTileBlock<ControllerBlockEntity> {
|
||||
* texture feel for the controller based on how it is placed.
|
||||
*/
|
||||
@Override
|
||||
public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, WorldAccess world,
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction facing, BlockState facingState, WorldAccess world,
|
||||
BlockPos pos, BlockPos facingPos) {
|
||||
|
||||
// FIXME: this might work, or might _NOT_ work, but needs to be investigated
|
||||
@@ -130,7 +130,7 @@ public class ControllerBlock extends AEBaseTileBlock<ControllerBlockEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final ControllerBlockEntity tc = this.getBlockEntity(world, pos);
|
||||
if (tc != null) {
|
||||
|
||||
@@ -26,6 +26,6 @@ import appeng.tile.networking.EnergyAcceptorBlockEntity;
|
||||
public class EnergyAcceptorBlock extends AEBaseTileBlock<EnergyAcceptorBlockEntity> {
|
||||
|
||||
public EnergyAcceptorBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.state.IntegerProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
@@ -59,8 +59,8 @@ public class EnergyCellBlock extends AEBaseTileBlock<EnergyCellBlockEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(ENERGY_STORAGE);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
@@ -79,8 +79,8 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessBlockEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(STATE);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessBlockEntity> {
|
||||
if (tg != null && !player.isInSneakingPose()) {
|
||||
if (Platform.isServer()) {
|
||||
ContainerOpener.openContainer(WirelessContainer.TYPE, player,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getSide()));
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessBlockEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
final WirelessBlockEntity tile = this.getBlockEntity(w, pos);
|
||||
if (tile != null) {
|
||||
final Direction forward = tile.getForward();
|
||||
@@ -154,7 +154,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessBlockEntity> {
|
||||
break;
|
||||
}
|
||||
|
||||
return VoxelShapes.create(new Box(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
return VoxelShapes.cuboid(new Box(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
}
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
@@ -214,7 +214,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessBlockEntity> {
|
||||
break;
|
||||
}
|
||||
|
||||
return VoxelShapes.create(new Box(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
return VoxelShapes.cuboid(new Box(minX, minY, minZ, maxX, maxY, maxZ));
|
||||
} else {
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
@@ -54,17 +54,17 @@ public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesBlockEnti
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final PaintSplotchesBlockEntity tp = this.getBlockEntity(world, pos);
|
||||
|
||||
if (tp != null) {
|
||||
tp.neighborChanged();
|
||||
tp.neighborUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ package appeng.block.qnb;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
@@ -35,13 +35,13 @@ import appeng.tile.qnb.QuantumBridgeBlockEntity;
|
||||
|
||||
public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeBlockEntity> {
|
||||
|
||||
public static final BooleanProperty FORMED = BooleanProperty.create("formed");
|
||||
public static final BooleanProperty FORMED = BooleanProperty.of("formed");
|
||||
|
||||
private static final VoxelShape SHAPE;
|
||||
|
||||
static {
|
||||
final float shave = 2.0f / 16.0f;
|
||||
SHAPE = VoxelShapes.create(new Box(shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave));
|
||||
SHAPE = VoxelShapes.cuboid(new Box(shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave));
|
||||
}
|
||||
|
||||
public QuantumBaseBlock(Settings props) {
|
||||
@@ -51,13 +51,13 @@ public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeBloc
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(FORMED);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeBloc
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final QuantumBridgeBlockEntity bridge = this.getBlockEntity(world, pos);
|
||||
if (bridge != null) {
|
||||
|
||||
@@ -51,7 +51,7 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
|
||||
|
||||
static {
|
||||
final double onePixel = 2.0 / 16.0;
|
||||
SHAPE = VoxelShapes.create(
|
||||
SHAPE = VoxelShapes.cuboid(
|
||||
new Box(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel));
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random rand) {
|
||||
public void randomDisplayTick(final BlockState state, final World w, final BlockPos pos, final Random rand) {
|
||||
final QuantumBridgeBlockEntity bridge = this.getBlockEntity(w, pos);
|
||||
if (bridge != null) {
|
||||
if (bridge.hasQES()) {
|
||||
@@ -90,7 +90,7 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,11 +36,11 @@ public class QuantumRingBlock extends QuantumBaseBlock {
|
||||
private static final VoxelShape SHAPE_FORMED = createShape(1.0 / 16.0);
|
||||
|
||||
public QuantumRingBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
final QuantumBridgeBlockEntity bridge = this.getBlockEntity(w, pos);
|
||||
if (bridge != null && bridge.isCorner()) {
|
||||
return SHAPE_CORNER;
|
||||
@@ -51,7 +51,7 @@ public class QuantumRingBlock extends QuantumBaseBlock {
|
||||
}
|
||||
|
||||
private static VoxelShape createShape(double onePixel) {
|
||||
return VoxelShapes.create(
|
||||
return VoxelShapes.cuboid(
|
||||
new Box(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ 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.Explosion;
|
||||
import net.minecraft.world.explosion.Explosion;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.World;
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
||||
@@ -71,13 +71,13 @@ public class MatrixFrameBlock extends AEBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
// This also prevents any blocks from being placed on this block!
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) {
|
||||
public boolean canPlaceAt(BlockState state, WorldView worldIn, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,11 +41,11 @@ import appeng.util.Platform;
|
||||
public class SpatialIOPortBlock extends AEBaseTileBlock<SpatialIOPortBlockEntity> {
|
||||
|
||||
public SpatialIOPortBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final SpatialIOPortBlockEntity te = this.getBlockEntity(world, pos);
|
||||
if (te != null) {
|
||||
@@ -64,7 +64,7 @@ public class SpatialIOPortBlock extends AEBaseTileBlock<SpatialIOPortBlockEntity
|
||||
if (tg != null) {
|
||||
if (Platform.isServer()) {
|
||||
ContainerOpener.openContainer(SpatialIOPortContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getSide()));
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -35,11 +35,11 @@ public class SpatialPylonBlock extends AEBaseTileBlock<SpatialPylonBlockEntity>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final SpatialPylonBlockEntity tsp = this.getBlockEntity(world, pos);
|
||||
if (tsp != null) {
|
||||
tsp.neighborChanged();
|
||||
tsp.neighborUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Util;
|
||||
@@ -47,13 +47,13 @@ public class ChestBlock extends AEBaseTileBlock<ChestBlockEntity> {
|
||||
DriveSlotState.class);
|
||||
|
||||
public ChestBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
this.setDefaultState(this.getDefaultState().with(SLOT_STATE, DriveSlotState.EMPTY));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(SLOT_STATE);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ChestBlock extends AEBaseTileBlock<ChestBlockEntity> {
|
||||
}
|
||||
} else {
|
||||
ContainerOpener.openContainer(ChestContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getSide()));
|
||||
}
|
||||
|
||||
return ActionResult.SUCCESS;
|
||||
|
||||
@@ -39,7 +39,7 @@ import appeng.util.Platform;
|
||||
public class DriveBlock extends AEBaseTileBlock<DriveBlockEntity> {
|
||||
|
||||
public DriveBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,11 +41,11 @@ import appeng.util.Platform;
|
||||
public class IOPortBlock extends AEBaseTileBlock<IOPortBlockEntity> {
|
||||
|
||||
public IOPortBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final IOPortBlockEntity te = this.getBlockEntity(world, pos);
|
||||
if (te != null) {
|
||||
@@ -64,7 +64,7 @@ public class IOPortBlock extends AEBaseTileBlock<IOPortBlockEntity> {
|
||||
if (tg != null) {
|
||||
if (Platform.isServer()) {
|
||||
ContainerOpener.openContainer(IOPortContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getSide()));
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -86,10 +86,10 @@ public class SkyChestBlock extends AEBaseTileBlock<SkyChestBlockEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
// TODO Cache this! It can't be that hard!
|
||||
Box aabb = computeAABB(worldIn, pos);
|
||||
return VoxelShapes.create(aabb);
|
||||
return VoxelShapes.cuboid(aabb);
|
||||
}
|
||||
|
||||
private Box computeAABB(final BlockView w, final BlockPos pos) {
|
||||
|
||||
@@ -174,7 +174,7 @@ public class ClientHelper extends ServerHelper {
|
||||
final double d1 = (Platform.getRandomFloat() - 0.5F) * 0.26D;
|
||||
final double d2 = (Platform.getRandomFloat() - 0.5F) * 0.26D;
|
||||
|
||||
MinecraftClient.getInstance().particles.addParticle(ParticleTypes.VIBRANT, x + d0, y + d1, z + d2, 0.0D, 0.0D,
|
||||
MinecraftClient.getInstance().particleManager.addParticle(ParticleTypes.VIBRANT, x + d0, y + d1, z + d2, 0.0D, 0.0D,
|
||||
0.0D);
|
||||
}
|
||||
}
|
||||
@@ -184,12 +184,12 @@ public class ClientHelper extends ServerHelper {
|
||||
final float y = (float) (((Platform.getRandomInt() % 100) * 0.01) - 0.5) * 0.7f;
|
||||
final float z = (float) (((Platform.getRandomInt() % 100) * 0.01) - 0.5) * 0.7f;
|
||||
|
||||
MinecraftClient.getInstance().particles.addParticle(EnergyParticleData.FOR_BLOCK, posX + x, posY + y, posZ + z,
|
||||
MinecraftClient.getInstance().particleManager.addParticle(EnergyParticleData.FOR_BLOCK, posX + x, posY + y, posZ + z,
|
||||
-x * 0.1, -y * 0.1, -z * 0.1);
|
||||
}
|
||||
|
||||
private void spawnLightning(final World world, final double posX, final double posY, final double posZ) {
|
||||
MinecraftClient.getInstance().particles.addParticle(ParticleTypes.LIGHTNING, posX, posY + 0.3f, posZ, 0.0f, 0.0f,
|
||||
MinecraftClient.getInstance().particleManager.addParticle(ParticleTypes.LIGHTNING, posX, posY + 0.3f, posZ, 0.0f, 0.0f,
|
||||
0.0f);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ public class ClientHelper extends ServerHelper {
|
||||
final Vec3d second) {
|
||||
final LightningFX fx = new LightningArcFX(world, posX, posY, posZ, second.x, second.y, second.z, 0.0f, 0.0f,
|
||||
0.0f);
|
||||
MinecraftClient.getInstance().particles.addEffect(fx);
|
||||
MinecraftClient.getInstance().particleManager.addParticle(fx);
|
||||
}
|
||||
|
||||
private void wheelEvent(final InputEvent.MouseScrollEvent me) {
|
||||
|
||||
@@ -57,7 +57,7 @@ public abstract class DelegateBakedModel implements BakedModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BakedModel handlePerspective(ModelTransformation.TransformType cameraTransformType, MatrixStack mat) {
|
||||
public BakedModel handlePerspective(ModelTransformation.Mode cameraTransformType, MatrixStack mat) {
|
||||
baseModel.handlePerspective(cameraTransformType, mat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
import net.minecraft.client.renderer.TransformationMatrix;
|
||||
import net.minecraft.client.util.math.AffineTransformation;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
@@ -108,7 +108,7 @@ public class DummyFluidDispatcherBakedModel extends DelegateBakedModel {
|
||||
}
|
||||
|
||||
return new DummyFluidBakedModel(
|
||||
ItemLayerModel.getQuadsForSprite(0, sprite, TransformationMatrix.identity()));
|
||||
ItemLayerModel.getQuadsForSprite(0, sprite, AffineTransformation.identity()));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.client.renderer.Quaternion;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.client.renderer.Vector4f;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
@@ -22,9 +22,9 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.util.math.AffineTransformation;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.TransformationMatrix;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.core.AEConfig;
|
||||
@@ -67,7 +67,7 @@ public class StackSizeRenderer {
|
||||
final float inverseScaleFactor = 1.0f / scaleFactor;
|
||||
final int offset = AEConfig.instance().isUseLargeFonts() ? 0 : -1;
|
||||
|
||||
TransformationMatrix tm = new TransformationMatrix(new Vector3f(0, 0, 300), // Taken from
|
||||
AffineTransformation tm = new AffineTransformation(new Vector3f(0, 0, 300), // Taken from
|
||||
// ItemRenderer.renderItemOverlayIntoGUI
|
||||
null, new Vector3f(scaleFactor, scaleFactor, scaleFactor), null);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -92,7 +92,7 @@ public class TesrRenderHelper {
|
||||
// effect at least from head-on
|
||||
matrixStack.scale(scale, scale, 0.0002f);
|
||||
|
||||
MinecraftClient.getInstance().getItemRenderer().renderItem(itemStack, ModelTransformation.TransformType.GUI,
|
||||
MinecraftClient.getInstance().getItemRenderer().renderItem(itemStack, ModelTransformation.Mode.GUI,
|
||||
combinedLightIn, OverlayTexture.NO_OVERLAY, matrixStack, buffers);
|
||||
|
||||
matrixStack.pop();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package appeng.client.render.cablebus;
|
||||
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.particle.SpriteTexturedParticle;
|
||||
import net.minecraft.client.particle.SpriteBillboardParticle;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.world.World;
|
||||
import net.fabricmc.api.EnvType;
|
||||
@@ -10,7 +10,7 @@ import net.fabricmc.api.Environment;
|
||||
// Derived from Vanilla's BreakingParticle, but allows
|
||||
// a texture to be specified directly rather than via an itemstack
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class CableBusBreakingParticle extends SpriteTexturedParticle {
|
||||
public class CableBusBreakingParticle extends SpriteBillboardParticle {
|
||||
|
||||
private final float field_217571_C;
|
||||
private final float field_217572_F;
|
||||
|
||||
@@ -365,7 +365,7 @@ public class CubeBuilder {
|
||||
builder.put(i, x, y, z);
|
||||
break;
|
||||
case NORMAL:
|
||||
builder.put(i, face.getOffsetX(), face.getOffsetY(), face.getZOffset());
|
||||
builder.put(i, face.getOffsetX(), face.getOffsetY(), face.getOffsetZ());
|
||||
break;
|
||||
case COLOR:
|
||||
// Color format is RGBA
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
@@ -10,7 +10,7 @@ import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.renderer.TransformationMatrix;
|
||||
import net.minecraft.client.util.math.AffineTransformation;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
@@ -30,7 +30,7 @@ import appeng.items.misc.EncodedPatternItem;
|
||||
* a custom IBakedModel ({@link ShiftHoldingModelWrapper} if the player is
|
||||
* holding down shift from the override list. This custom baked model implements
|
||||
* {@link #doesHandlePerspectives()} and returns the crafting result model if
|
||||
* the model for {@link ModelTransformation.TransformType#GUI} is requested.
|
||||
* the model for {@link ModelTransformation.Mode#GUI} is requested.
|
||||
*/
|
||||
public class EncodedPatternBakedModel extends DelegateBakedModel {
|
||||
|
||||
@@ -71,11 +71,11 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BakedModel handlePerspective(ModelTransformation.TransformType cameraTransformType, MatrixStack mat) {
|
||||
public BakedModel handlePerspective(ModelTransformation.Mode cameraTransformType, MatrixStack mat) {
|
||||
// No need to re-check for shift being held since this model is only handed out
|
||||
// in that case
|
||||
if (cameraTransformType == ModelTransformation.TransformType.GUI) {
|
||||
ImmutableMap<ModelTransformation.TransformType, TransformationMatrix> transforms = PerspectiveMapWrapper
|
||||
if (cameraTransformType == ModelTransformation.Mode.GUI) {
|
||||
ImmutableMap<ModelTransformation.Mode, AffineTransformation> transforms = PerspectiveMapWrapper
|
||||
.getTransforms(outputModel.getTransformation());
|
||||
return PerspectiveMapWrapper.handlePerspective(this.outputModel, transforms, cameraTransformType, mat);
|
||||
} else {
|
||||
@@ -98,7 +98,7 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BakedModel handlePerspective(ModelTransformation.TransformType cameraTransformType, MatrixStack mat) {
|
||||
public BakedModel handlePerspective(ModelTransformation.Mode cameraTransformType, MatrixStack mat) {
|
||||
return getBaseModel().handlePerspective(cameraTransformType, mat);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.client.particle.IAnimatedSprite;
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.RedstoneParticle;
|
||||
import net.minecraft.particles.BasicParticleType;
|
||||
import net.minecraft.particle.DefaultParticleType;
|
||||
import net.minecraft.particles.RedstoneParticleData;
|
||||
import net.minecraft.world.World;
|
||||
import net.fabricmc.api.EnvType;
|
||||
@@ -50,7 +50,7 @@ public class ChargedOreFX extends RedstoneParticle {
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static class Factory implements IParticleFactory<BasicParticleType> {
|
||||
public static class Factory implements IParticleFactory<DefaultParticleType> {
|
||||
private final IAnimatedSprite spriteSet;
|
||||
|
||||
public Factory(IAnimatedSprite p_i50477_1_) {
|
||||
@@ -58,8 +58,8 @@ public class ChargedOreFX extends RedstoneParticle {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle makeParticle(BasicParticleType typeIn, World worldIn, double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed) {
|
||||
public Particle makeParticle(DefaultParticleType typeIn, World worldIn, double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed) {
|
||||
return new ChargedOreFX(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,17 +25,17 @@ import net.minecraft.client.particle.IAnimatedSprite;
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.SpriteTexturedParticle;
|
||||
import net.minecraft.client.particle.SpriteBillboardParticle;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.particles.BasicParticleType;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.particle.DefaultParticleType;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class CraftingFx extends SpriteTexturedParticle {
|
||||
public class CraftingFx extends SpriteBillboardParticle {
|
||||
|
||||
// Offset relative to center of block, is the starting point of the particle
|
||||
// movement
|
||||
@@ -126,7 +126,7 @@ public class CraftingFx extends SpriteTexturedParticle {
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static class Factory implements IParticleFactory<BasicParticleType> {
|
||||
public static class Factory implements IParticleFactory<DefaultParticleType> {
|
||||
private final IAnimatedSprite spriteSet;
|
||||
|
||||
public Factory(IAnimatedSprite p_i50477_1_) {
|
||||
@@ -134,8 +134,8 @@ public class CraftingFx extends SpriteTexturedParticle {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle makeParticle(BasicParticleType data, World worldIn, double x, double y, double z, double xSpeed,
|
||||
double ySpeed, double zSpeed) {
|
||||
public Particle makeParticle(DefaultParticleType data, World worldIn, double x, double y, double z, double xSpeed,
|
||||
double ySpeed, double zSpeed) {
|
||||
return new CraftingFx(worldIn, x, y, z, spriteSet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class EnergyFx extends SpriteTexturedParticle {
|
||||
public class EnergyFx extends SpriteBillboardParticle {
|
||||
|
||||
private final int startBlkX;
|
||||
private final int startBlkY;
|
||||
|
||||
@@ -24,12 +24,12 @@ import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.particles.IParticleData;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.minecraft.particle.ParticleEffect;
|
||||
import net.minecraft.particle.ParticleType;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
|
||||
public class EnergyParticleData implements IParticleData {
|
||||
public class EnergyParticleData implements ParticleEffect {
|
||||
|
||||
public static final EnergyParticleData FOR_BLOCK = new EnergyParticleData(false, AEPartLocation.INTERNAL);
|
||||
|
||||
@@ -42,9 +42,9 @@ public class EnergyParticleData implements IParticleData {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public static final IDeserializer<EnergyParticleData> DESERIALIZER = new IDeserializer<EnergyParticleData>() {
|
||||
public static final Factory<EnergyParticleData> DESERIALIZER = new Factory<EnergyParticleData>() {
|
||||
@Override
|
||||
public EnergyParticleData deserialize(ParticleType<EnergyParticleData> particleTypeIn, StringReader reader)
|
||||
public EnergyParticleData read(ParticleType<EnergyParticleData> particleTypeIn, StringReader reader)
|
||||
throws CommandSyntaxException {
|
||||
reader.expect(' ');
|
||||
boolean forItem = reader.readBoolean();
|
||||
@@ -73,7 +73,7 @@ public class EnergyParticleData implements IParticleData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParameters() {
|
||||
public String asString() {
|
||||
return String.format(Locale.ROOT, "%s %s", forItem ? "true" : "false", direction.name().toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.particle.IAnimatedSprite;
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.SpriteTexturedParticle;
|
||||
import net.minecraft.client.particle.SpriteBillboardParticle;
|
||||
import net.minecraft.world.World;
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class LightningArcFX extends LightningFX {
|
||||
@Override
|
||||
public Particle makeParticle(LightningArcParticleData data, World worldIn, double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed) {
|
||||
SpriteTexturedParticle lightningFX = new LightningArcFX(worldIn, x, y, z, data.target.x, data.target.y,
|
||||
SpriteBillboardParticle lightningFX = new LightningArcFX(worldIn, x, y, z, data.target.x, data.target.y,
|
||||
data.target.z, 0, 0, 0);
|
||||
lightningFX.selectSpriteRandomly(this.spriteSet);
|
||||
return lightningFX;
|
||||
|
||||
@@ -6,15 +6,15 @@ import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.particles.IParticleData;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.minecraft.particle.ParticleEffect;
|
||||
import net.minecraft.particle.ParticleType;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
/**
|
||||
* Contains the target point of the lightning arc (the source point is infered
|
||||
* from the particle starting position).
|
||||
*/
|
||||
public class LightningArcParticleData implements IParticleData {
|
||||
public class LightningArcParticleData implements ParticleEffect {
|
||||
|
||||
public final Vec3d target;
|
||||
|
||||
@@ -22,10 +22,10 @@ public class LightningArcParticleData implements IParticleData {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public static final IDeserializer<LightningArcParticleData> DESERIALIZER = new IDeserializer<LightningArcParticleData>() {
|
||||
public static final Factory<LightningArcParticleData> DESERIALIZER = new Factory<LightningArcParticleData>() {
|
||||
@Override
|
||||
public LightningArcParticleData deserialize(ParticleType<LightningArcParticleData> particleTypeIn,
|
||||
StringReader reader) throws CommandSyntaxException {
|
||||
public LightningArcParticleData read(ParticleType<LightningArcParticleData> particleTypeIn,
|
||||
StringReader reader) throws CommandSyntaxException {
|
||||
reader.expect(' ');
|
||||
float x = reader.readFloat();
|
||||
reader.expect(' ');
|
||||
@@ -58,7 +58,7 @@ public class LightningArcParticleData implements IParticleData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParameters() {
|
||||
public String asString() {
|
||||
return String.format(Locale.ROOT, "%.2f %.2f %.2f", target.x, target.y, target.z);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,16 +29,16 @@ import net.minecraft.client.particle.IAnimatedSprite;
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.SpriteTexturedParticle;
|
||||
import net.minecraft.client.particle.SpriteBillboardParticle;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.particles.BasicParticleType;
|
||||
import net.minecraft.particle.DefaultParticleType;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class LightningFX extends SpriteTexturedParticle {
|
||||
public class LightningFX extends SpriteBillboardParticle {
|
||||
|
||||
private static final Random RANDOM_GENERATOR = new Random();
|
||||
private static final int STEPS = 5;
|
||||
@@ -245,7 +245,7 @@ public class LightningFX extends SpriteTexturedParticle {
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static class Factory implements IParticleFactory<BasicParticleType> {
|
||||
public static class Factory implements IParticleFactory<DefaultParticleType> {
|
||||
private final IAnimatedSprite spriteSet;
|
||||
|
||||
public Factory(IAnimatedSprite spriteSet) {
|
||||
@@ -253,8 +253,8 @@ public class LightningFX extends SpriteTexturedParticle {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle makeParticle(BasicParticleType typeIn, World worldIn, double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed) {
|
||||
public Particle makeParticle(DefaultParticleType typeIn, World worldIn, double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed) {
|
||||
LightningFX lightningFX = new LightningFX(worldIn, x, y, z, xSpeed, ySpeed, zSpeed);
|
||||
lightningFX.selectSpriteRandomly(this.spriteSet);
|
||||
return lightningFX;
|
||||
|
||||
@@ -20,13 +20,13 @@ package appeng.client.render.effects;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraft.client.particle.*;
|
||||
import net.minecraft.particles.BasicParticleType;
|
||||
import net.minecraft.particle.DefaultParticleType;
|
||||
import net.minecraft.world.World;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
|
||||
public class MatterCannonFX extends SpriteTexturedParticle {
|
||||
public class MatterCannonFX extends SpriteBillboardParticle {
|
||||
|
||||
public MatterCannonFX(final World par1World, final double x, final double y, final double z,
|
||||
IAnimatedSprite sprite) {
|
||||
@@ -73,7 +73,7 @@ public class MatterCannonFX extends SpriteTexturedParticle {
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static class Factory implements IParticleFactory<BasicParticleType> {
|
||||
public static class Factory implements IParticleFactory<DefaultParticleType> {
|
||||
private final IAnimatedSprite spriteSet;
|
||||
|
||||
public Factory(IAnimatedSprite spriteSet) {
|
||||
@@ -81,8 +81,8 @@ public class MatterCannonFX extends SpriteTexturedParticle {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle makeParticle(BasicParticleType data, World world, double x, double y, double z, double xSpeed,
|
||||
double ySpeed, double zSpeed) {
|
||||
public Particle makeParticle(DefaultParticleType data, World world, double x, double y, double z, double xSpeed,
|
||||
double ySpeed, double zSpeed) {
|
||||
return new MatterCannonFX(world, x, y, z, spriteSet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
import net.minecraft.particles.BasicParticleType;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.fabricmc.fabric.api.particle.v1.FabricParticleTypes;
|
||||
import net.minecraft.particle.DefaultParticleType;
|
||||
import net.minecraft.particle.ParticleType;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
|
||||
@@ -10,15 +11,15 @@ public final class ParticleTypes {
|
||||
private ParticleTypes() {
|
||||
}
|
||||
|
||||
public static final BasicParticleType CHARGED_ORE = new BasicParticleType(false);
|
||||
public static final BasicParticleType CRAFTING = new BasicParticleType(false);
|
||||
public static final ParticleType<EnergyParticleData> ENERGY = new ParticleType<>(false,
|
||||
public static final DefaultParticleType CHARGED_ORE = FabricParticleTypes.simple(false);
|
||||
public static final DefaultParticleType CRAFTING = FabricParticleTypes.simple(false);
|
||||
public static final ParticleType<EnergyParticleData> ENERGY = FabricParticleTypes.complex(false,
|
||||
EnergyParticleData.DESERIALIZER);
|
||||
public static final ParticleType<LightningArcParticleData> LIGHTNING_ARC = new ParticleType<>(false,
|
||||
public static final ParticleType<LightningArcParticleData> LIGHTNING_ARC = FabricParticleTypes.complex(false,
|
||||
LightningArcParticleData.DESERIALIZER);
|
||||
public static final BasicParticleType LIGHTNING = new BasicParticleType(false);
|
||||
public static final BasicParticleType MATTER_CANNON = new BasicParticleType(false);
|
||||
public static final BasicParticleType VIBRANT = new BasicParticleType(false);
|
||||
public static final DefaultParticleType LIGHTNING = FabricParticleTypes.simple(false);
|
||||
public static final DefaultParticleType MATTER_CANNON = FabricParticleTypes.simple(false);
|
||||
public static final DefaultParticleType VIBRANT = FabricParticleTypes.simple(false);
|
||||
|
||||
static {
|
||||
CHARGED_ORE.setRegistryName(AppEng.MOD_ID, "charged_ore_fx");
|
||||
|
||||
@@ -24,12 +24,12 @@ import net.minecraft.client.particle.IAnimatedSprite;
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.SpriteTexturedParticle;
|
||||
import net.minecraft.particles.BasicParticleType;
|
||||
import net.minecraft.client.particle.SpriteBillboardParticle;
|
||||
import net.minecraft.particle.DefaultParticleType;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class VibrantFX extends SpriteTexturedParticle {
|
||||
public class VibrantFX extends SpriteBillboardParticle {
|
||||
|
||||
public VibrantFX(final World par1World, final double x, final double y, final double z, final double par8,
|
||||
final double par10, final double par12, IAnimatedSprite sprite) {
|
||||
@@ -80,7 +80,7 @@ public class VibrantFX extends SpriteTexturedParticle {
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static class Factory implements IParticleFactory<BasicParticleType> {
|
||||
public static class Factory implements IParticleFactory<DefaultParticleType> {
|
||||
private final IAnimatedSprite spriteSet;
|
||||
|
||||
public Factory(IAnimatedSprite spriteSet) {
|
||||
@@ -88,8 +88,8 @@ public class VibrantFX extends SpriteTexturedParticle {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle makeParticle(BasicParticleType typeIn, World worldIn, double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed) {
|
||||
public Particle makeParticle(DefaultParticleType typeIn, World worldIn, double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed) {
|
||||
return new VibrantFX(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, spriteSet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ class BiometricCardBakedModel implements BakedModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BakedModel handlePerspective(ModelTransformation.TransformType cameraTransformType, MatrixStack mat) {
|
||||
public BakedModel handlePerspective(ModelTransformation.Mode cameraTransformType, MatrixStack mat) {
|
||||
baseModel.handlePerspective(cameraTransformType, mat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ class ColorApplicatorBakedModel implements BakedModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BakedModel handlePerspective(ModelTransformation.TransformType cameraTransformType, MatrixStack mat) {
|
||||
public BakedModel handlePerspective(ModelTransformation.Mode cameraTransformType, MatrixStack mat) {
|
||||
return PerspectiveMapWrapper.handlePerspective(this, transforms, cameraTransformType, mat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ class MemoryCardBakedModel implements BakedModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BakedModel handlePerspective(ModelTransformation.TransformType cameraTransformType, MatrixStack mat) {
|
||||
public BakedModel handlePerspective(ModelTransformation.Mode cameraTransformType, MatrixStack mat) {
|
||||
baseModel.handlePerspective(cameraTransformType, mat);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.render.model.ModelLoader;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
import net.minecraft.client.util.math.AffineTransformation;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
@@ -42,7 +43,6 @@ import net.minecraft.util.Identifier;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.client.renderer.TransformationMatrix;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.BlockFaceUV;
|
||||
import net.minecraft.client.render.model.BlockModel;
|
||||
@@ -89,7 +89,7 @@ public class UVLModelLoader implements IModelLoader<UVLModelLoader.UVLModelWrapp
|
||||
.registerTypeAdapter(ItemTransformVec3f.class, new ItemTransformVec3f.Deserializer())
|
||||
.registerTypeAdapter(ModelTransformation.class, new ModelTransformation.Deserializer())
|
||||
.registerTypeAdapter(ItemOverride.class, new ItemOverride.Deserializer())
|
||||
.registerTypeAdapter(TransformationMatrix.class, new TransformationHelper.Deserializer()).create();
|
||||
.registerTypeAdapter(AffineTransformation.class, new TransformationHelper.Deserializer()).create();
|
||||
|
||||
private static class BlockPartFaceOverrideSerializer extends BlockPartFace.Deserializer {
|
||||
@Override
|
||||
|
||||
@@ -18,37 +18,35 @@
|
||||
|
||||
package appeng.client.render.renderable;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
import net.minecraft.client.render.model.json.Transformation;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.client.renderer.TransformationMatrix;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class ItemRenderable<T extends BlockEntity> implements Renderable<T> {
|
||||
|
||||
private final Function<T, Pair<ItemStack, TransformationMatrix>> f;
|
||||
private final Function<T, Pair<ItemStack, Transformation>> f;
|
||||
|
||||
public ItemRenderable(Function<T, Pair<ItemStack, TransformationMatrix>> f) {
|
||||
public ItemRenderable(Function<T, Pair<ItemStack, Transformation>> f) {
|
||||
this.f = f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(T te, float partialTicks, net.minecraft.client.util.math.MatrixStack matrixStack,
|
||||
VertexConsumerProvider buffers, int combinedLight, int combinedOverlay) {
|
||||
Pair<ItemStack, TransformationMatrix> pair = this.f.apply(te);
|
||||
Pair<ItemStack, Transformation> pair = this.f.apply(te);
|
||||
if (pair != null && pair.getLeft() != null) {
|
||||
matrixStack.push();
|
||||
if (pair.getRight() != null) {
|
||||
pair.getRight().push(matrixStack);
|
||||
} else {
|
||||
matrixStack.push();
|
||||
pair.getRight().apply(true, matrixStack); // FIXME: check left handed
|
||||
}
|
||||
MinecraftClient.getInstance().getItemRenderer().renderItem(pair.getLeft(),
|
||||
ModelTransformation.TransformType.GROUND, combinedLight, combinedOverlay, matrixStack, buffers);
|
||||
ModelTransformation.Mode.GROUND, combinedLight, combinedOverlay, matrixStack, buffers);
|
||||
matrixStack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.renderer.RenderState;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
@@ -178,7 +178,7 @@ public final class InscriberTESR extends BlockEntityRenderer<InscriberBlockEntit
|
||||
vb.tex(sprite.getInterpolatedU(texU), sprite.getInterpolatedV(texV));
|
||||
vb.overlay(overlayUV);
|
||||
vb.lightmap(lightmapUV);
|
||||
vb.normal(ms.getLast().getNormal(), front.getOffsetX(), front.getOffsetY(), front.getZOffset());
|
||||
vb.normal(ms.getLast().getNormal(), front.getOffsetX(), front.getOffsetY(), front.getOffsetZ());
|
||||
vb.endVertex();
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public final class InscriberTESR extends BlockEntityRenderer<InscriberBlockEntit
|
||||
ms.scale(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
|
||||
itemRenderer.renderItem(stack, ModelTransformation.TransformType.FIXED, combinedLight, combinedOverlay, ms,
|
||||
itemRenderer.renderItem(stack, ModelTransformation.Mode.FIXED, combinedLight, combinedOverlay, ms,
|
||||
buffers);
|
||||
ms.pop();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.Atlases;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.client.render.model.Material;
|
||||
import net.minecraft.client.render.model.ModelRenderer;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
||||
|
||||
@@ -152,7 +152,7 @@ public class QuartzKnifeContainer extends AEBaseContainer {
|
||||
if (!this.getItemHandler().extractItem(0, 1, false).isEmpty()) {
|
||||
final ItemStack item = QuartzKnifeContainer.this.toolInv.getItemStack();
|
||||
final ItemStack before = item.copy();
|
||||
item.damageItem(1, QuartzKnifeContainer.this.getPlayerInv().player, p -> {
|
||||
item.damage(1, QuartzKnifeContainer.this.getPlayerInv().player, p -> {
|
||||
QuartzKnifeContainer.this.getPlayerInv().setStack(
|
||||
QuartzKnifeContainer.this.getPlayerInv().currentItem, ItemStack.EMPTY);
|
||||
MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(
|
||||
|
||||
@@ -33,7 +33,7 @@ import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.recipe.RecipeSerializer;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.minecraft.particle.ParticleType;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
@@ -30,8 +30,8 @@ import net.minecraft.client.gui.ScreenManager;
|
||||
import net.minecraft.client.particle.ParticleManager;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.particle.ParticleType;
|
||||
import net.minecraft.recipe.RecipeSerializer;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
|
||||
@@ -329,7 +329,7 @@ public final class ApiBlocks implements IBlocks {
|
||||
() -> new SkyChestBlock(SkyChestBlock.SkyChestType.BLOCK, skyStoneChestProps))
|
||||
.features(AEFeature.SKY_STONE, AEFeature.SKY_STONE_CHESTS).tileEntity(skyChestTile).build();
|
||||
|
||||
this.skyCompass = registry.block("sky_compass", () -> new SkyCompassBlock(defaultProps(Material.MISCELLANEOUS)))
|
||||
this.skyCompass = registry.block("sky_compass", () -> new SkyCompassBlock(defaultProps(Material.SUPPORTED)))
|
||||
.features(AEFeature.METEORITE_COMPASS)
|
||||
.tileEntity(registry.tileEntity("sky_compass", SkyCompassBlockEntity.class, SkyCompassBlockEntity::new)
|
||||
.rendering(new SkyCompassRendering()).build())
|
||||
@@ -353,7 +353,7 @@ public final class ApiBlocks implements IBlocks {
|
||||
}
|
||||
}).build())
|
||||
.build();
|
||||
this.inscriber = registry.block("inscriber", () -> new InscriberBlock(defaultProps(Material.IRON).notSolid()))
|
||||
this.inscriber = registry.block("inscriber", () -> new InscriberBlock(defaultProps(Material.METAL).notSolid()))
|
||||
.features(AEFeature.INSCRIBER)
|
||||
.tileEntity(registry.tileEntity("inscriber", InscriberBlockEntity.class, InscriberBlockEntity::new)
|
||||
.rendering(new InscriberRendering()).build())
|
||||
@@ -481,7 +481,7 @@ public final class ApiBlocks implements IBlocks {
|
||||
.tileEntity("crafting_unit", CraftingBlockEntity.class, CraftingBlockEntity::new).build();
|
||||
|
||||
FeatureFactory crafting = registry.features(AEFeature.CRAFTING_CPU);
|
||||
AbstractBlock.Settings craftingBlockProps = defaultProps(Material.IRON);
|
||||
AbstractBlock.Settings craftingBlockProps = defaultProps(Material.METAL);
|
||||
this.craftingUnit = crafting
|
||||
.block("crafting_unit", () -> new CraftingUnitBlock(craftingBlockProps, CraftingUnitType.UNIT))
|
||||
.rendering(new CraftingCubeRendering()).tileEntity(craftingUnit).build();
|
||||
@@ -539,7 +539,7 @@ public final class ApiBlocks implements IBlocks {
|
||||
}).build();
|
||||
|
||||
this.molecularAssembler = registry
|
||||
.block("molecular_assembler", () -> new MolecularAssemblerBlock(defaultProps(Material.IRON).notSolid()))
|
||||
.block("molecular_assembler", () -> new MolecularAssemblerBlock(defaultProps(Material.METAL).notSolid()))
|
||||
.features(AEFeature.MOLECULAR_ASSEMBLER).rendering(new BlockRenderingCustomizer() {
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
|
||||
@@ -29,10 +29,10 @@ import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.client.audio.SimpleSound;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.tags.FluidTags;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.tag.FluidTags;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraftforge.registries.GameData;
|
||||
@@ -116,7 +116,7 @@ public class BlockTransitionEffectPacket extends BasePacket {
|
||||
double speedY = 0.1f * this.direction.yOffset;
|
||||
double speedZ = 0.1f * this.direction.zOffset;
|
||||
|
||||
MinecraftClient.getInstance().particles.addParticle(data, x, y, z, speedX, speedY, speedZ);
|
||||
MinecraftClient.getInstance().particleManager.addParticle(data, x, y, z, speedX, speedY, speedZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ItemTransitionEffectPacket extends BasePacket {
|
||||
double speedX = 0.1f * this.d.xOffset;
|
||||
double speedY = 0.1f * this.d.yOffset;
|
||||
double speedZ = 0.1f * this.d.zOffset;
|
||||
MinecraftClient.getInstance().particles.addParticle(data, x, y, z, speedX, speedY, speedZ);
|
||||
MinecraftClient.getInstance().particleManager.addParticle(data, x, y, z, speedX, speedY, speedZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class MatterCannonPacket extends BasePacket {
|
||||
public void clientPacketData(final INetworkInfo network, final PlayerEntity player) {
|
||||
try {
|
||||
for (int a = 1; a < this.len; a++) {
|
||||
MinecraftClient.getInstance().particles.addParticle(ParticleTypes.MATTER_CANNON, this.x + this.dx * a,
|
||||
MinecraftClient.getInstance().particleManager.addParticle(ParticleTypes.MATTER_CANNON, this.x + this.dx * a,
|
||||
this.y + this.dy * a, this.z + this.dz * a, 0, 0, 0);
|
||||
}
|
||||
} catch (final Exception ignored) {
|
||||
|
||||
@@ -23,11 +23,9 @@ import io.netty.buffer.Unpooled;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.BasePacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import appeng.block.AEBaseTileBlock;
|
||||
public class ChunkLoaderBlock extends AEBaseTileBlock<ChunkLoaderBlockEntity> {
|
||||
|
||||
public ChunkLoaderBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package appeng.debug;
|
||||
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.Tickable;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.server.world.ServerWorld;
|
||||
import appeng.core.AELog;
|
||||
import appeng.tile.AEBaseBlockEntity;
|
||||
|
||||
public class ChunkLoaderBlockEntity extends AEBaseBlockEntity implements ITickableTileEntity {
|
||||
public class ChunkLoaderBlockEntity extends AEBaseBlockEntity implements Tickable {
|
||||
|
||||
public ChunkLoaderBlockEntity(BlockEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
|
||||
@@ -34,7 +34,7 @@ import appeng.block.AEBaseTileBlock;
|
||||
public class CubeGeneratorBlock extends AEBaseTileBlock<CubeGeneratorBlockEntity> {
|
||||
|
||||
public CubeGeneratorBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.item.DirectionalPlaceContext;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUsageContext;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.Tickable;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -33,7 +33,7 @@ import appeng.core.AppEng;
|
||||
import appeng.tile.AEBaseBlockEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class CubeGeneratorBlockEntity extends AEBaseBlockEntity implements ITickableTileEntity {
|
||||
public class CubeGeneratorBlockEntity extends AEBaseBlockEntity implements Tickable {
|
||||
|
||||
private int size = 3;
|
||||
private ItemStack is = ItemStack.EMPTY;
|
||||
|
||||
@@ -25,7 +25,7 @@ import appeng.block.AEBaseTileBlock;
|
||||
public class EnergyGeneratorBlock extends AEBaseTileBlock<EnergyGeneratorBlockEntity> {
|
||||
|
||||
public EnergyGeneratorBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.google.common.math.IntMath;
|
||||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.Tickable;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
@@ -34,7 +34,7 @@ import net.minecraftforge.energy.IEnergyStorage;
|
||||
|
||||
import appeng.tile.AEBaseBlockEntity;
|
||||
|
||||
public class EnergyGeneratorBlockEntity extends AEBaseBlockEntity implements ITickableTileEntity, IEnergyStorage {
|
||||
public class EnergyGeneratorBlockEntity extends AEBaseBlockEntity implements Tickable, IEnergyStorage {
|
||||
/**
|
||||
* The base energy injected each tick. Adjacent TileEnergyGenerators will
|
||||
* increase it to pow(base, #generators).
|
||||
|
||||
@@ -28,7 +28,7 @@ import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUsageContext;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tag.BlockTags;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -25,7 +25,7 @@ import appeng.block.AEBaseTileBlock;
|
||||
public class ItemGenBlock extends AEBaseTileBlock<ItemGenBlockEntity> {
|
||||
|
||||
public ItemGenBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import appeng.block.AEBaseTileBlock;
|
||||
public class PhantomNodeBlock extends AEBaseTileBlock<PhantomNodeBlockEntity> {
|
||||
|
||||
public PhantomNodeBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ChargedQuartzOreBlock extends QuartzOreBlock {
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
public void randomDisplayTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
if (!AEConfig.instance().isEnableEffects()) {
|
||||
return;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class ChargedQuartzOreBlock extends QuartzOreBlock {
|
||||
}
|
||||
|
||||
if (AppEng.proxy.shouldAddParticles(r)) {
|
||||
MinecraftClient.getInstance().particles.addParticle(ParticleTypes.CHARGED_ORE, pos.getX() + xOff,
|
||||
MinecraftClient.getInstance().particleManager.addParticle(ParticleTypes.CHARGED_ORE, pos.getX() + xOff,
|
||||
pos.getY() + yOff, pos.getZ() + zOff, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class QuartzLampBlock extends QuartzGlassBlock {
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
public void randomDisplayTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
if (!AEConfig.instance().isEnableEffects()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class QuartzOreBlock extends AEBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getExpDrop(BlockState state, net.minecraft.world.IWorldReader reader, BlockPos pos, int fortune,
|
||||
public int getExpDrop(BlockState state, net.minecraft.world.WorldView reader, BlockPos pos, int fortune,
|
||||
int silktouch) {
|
||||
return silktouch == 0 ? MathHelper.nextInt(RANDOM, 2, 5) : 0;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ package appeng.decorative.solid;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.BlockView;
|
||||
@@ -33,7 +33,7 @@ import appeng.decorative.AEDecorativeBlock;
|
||||
import appeng.helpers.MetaRotation;
|
||||
|
||||
public class QuartzPillarBlock extends AEDecorativeBlock implements IOrientableBlock {
|
||||
public static final EnumProperty<Direction.Axis> AXIS = BlockStateProperties.AXIS;
|
||||
public static final EnumProperty<Direction.Axis> AXIS = Properties.AXIS;
|
||||
|
||||
public QuartzPillarBlock(Properties props) {
|
||||
super(props);
|
||||
@@ -43,8 +43,8 @@ public class QuartzPillarBlock extends AEDecorativeBlock implements IOrientableB
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(AXIS);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,14 +64,14 @@ public class SkyStoneBlock extends AEBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, WorldAccess worldIn,
|
||||
public BlockState getStateForNeighborUpdate(BlockState stateIn, Direction facing, BlockState facingState, WorldAccess worldIn,
|
||||
BlockPos currentPos, BlockPos facingPos) {
|
||||
if (worldIn instanceof ServerWorld) {
|
||||
WorldData.instance().compassData().service().updateArea(worldIn, new ChunkPos(currentPos),
|
||||
currentPos.getY());
|
||||
}
|
||||
|
||||
return super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos);
|
||||
return super.getStateForNeighborUpdate(stateIn, facing, facingState, worldIn, currentPos, facingPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,21 +23,17 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.MoverType;
|
||||
import net.minecraft.entity.ItemEntity;
|
||||
import net.minecraft.entity.item.TNTEntity;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.Explosion.Mode;
|
||||
import net.minecraft.world.explosion.Explosion;
|
||||
import net.minecraft.world.explosion.Explosion.Mode;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
|
||||
@@ -48,7 +44,7 @@ import appeng.core.AppEng;
|
||||
import appeng.core.sync.packets.MockExplosionPacket;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public final class TinyTNTPrimedEntity extends TNTEntity implements IEntityAdditionalSpawnData {
|
||||
public final class TinyTNTPrimedEntity extends TntEntity implements IEntityAdditionalSpawnData {
|
||||
|
||||
public static EntityType<TinyTNTPrimedEntity> TYPE;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.client.renderer.entity.EntityRenderer;
|
||||
import net.minecraft.client.renderer.entity.EntityRendererManager;
|
||||
import net.minecraft.client.renderer.entity.TNTMinecartRenderer;
|
||||
|
||||
@@ -39,7 +39,7 @@ import appeng.util.Platform;
|
||||
|
||||
public class FluidInterfaceBlock extends AEBaseTileBlock<FluidInterfaceBlockEntity> {
|
||||
public FluidInterfaceBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,7 +53,7 @@ public class FluidInterfaceBlock extends AEBaseTileBlock<FluidInterfaceBlockEnti
|
||||
if (tg != null) {
|
||||
if (Platform.isServer()) {
|
||||
ContainerOpener.openContainer(FluidInterfaceContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getSide()));
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.fluid.IFluidState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tags.FluidTags;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.tag.FluidTags;
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -179,7 +179,7 @@ public class FluidAnnihilationPlanePart extends BasicStatePart implements IGridT
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChanged(BlockView w, BlockPos pos, BlockPos neighbor) {
|
||||
public void onneighborUpdate(BlockView w, BlockPos pos, BlockPos neighbor) {
|
||||
if (pos.offset(this.getSide().getFacing()).equals(neighbor)) {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ public class FluidLevelEmitterPart extends UpgradeablePart
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTick(final World world, final BlockPos pos, final Random r) {
|
||||
public void randomDisplayTick(final World world, final BlockPos pos, final Random r) {
|
||||
if (this.isLevelEmitterOn()) {
|
||||
final AEPartLocation d = this.getSide();
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public abstract class SharedFluidBusPart extends UpgradeablePart implements IGri
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChanged(BlockView w, BlockPos pos, BlockPos neighbor) {
|
||||
public void onneighborUpdate(BlockView w, BlockPos pos, BlockPos neighbor) {
|
||||
this.updateState();
|
||||
if (this.lastRedstone != this.getHost().hasRedstone(this.getSide())) {
|
||||
this.lastRedstone = !this.lastRedstone;
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.helpers;
|
||||
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.MaterialColor;
|
||||
import net.minecraft.block.piston.PistonBehavior;
|
||||
|
||||
public class AEGlassMaterial {
|
||||
|
||||
public static final Material INSTANCE = new Material(MaterialColor.CLEAR, false, false, true, false, false,
|
||||
false, PistonBehavior.NORMAL);
|
||||
|
||||
}
|
||||
@@ -978,7 +978,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
hostTile.getPos().getZ() + 0.5);
|
||||
from = from.add(direction.getOffsetX() * 0.501, direction.getOffsetY() * 0.501,
|
||||
direction.getOffsetZ() * 0.501);
|
||||
final Vec3d to = from.add(direction.getOffsetX(), direction.getOffsetY(), direction.getZOffset());
|
||||
final Vec3d to = from.add(direction.getOffsetX(), direction.getOffsetY(), direction.getOffsetZ());
|
||||
final BlockHitResult hit = null;// hostWorld.rayTraceBlocks( from, to ); //FIXME:
|
||||
// https://github.com/MinecraftForge/MinecraftForge/pull/6708
|
||||
if (hit != null && !BAD_BLOCKS.contains(directedBlock)) {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.helpers;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.Property;
|
||||
import net.minecraft.state.property.DirectionProperty;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -31,11 +31,11 @@ import appeng.decorative.solid.QuartzPillarBlock;
|
||||
|
||||
public class MetaRotation implements IOrientable {
|
||||
|
||||
private final Property<Direction> facingProp;
|
||||
private final DirectionProperty facingProp;
|
||||
private final BlockView w;
|
||||
private final BlockPos pos;
|
||||
|
||||
public MetaRotation(final BlockView world, final BlockPos pos, final Property<Direction> facingProp) {
|
||||
public MetaRotation(final BlockView world, final BlockPos pos, final DirectionProperty facingProp) {
|
||||
this.w = world;
|
||||
this.pos = pos;
|
||||
this.facingProp = facingProp;
|
||||
@@ -58,12 +58,12 @@ public class MetaRotation implements IOrientable {
|
||||
public Direction getUp() {
|
||||
final BlockState state = this.w.getBlockState(this.pos);
|
||||
|
||||
if (this.facingProp != null && state.has(this.facingProp)) {
|
||||
if (this.facingProp != null && state.contains(this.facingProp)) {
|
||||
return state.get(this.facingProp);
|
||||
}
|
||||
|
||||
// TODO 1.10.2-R - Temp
|
||||
if (state.has(QuartzPillarBlock.AXIS)) {
|
||||
if (state.contains(QuartzPillarBlock.AXIS)) {
|
||||
Axis a = state.get(QuartzPillarBlock.AXIS);
|
||||
switch (a) {
|
||||
case X:
|
||||
|
||||
@@ -26,8 +26,8 @@ import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.renderer.RenderTypeLookup;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.tag.BlockTags;
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
@@ -31,7 +31,7 @@ import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.World;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
@@ -184,7 +184,7 @@ public class MemoryCardItem extends AEBaseItem implements IMemoryCard {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesSneakBypassUse(ItemStack stack, IWorldReader world, BlockPos pos, PlayerEntity player) {
|
||||
public boolean doesSneakBypassUse(ItemStack stack, WorldView world, BlockPos pos, PlayerEntity player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Rotation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.implementations.guiobjects.IGuiItem;
|
||||
@@ -112,7 +112,7 @@ public class NetworkToolItem extends AEBaseItem implements IGuiItem, IAEWrench {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesSneakBypassUse(ItemStack stack, IWorldReader world, BlockPos pos, PlayerEntity player) {
|
||||
public boolean doesSneakBypassUse(ItemStack stack, WorldView world, BlockPos pos, PlayerEntity player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ public class NetworkToolItem extends AEBaseItem implements IGuiItem, IAEWrench {
|
||||
final BlockEntity te = w.getBlockEntity(pos);
|
||||
if (!(te instanceof IGridHost)) {
|
||||
if (bs.rotate(w, pos, Rotation.CLOCKWISE_90) != bs) {
|
||||
bs.neighborChanged(w, pos, Blocks.AIR, pos, false);
|
||||
bs.neighborUpdate(w, pos, Blocks.AIR, pos, false);
|
||||
p.swingArm(hand);
|
||||
return !w.isClient;
|
||||
}
|
||||
|
||||
@@ -64,9 +64,9 @@ import net.minecraft.item.ItemUsageContext;
|
||||
import net.minecraft.item.SnowballItem;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.state.IProperty;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.state.property.Property;
|
||||
import net.minecraft.tag.ItemTags;
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.ActionResult;
|
||||
@@ -327,7 +327,7 @@ public class ColorApplicatorItem extends AEBasePoweredItem
|
||||
Block recolored = BlockRecolorer.recolor(blk, newColor);
|
||||
if (recolored != blk) {
|
||||
BlockState newState = recolored.getDefaultState();
|
||||
for (IProperty<?> prop : newState.getProperties()) {
|
||||
for (Property<?> prop : newState.getProperties()) {
|
||||
newState = copyProp(state, newState, prop);
|
||||
}
|
||||
|
||||
@@ -353,8 +353,8 @@ public class ColorApplicatorItem extends AEBasePoweredItem
|
||||
}
|
||||
|
||||
private static <T extends Comparable<T>> BlockState copyProp(BlockState oldState, BlockState newState,
|
||||
IProperty<T> prop) {
|
||||
if (newState.has(prop)) {
|
||||
Property<T> prop) {
|
||||
if (newState.contains(prop)) {
|
||||
return newState.with(prop, oldState.get(prop));
|
||||
}
|
||||
return newState;
|
||||
|
||||
@@ -34,8 +34,9 @@ import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.crafting.FurnaceRecipe;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -89,7 +90,7 @@ public class EntropyManipulatorItem extends AEBasePoweredItem implements IBlockT
|
||||
this.heatUp.put(new InWorldToolOperationIngredient(Blocks.WATER, Fluids.FLOWING_WATER),
|
||||
new InWorldToolOperationResult());
|
||||
this.heatUp.put(new InWorldToolOperationIngredient(Blocks.SNOW), new InWorldToolOperationResult(
|
||||
Blocks.WATER.getDefaultState().with(BlockStateProperties.LEVEL_0_15, 7), Fluids.FLOWING_WATER));
|
||||
Blocks.WATER.getDefaultState().with(Properties.LEVEL_0_15, 7), Fluids.FLOWING_WATER));
|
||||
}
|
||||
|
||||
private static class InWorldToolOperationIngredient {
|
||||
|
||||
@@ -202,7 +202,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChanged(BlockView w, BlockPos pos, BlockPos neighbor) {
|
||||
public void onneighborUpdate(BlockView w, BlockPos pos, BlockPos neighbor) {
|
||||
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void animateTick(final World world, final BlockPos pos, final Random r) {
|
||||
public void randomDisplayTick(final World world, final BlockPos pos, final Random r) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -671,13 +671,13 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChanged(BlockView w, BlockPos pos, BlockPos neighbor) {
|
||||
public void onneighborUpdate(BlockView w, BlockPos pos, BlockPos neighbor) {
|
||||
this.hasRedstone = YesNo.UNDECIDED;
|
||||
|
||||
for (final AEPartLocation s : AEPartLocation.values()) {
|
||||
final IPart part = this.getPart(s);
|
||||
if (part != null) {
|
||||
part.onNeighborChanged(w, pos, neighbor);
|
||||
part.onneighborUpdate(w, pos, neighbor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -700,11 +700,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTick(final World world, final BlockPos pos, final Random r) {
|
||||
public void randomDisplayTick(final World world, final BlockPos pos, final Random r) {
|
||||
for (final AEPartLocation side : AEPartLocation.values()) {
|
||||
final IPart p = this.getPart(side);
|
||||
if (p != null) {
|
||||
p.animateTick(world, pos, r);
|
||||
p.randomDisplayTick(world, pos, r);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1039,7 +1039,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
/**
|
||||
* See {@link net.minecraft.block.Block#getShape}
|
||||
*/
|
||||
public VoxelShape getShape() {
|
||||
public VoxelShape getOutlineShape() {
|
||||
if (cachedShape == null) {
|
||||
cachedShape = createShape(false, false);
|
||||
}
|
||||
@@ -1091,7 +1091,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
VoxelShape shape = VoxelShapes.empty();
|
||||
for (final Box bx : boxes) {
|
||||
shape = VoxelShapes.or(shape, VoxelShapes.create(bx));
|
||||
shape = VoxelShapes.or(shape, VoxelShapes.cuboid(bx));
|
||||
}
|
||||
return shape;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user