mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 19:05:16 +00:00
Convert forge has/createTileEntity back into ITEP for portability.Once upon a time this was 'best practice' but it never seemed to provide any benefit.
This commit is contained in:
1 parent
7c77a31347
commit
75a4dd16cc
55 files changed
+140
-317
No files matched your search
@@ -10,6 +10,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -28,8 +29,9 @@ import vazkii.botania.common.advancements.AlfPortalTrigger;
|
||||
import vazkii.botania.common.block.tile.TileAlfPortal;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BlockAlfPortal extends BlockMod implements IWandable {
|
||||
public class BlockAlfPortal extends BlockMod implements ITileEntityProvider, IWandable {
|
||||
|
||||
public BlockAlfPortal(Properties builder) {
|
||||
super(builder);
|
||||
@@ -41,14 +43,9 @@ public class BlockAlfPortal extends BlockMod implements IWandable {
|
||||
builder.add(BotaniaStateProps.ALFPORTAL_STATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileAlfPortal();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -44,7 +45,7 @@ import vazkii.botania.common.item.rod.ItemWaterRod;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockAltar extends BlockMod {
|
||||
public class BlockAltar extends BlockMod implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape BASE = Block.makeCuboidShape(0, 0, 0, 16, 2, 16);
|
||||
private static final VoxelShape MIDDLE = Block.makeCuboidShape(2, 2, 2, 14, 12, 14);
|
||||
@@ -213,14 +214,9 @@ public class BlockAltar extends BlockMod {
|
||||
.orElse(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileAltar();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -38,7 +39,7 @@ import vazkii.botania.common.block.tile.TileAnimatedTorch;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BlockAnimatedTorch extends BlockModWaterloggable implements IWandable, IManaTrigger, IHourglassTrigger, IWandHUD {
|
||||
public class BlockAnimatedTorch extends BlockModWaterloggable implements ITileEntityProvider, IWandable, IManaTrigger, IHourglassTrigger, IWandHUD {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(0, 0, 0, 16, 4, 16);
|
||||
|
||||
@@ -123,15 +124,10 @@ public class BlockAnimatedTorch extends BlockModWaterloggable implements IWandab
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileAnimatedTorch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerDestroy(IWorld world, BlockPos pos, BlockState state) {
|
||||
// TE is already gone so best we can do is just notify everyone
|
||||
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.block;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -33,7 +34,7 @@ import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockAvatar extends BlockModWaterloggable {
|
||||
public class BlockAvatar extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape X_AABB = makeCuboidShape(5, 0, 3.5, 11, 17, 12.5);
|
||||
private static final VoxelShape Z_AABB = makeCuboidShape(3.5, 0, 5, 12.5, 17, 11);
|
||||
@@ -97,14 +98,9 @@ public class BlockAvatar extends BlockModWaterloggable {
|
||||
return BlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileAvatar();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -21,7 +22,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockBifrost extends BlockBifrostPerm {
|
||||
public class BlockBifrost extends BlockBifrostPerm implements ITileEntityProvider {
|
||||
|
||||
public BlockBifrost(Properties builder) {
|
||||
super(builder);
|
||||
@@ -33,14 +34,9 @@ public class BlockBifrost extends BlockBifrostPerm {
|
||||
return new ItemStack(ModItems.rainbowRod);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileBifrost();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
@@ -22,7 +23,7 @@ import vazkii.botania.common.block.tile.TileCacophonium;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockCacophonium extends BlockMod {
|
||||
public class BlockCacophonium extends BlockMod implements ITileEntityProvider {
|
||||
protected BlockCacophonium(Properties builder) {
|
||||
super(builder);
|
||||
setDefaultState(getDefaultState().with(BlockStateProperties.POWERED, false));
|
||||
@@ -60,14 +61,9 @@ public class BlockCacophonium extends BlockMod {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileCacophonium();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
@@ -16,20 +17,15 @@ import vazkii.botania.common.block.tile.TileCell;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockCell extends BlockMod {
|
||||
public class BlockCell extends BlockMod implements ITileEntityProvider {
|
||||
|
||||
public BlockCell(Properties builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileCell();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -34,7 +35,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockCocoon extends BlockModWaterloggable {
|
||||
public class BlockCocoon extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(3, 0, 3, 13, 14, 13);;
|
||||
|
||||
@@ -107,14 +108,9 @@ public class BlockCocoon extends BlockModWaterloggable {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileCocoon();
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class BlockCraftyCrate extends BlockOpenCrate implements IWandHUD {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileCraftCrate();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.particles.RedstoneParticleData;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
@@ -25,7 +26,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockEnderEye extends BlockMod {
|
||||
public class BlockEnderEye extends BlockMod implements ITileEntityProvider {
|
||||
|
||||
protected BlockEnderEye(Properties builder) {
|
||||
super(builder);
|
||||
@@ -47,14 +48,9 @@ public class BlockEnderEye extends BlockMod {
|
||||
return state.get(BlockStateProperties.POWERED) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileEnderEye();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.AirBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
@@ -25,7 +22,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockFakeAir extends AirBlock {
|
||||
public class BlockFakeAir extends AirBlock implements ITileEntityProvider {
|
||||
|
||||
public BlockFakeAir(Properties builder) {
|
||||
super(builder);
|
||||
@@ -54,14 +51,9 @@ public class BlockFakeAir extends AirBlock {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileFakeAir();
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return teProvider.get();
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
@@ -20,7 +21,7 @@ import vazkii.botania.common.block.tile.TileForestEye;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockForestEye extends BlockModWaterloggable {
|
||||
public class BlockForestEye extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(4, 4, 4, 12, 12, 12);
|
||||
|
||||
@@ -45,14 +46,9 @@ public class BlockForestEye extends BlockModWaterloggable {
|
||||
return eye == null ? 0 : Math.min(15, Math.max(0, eye.entities - 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileForestEye();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.block;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -47,7 +48,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockHourglass extends BlockModWaterloggable implements IManaTrigger, IWandable, IWandHUD {
|
||||
public class BlockHourglass extends BlockModWaterloggable implements IManaTrigger, ITileEntityProvider, IWandable, IWandHUD {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(4, 0, 4, 12, 18.4, 12);
|
||||
|
||||
@@ -134,14 +135,9 @@ public class BlockHourglass extends BlockModWaterloggable implements IManaTrigge
|
||||
return BlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileHourglass();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -34,7 +35,7 @@ import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockIncensePlate extends BlockModWaterloggable {
|
||||
public class BlockIncensePlate extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape X_SHAPE = makeCuboidShape(6, 0, 2, 10, 1, 14);
|
||||
private static final VoxelShape Z_SHAPE = makeCuboidShape(2, 0, 6, 14, 1, 10);
|
||||
@@ -117,14 +118,9 @@ public class BlockIncensePlate extends BlockModWaterloggable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileIncensePlate();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.block;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.StateContainer;
|
||||
@@ -36,7 +37,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockLightRelay extends BlockModWaterloggable implements IWandable {
|
||||
public class BlockLightRelay extends BlockModWaterloggable implements ITileEntityProvider, IWandable {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(5, 5, 5, 11, 11, 11);
|
||||
public final LuminizerVariant variant;
|
||||
@@ -103,14 +104,9 @@ public class BlockLightRelay extends BlockModWaterloggable implements IWandable
|
||||
return BlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileLightRelay();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -24,7 +25,7 @@ import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockOpenCrate extends BlockMod implements IWandable {
|
||||
public class BlockOpenCrate extends BlockMod implements ITileEntityProvider, IWandable {
|
||||
|
||||
protected BlockOpenCrate(Properties builder) {
|
||||
super(builder);
|
||||
@@ -50,14 +51,9 @@ public class BlockOpenCrate extends BlockMod implements IWandable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileOpenCrate();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -36,7 +33,7 @@ import vazkii.botania.common.block.tile.TilePlatform;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BlockPlatform extends BlockMod implements IWandable, IManaCollisionGhost {
|
||||
public class BlockPlatform extends BlockMod implements IWandable, IManaCollisionGhost, ITileEntityProvider {
|
||||
|
||||
public enum Variant {
|
||||
ABSTRUSE,
|
||||
@@ -71,14 +68,9 @@ public class BlockPlatform extends BlockMod implements IWandable, IManaCollision
|
||||
return variant != Variant.INFRANGIBLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TilePlatform();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.block;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
@@ -22,7 +23,7 @@ import vazkii.botania.common.block.tile.TilePylon;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockPylon extends BlockModWaterloggable {
|
||||
public class BlockPylon extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
private static final VoxelShape SHAPE = Block.makeCuboidShape(2, 0, 2, 14, 21, 14);
|
||||
|
||||
public enum Variant {
|
||||
@@ -59,14 +60,9 @@ public class BlockPylon extends BlockModWaterloggable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TilePylon();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.StateContainer;
|
||||
@@ -32,7 +33,7 @@ import vazkii.botania.common.item.ItemSparkUpgrade;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockSparkChanger extends BlockModWaterloggable {
|
||||
public class BlockSparkChanger extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(0, 0, 0, 16, 3, 16);
|
||||
|
||||
@@ -109,14 +110,9 @@ public class BlockSparkChanger extends BlockModWaterloggable {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileSparkChanger();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.FlowerBlock;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -42,7 +43,7 @@ import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class BlockSpecialFlower extends FlowerBlock implements IWandable, IWandHUD {
|
||||
public class BlockSpecialFlower extends FlowerBlock implements ITileEntityProvider, IWandable, IWandHUD {
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(4.8, 0, 4.8, 12.8, 16, 12.8);
|
||||
private final Supplier<? extends TileEntitySpecialFlower> teProvider;
|
||||
|
||||
@@ -115,14 +116,9 @@ public class BlockSpecialFlower extends FlowerBlock implements IWandable, IWandH
|
||||
return tileentity != null && tileentity.receiveClientEvent(event, param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return teProvider.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -29,7 +30,7 @@ import vazkii.botania.common.block.tile.TileTeruTeruBozu;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockTeruTeruBozu extends BlockModWaterloggable {
|
||||
public class BlockTeruTeruBozu extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(4, 0.16, 4, 12, 15.84, 12);
|
||||
|
||||
@@ -110,14 +111,9 @@ public class BlockTeruTeruBozu extends BlockModWaterloggable {
|
||||
return BlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileTeruTeruBozu();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
@@ -21,7 +22,7 @@ import vazkii.botania.common.block.tile.TileTinyPlanet;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockTinyPlanet extends BlockModWaterloggable implements IManaCollisionGhost {
|
||||
public class BlockTinyPlanet extends BlockModWaterloggable implements IManaCollisionGhost, ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape AABB = makeCuboidShape(3, 3, 3, 13, 13, 13);
|
||||
|
||||
@@ -35,14 +36,9 @@ public class BlockTinyPlanet extends BlockModWaterloggable implements IManaColli
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileTinyPlanet();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.corporea;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -19,7 +20,7 @@ import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public abstract class BlockCorporeaBase extends BlockMod {
|
||||
public abstract class BlockCorporeaBase extends BlockMod implements ITileEntityProvider {
|
||||
|
||||
public BlockCorporeaBase(Block.Properties builder) {
|
||||
super(builder);
|
||||
@@ -34,8 +35,4 @@ public abstract class BlockCorporeaBase extends BlockMod {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ public class BlockCorporeaCrystalCube extends BlockCorporeaBaseWaterloggable imp
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileCorporeaBase createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileCorporeaBase createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileCorporeaCrystalCube();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class BlockCorporeaFunnel extends BlockCorporeaBase {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileCorporeaBase createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileCorporeaBase createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileCorporeaFunnel();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public class BlockCorporeaIndex extends BlockCorporeaBaseWaterloggable {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileCorporeaBase createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileCorporeaBase createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileCorporeaIndex();
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ public class BlockCorporeaInterceptor extends BlockCorporeaBase {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileCorporeaBase createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileCorporeaBase createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileCorporeaInterceptor();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.corporea;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -22,7 +23,7 @@ import vazkii.botania.common.block.tile.corporea.TileCorporeaRetainer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockCorporeaRetainer extends BlockMod {
|
||||
public class BlockCorporeaRetainer extends BlockMod implements ITileEntityProvider {
|
||||
|
||||
public BlockCorporeaRetainer(Block.Properties builder) {
|
||||
super(builder);
|
||||
@@ -57,14 +58,9 @@ public class BlockCorporeaRetainer extends BlockMod {
|
||||
return ((TileCorporeaRetainer) world.getTileEntity(pos)).getComparatorValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileCorporeaRetainer();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -40,7 +41,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockFloatingFlower extends BlockModWaterloggable {
|
||||
public class BlockFloatingFlower extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(1.6, 1.6, 1.6, 14.4, 14.4, 14.4);
|
||||
public final DyeColor color;
|
||||
@@ -107,14 +108,9 @@ public class BlockFloatingFlower extends BlockModWaterloggable {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileFloatingFlower();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
@@ -31,7 +32,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockManaFlame extends BlockMod {
|
||||
public class BlockManaFlame extends BlockMod implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(4, 4, 4, 12, 12, 12);
|
||||
|
||||
@@ -67,14 +68,9 @@ public class BlockManaFlame extends BlockMod {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileManaFlame();
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
@@ -20,7 +21,7 @@ import vazkii.botania.common.block.tile.TileStarfield;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockStarfield extends BlockModWaterloggable {
|
||||
public class BlockStarfield extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(0, 0, 0, 16, 4, 16);
|
||||
|
||||
@@ -34,14 +35,9 @@ public class BlockStarfield extends BlockModWaterloggable {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileStarfield();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.block.decor;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
@@ -39,7 +40,7 @@ import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BlockTinyPotato extends BlockModWaterloggable {
|
||||
public class BlockTinyPotato extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(6, 0, 6, 10, 6, 10);
|
||||
|
||||
@@ -102,14 +103,9 @@ public class BlockTinyPotato extends BlockModWaterloggable {
|
||||
return BlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileTinyPotato();
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.block.mana;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.StateContainer;
|
||||
@@ -32,7 +33,7 @@ import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockBellows extends BlockMod {
|
||||
public class BlockBellows extends BlockMod implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(3, 0, 3, 13, 10.0, 13);
|
||||
|
||||
@@ -73,14 +74,9 @@ public class BlockBellows extends BlockMod {
|
||||
return BlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileBellows();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.block.mana;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -36,7 +37,7 @@ import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockBrewery extends BlockModWaterloggable implements IWandHUD {
|
||||
public class BlockBrewery extends BlockModWaterloggable implements ITileEntityProvider, IWandHUD {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(6, 0.8, 6, 10, 15.2, 10);
|
||||
|
||||
@@ -101,14 +102,9 @@ public class BlockBrewery extends BlockModWaterloggable implements IWandHUD {
|
||||
return BlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileBrewery();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
@@ -21,7 +22,7 @@ import vazkii.botania.common.block.tile.mana.TileDistributor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockDistributor extends BlockModWaterloggable {
|
||||
public class BlockDistributor extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape SHAPE = Block.makeCuboidShape(4, 0, 4, 12, 16, 12);
|
||||
|
||||
@@ -35,14 +36,9 @@ public class BlockDistributor extends BlockModWaterloggable {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileDistributor();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -37,7 +38,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockEnchanter extends BlockMod implements IWandable, IWandHUD {
|
||||
public class BlockEnchanter extends BlockMod implements ITileEntityProvider, IWandable, IWandHUD {
|
||||
|
||||
public BlockEnchanter(Properties builder) {
|
||||
super(builder);
|
||||
@@ -49,14 +50,9 @@ public class BlockEnchanter extends BlockMod implements IWandable, IWandHUD {
|
||||
builder.add(BotaniaStateProps.ENCHANTER_DIRECTION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileEnchanter();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -28,7 +29,7 @@ import vazkii.botania.common.block.tile.mana.TileManaDetector;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockManaDetector extends BlockMod implements IManaCollisionGhost {
|
||||
public class BlockManaDetector extends BlockMod implements IManaCollisionGhost, ITileEntityProvider {
|
||||
|
||||
public BlockManaDetector(Properties builder) {
|
||||
super(builder);
|
||||
@@ -61,14 +62,9 @@ public class BlockManaDetector extends BlockMod implements IManaCollisionGhost {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileManaDetector();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -24,20 +25,15 @@ import vazkii.botania.common.block.tile.mana.TileManaVoid;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockManaVoid extends BlockMod implements IPoolOverlayProvider {
|
||||
public class BlockManaVoid extends BlockMod implements IPoolOverlayProvider, ITileEntityProvider {
|
||||
|
||||
public BlockManaVoid(Properties builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileManaVoid();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
@@ -39,7 +40,7 @@ import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockPool extends BlockModWaterloggable implements IWandHUD, IWandable {
|
||||
public class BlockPool extends BlockModWaterloggable implements ITileEntityProvider, IWandHUD, IWandable {
|
||||
private static final VoxelShape SLAB = makeCuboidShape(0, 0, 0, 16, 8, 16);
|
||||
private static final VoxelShape CUTOUT = makeCuboidShape(1, 1, 1, 15, 8, 15);
|
||||
private static final VoxelShape REAL_SHAPE = VoxelShapes.combineAndSimplify(SLAB, CUTOUT, IBooleanFunction.ONLY_FIRST);
|
||||
@@ -74,14 +75,9 @@ public class BlockPool extends BlockModWaterloggable implements IWandHUD, IWanda
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TilePool();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.StateContainer;
|
||||
@@ -37,7 +38,7 @@ import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockPrism extends BlockModWaterloggable implements IManaTrigger, IManaCollisionGhost {
|
||||
public class BlockPrism extends BlockModWaterloggable implements ITileEntityProvider, IManaTrigger, IManaCollisionGhost {
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(4, 0, 4, 12, 16, 12);
|
||||
|
||||
public BlockPrism(Properties builder) {
|
||||
@@ -108,14 +109,9 @@ public class BlockPrism extends BlockModWaterloggable implements IManaTrigger, I
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TilePrism();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
@@ -26,7 +27,7 @@ import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockPump extends BlockModWaterloggable {
|
||||
public class BlockPump extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape X_SHAPE = makeCuboidShape(0, 0, 4, 16, 8, 12);
|
||||
private static final VoxelShape Z_SHAPE = makeCuboidShape(4, 0, 0, 12, 8, 16);
|
||||
@@ -68,14 +69,9 @@ public class BlockPump extends BlockModWaterloggable {
|
||||
return ((TilePump) world.getTileEntity(pos)).comparator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TilePump();
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
@@ -17,20 +18,15 @@ import vazkii.botania.common.block.tile.mana.TileRFGenerator;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockRFGenerator extends BlockMod {
|
||||
public class BlockRFGenerator extends BlockMod implements ITileEntityProvider {
|
||||
|
||||
public BlockRFGenerator(Properties builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileRFGenerator();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -34,7 +35,7 @@ import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockRuneAltar extends BlockModWaterloggable implements IWandable {
|
||||
public class BlockRuneAltar extends BlockModWaterloggable implements ITileEntityProvider, IWandable {
|
||||
|
||||
private static final VoxelShape TOP = Block.makeCuboidShape(0, 6, 0, 16, 12, 16);
|
||||
private static final VoxelShape BOTTOM = Block.makeCuboidShape(2, 0, 2, 14, 6, 14);
|
||||
@@ -87,14 +88,9 @@ public class BlockRuneAltar extends BlockModWaterloggable implements IWandable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileRuneAltar();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -24,7 +25,7 @@ import vazkii.botania.common.block.tile.TileSpawnerClaw;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockSpawnerClaw extends BlockModWaterloggable {
|
||||
public class BlockSpawnerClaw extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(2, 0, 2, 14, 2, 14);
|
||||
|
||||
@@ -44,14 +45,9 @@ public class BlockSpawnerClaw extends BlockModWaterloggable {
|
||||
list.add(new ItemStack(Blocks.SPAWNER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(IBlockReader world) {
|
||||
return new TileSpawnerClaw();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
@@ -48,7 +49,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockSpreader extends BlockModWaterloggable implements IWandable, IWandHUD, IWireframeAABBProvider {
|
||||
public class BlockSpreader extends BlockModWaterloggable implements ITileEntityProvider, IWandable, IWandHUD, IWireframeAABBProvider {
|
||||
private static final VoxelShape RENDER_SHAPE = makeCuboidShape(1, 1, 1, 15, 15, 15);
|
||||
|
||||
public enum Variant {
|
||||
@@ -200,14 +201,9 @@ public class BlockSpreader extends BlockModWaterloggable implements IWandable, I
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileSpreader();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -30,7 +31,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockTerraPlate extends BlockModWaterloggable {
|
||||
public class BlockTerraPlate extends BlockModWaterloggable implements ITileEntityProvider {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(0, 0, 0, 16, 3, 16);
|
||||
|
||||
@@ -68,14 +69,9 @@ public class BlockTerraPlate extends BlockModWaterloggable {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileTerraPlate();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -27,20 +28,15 @@ import vazkii.botania.common.block.tile.mana.TileTurntable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockTurntable extends BlockMod implements IWandable, IWandHUD {
|
||||
public class BlockTurntable extends BlockMod implements ITileEntityProvider, IWandable, IWandHUD {
|
||||
|
||||
public BlockTurntable(Properties builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileEntity createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileTurntable();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,13 +10,14 @@ package vazkii.botania.common.block.string;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
|
||||
public abstract class BlockRedString extends BlockMod {
|
||||
public abstract class BlockRedString extends BlockMod implements ITileEntityProvider {
|
||||
|
||||
public BlockRedString(Block.Properties builder) {
|
||||
super(builder);
|
||||
@@ -32,8 +33,4 @@ public abstract class BlockRedString extends BlockMod {
|
||||
return getDefaultState().with(BlockStateProperties.FACING, context.getNearestLookingDirection().getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class BlockRedStringComparator extends BlockRedString {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileRedString createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileRedString createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileRedStringComparator();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class BlockRedStringContainer extends BlockRedString {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileRedString createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileRedString createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileRedStringContainer();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class BlockRedStringDispenser extends BlockRedString {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileRedString createTileEntity(@Nonnull BlockState meta, IBlockReader world) {
|
||||
public TileRedString createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileRedStringDispenser();
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class BlockRedStringFertilizer extends BlockRedString implements IGrowabl
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileRedString createTileEntity(@Nonnull BlockState meta, @Nonnull IBlockReader world) {
|
||||
public TileRedString createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileRedStringFertilizer();
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class BlockRedStringInterceptor extends BlockRedString {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileRedString createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileRedString createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileRedStringInterceptor();
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public class BlockRedStringRelay extends BlockRedString {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileRedString createTileEntity(@Nonnull BlockState state, @Nonnull IBlockReader world) {
|
||||
public TileRedString createNewTileEntity(@Nonnull IBlockReader world) {
|
||||
return new TileRedStringRelay();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user