Added a small amount of Alchemy Array infrastructure.
This commit is contained in:
parent
fdaa32af0c
commit
707be222f5
|
@ -2,8 +2,12 @@ package WayofTime.bloodmagic.api.alchemyCrafting;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public abstract class AlchemyArrayEffect
|
public abstract class AlchemyArrayEffect
|
||||||
|
@ -18,4 +22,9 @@ public abstract class AlchemyArrayEffect
|
||||||
public abstract void readFromNBT(NBTTagCompound tag);
|
public abstract void readFromNBT(NBTTagCompound tag);
|
||||||
|
|
||||||
public abstract AlchemyArrayEffect getNewCopy();
|
public abstract AlchemyArrayEffect getNewCopy();
|
||||||
|
|
||||||
|
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,16 @@ public class BlockAlchemyArray extends BlockContainer
|
||||||
// No-op
|
// No-op
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity)
|
||||||
|
{
|
||||||
|
TileEntity tile = world.getTileEntity(pos);
|
||||||
|
if (tile instanceof TileAlchemyArray)
|
||||||
|
{
|
||||||
|
((TileAlchemyArray) tile).onEntityCollidedWithBlock(state, entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package WayofTime.bloodmagic.tile;
|
package WayofTime.bloodmagic.tile;
|
||||||
|
|
||||||
import net.minecraft.inventory.InventoryHelper;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.network.NetworkManager;
|
import net.minecraft.network.NetworkManager;
|
||||||
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||||
|
@ -21,6 +22,14 @@ public class TileAlchemyArray extends TileInventory implements ITickable
|
||||||
super(2, "alchemyArray");
|
super(2, "alchemyArray");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onEntityCollidedWithBlock(IBlockState state, Entity entity)
|
||||||
|
{
|
||||||
|
if (arrayEffect != null)
|
||||||
|
{
|
||||||
|
arrayEffect.onEntityCollidedWithBlock(worldObj, pos, state, entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound tagCompound)
|
public void readFromNBT(NBTTagCompound tagCompound)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue