From d524a0b2e9f4e116be3fae2170c84a429160cd1e Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Fri, 6 May 2016 23:27:36 -0500 Subject: [PATCH] Fold a couple interfaces together, we have way too many .-. --- .../vazkii/botania/api/boss/IBotaniaBoss.java | 17 +++++++++ .../api/boss/IBotaniaBossWithShader.java | 38 ------------------- .../vazkii/botania/api/item/IDyablePool.java | 26 ------------- ...tendedWireframeCoordinateListProvider.java | 28 -------------- .../IWireframeCoordinateListProvider.java | 8 ++++ .../vazkii/botania/api/mana/IDirectioned.java | 24 ++++++++++++ .../botania/api/mana/IIdentifiable.java | 23 ----------- .../vazkii/botania/api/mana/IManaPool.java | 13 +++++++ .../vazkii/botania/api/mana/IPingable.java | 7 +++- .../botania/api/mana/IRedirectable.java | 29 -------------- .../client/core/handler/BossBarHandler.java | 17 +++------ .../core/handler/BoundTileRenderer.java | 9 ++--- .../common/block/tile/mana/TilePool.java | 4 +- .../common/block/tile/mana/TileSpreader.java | 4 +- .../common/entity/EntityDoppleganger.java | 4 +- .../botania/common/item/ItemManaMirror.java | 9 +++++ .../common/item/lens/LensRedirect.java | 6 +-- .../botania/common/item/material/ItemDye.java | 10 ++--- .../common/item/relic/ItemAesirRing.java | 5 +-- .../common/item/relic/ItemLokiRing.java | 4 +- .../common/item/rod/ItemExchangeRod.java | 5 +++ 21 files changed, 107 insertions(+), 183 deletions(-) delete mode 100644 src/main/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java delete mode 100644 src/main/java/vazkii/botania/api/item/IDyablePool.java delete mode 100644 src/main/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java delete mode 100644 src/main/java/vazkii/botania/api/mana/IIdentifiable.java delete mode 100644 src/main/java/vazkii/botania/api/mana/IRedirectable.java diff --git a/src/main/java/vazkii/botania/api/boss/IBotaniaBoss.java b/src/main/java/vazkii/botania/api/boss/IBotaniaBoss.java index 2826ca3c4..c8b6bee65 100644 --- a/src/main/java/vazkii/botania/api/boss/IBotaniaBoss.java +++ b/src/main/java/vazkii/botania/api/boss/IBotaniaBoss.java @@ -16,6 +16,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.BossInfo; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.internal.ShaderCallback; import java.awt.*; import java.util.UUID; @@ -63,4 +64,20 @@ public interface IBotaniaBoss { */ public UUID getBossInfoUuid(); + /** + * The Shader Program to use for this boss's bar. Return 0 case + * you don't want a shader to be used. You can use separate shaders + * for the background and foreground. + * @param background True if rendering the background of the boss bar, + * false if rendering the bar itself that shows the HP. + * @return OpenGL program ID of the shader to use + */ + public int getBossBarShaderProgram(boolean background); + + /** + * A callback for the shader, used to pass in uniforms. Return null for no callback. + * @return a ShaderCallback to use. If getBossBarShaderProgram returns an invalid shader the result of this method is ignored. + */ + public ShaderCallback getBossBarShaderCallback(boolean background, int shader); + } diff --git a/src/main/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java b/src/main/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java deleted file mode 100644 index c7a425412..000000000 --- a/src/main/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 29, 2014, 6:13:21 PM (GMT)] - */ -package vazkii.botania.api.boss; - -import vazkii.botania.api.internal.ShaderCallback; - -/** - * A Botania boss whose HP bar makes use of shaders. Shaders - * used through this have a few uniforms available: - *
  • int time - The amount of total ticks elapsed.
  • - *
  • int startX - The U coordinate passed in for the render of this bar's texture.
  • - *
  • int startY - The V coordinate passed in for the render of this bar's texture.
  • - */ -public interface IBotaniaBossWithShader extends IBotaniaBoss { - - /** - * The Shader Program to use for this boss bar. Return 0 case - * you don't want a shader to be used. You can use separate shaders - * for the background and foreground. - * @param background True if rendering the background of the boss bar, - * false if rendering the bar itself that shows the HP. - */ - public int getBossBarShaderProgram(boolean background); - - /** - * A callback for the shader, used to pass in uniforms. Return null for no callback. - */ - public ShaderCallback getBossBarShaderCallback(boolean background, int shader); - -} diff --git a/src/main/java/vazkii/botania/api/item/IDyablePool.java b/src/main/java/vazkii/botania/api/item/IDyablePool.java deleted file mode 100644 index c5137266d..000000000 --- a/src/main/java/vazkii/botania/api/item/IDyablePool.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 18, 2015, 12:20:44 AM (GMT)] - */ -package vazkii.botania.api.item; - - -import net.minecraft.item.EnumDyeColor; - -/** - * Used to define a Mana Pool that can be dyed through floral powder. - */ -public interface IDyablePool { - - public EnumDyeColor getColor(); - - public void setColor(EnumDyeColor color); - - -} diff --git a/src/main/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java b/src/main/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java deleted file mode 100644 index 61aee3553..000000000 --- a/src/main/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 30, 2015, 1:43:17 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; - -/** - * An extension of IWireframeCoordinateListProvider that allows for - * rendering a single thicker wireframe. - */ -public interface IExtendedWireframeCoordinateListProvider extends IWireframeCoordinateListProvider { - - /** - * Gets the source wireframe to draw, this one will be drawn thicker. - */ - public BlockPos getSourceWireframe(EntityPlayer player, ItemStack stack); - -} diff --git a/src/main/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java b/src/main/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java index efa39d191..91786ad12 100644 --- a/src/main/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java +++ b/src/main/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java @@ -29,4 +29,12 @@ public interface IWireframeCoordinateListProvider { */ public List getWireframesToDraw(EntityPlayer player, ItemStack stack); + /** + * Gets a wireframe to draw thicker than the rest. + * This is useful to indicate the precedence of some position over the others. + * @return The position of a single wireframe to draw thicker than all the others. + */ + public BlockPos getSourceWireframe(EntityPlayer player, ItemStack stack); + + } diff --git a/src/main/java/vazkii/botania/api/mana/IDirectioned.java b/src/main/java/vazkii/botania/api/mana/IDirectioned.java index ff856f774..49fc53ccd 100644 --- a/src/main/java/vazkii/botania/api/mana/IDirectioned.java +++ b/src/main/java/vazkii/botania/api/mana/IDirectioned.java @@ -17,8 +17,32 @@ package vazkii.botania.api.mana; */ public interface IDirectioned { + /** + * @return The X rotation, in degrees + */ public float getRotationX(); + /** + * @return The Y rotation, in degrees + */ public float getRotationY(); + /** + * Set the X rotation + * @param rot X rotation, in degrees + */ + public void setRotationX(float rot); + + /** + * Set the Y rotation + * @param rot Y rotation, in degrees + */ + public void setRotationY(float rot); + + /** + * This should be called after rotation setting is done to allow + * for the block to re-calculate. + */ + public void commitRedirection(); + } diff --git a/src/main/java/vazkii/botania/api/mana/IIdentifiable.java b/src/main/java/vazkii/botania/api/mana/IIdentifiable.java deleted file mode 100644 index 65f2edc02..000000000 --- a/src/main/java/vazkii/botania/api/mana/IIdentifiable.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 19, 2015, 10:05:24 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import java.util.UUID; - -/** - * This interface marks a TileEntity that can be identified through - * an UUID. This UUID must presist between sessions. - */ -public interface IIdentifiable { - - public UUID getIdentifier(); - -} diff --git a/src/main/java/vazkii/botania/api/mana/IManaPool.java b/src/main/java/vazkii/botania/api/mana/IManaPool.java index df523a62c..e6df9ff7c 100644 --- a/src/main/java/vazkii/botania/api/mana/IManaPool.java +++ b/src/main/java/vazkii/botania/api/mana/IManaPool.java @@ -10,6 +10,8 @@ */ package vazkii.botania.api.mana; +import net.minecraft.item.EnumDyeColor; + /** * Any TileEntity that implements this is considered a Mana Pool, * by which nearby functional flowers will pull mana from it.
    @@ -27,4 +29,15 @@ public interface IManaPool extends IManaReceiver { */ public boolean isOutputtingPower(); + /** + * @return The color of this pool. + */ + public EnumDyeColor getColor(); + + /** + * Sets the color of this pool. + * @param color The color to set. + */ + public void setColor(EnumDyeColor color); + } diff --git a/src/main/java/vazkii/botania/api/mana/IPingable.java b/src/main/java/vazkii/botania/api/mana/IPingable.java index c8532bc23..dec5fe57d 100644 --- a/src/main/java/vazkii/botania/api/mana/IPingable.java +++ b/src/main/java/vazkii/botania/api/mana/IPingable.java @@ -18,7 +18,7 @@ import java.util.UUID; * This describes an interface of a Mana Sender block that should be able to pingbackable * by a burst to tell it that the burst is still alive. */ -public interface IPingable extends IIdentifiable { +public interface IPingable { /** * Pings this object back, telling it that the burst passed in is still alive @@ -28,4 +28,9 @@ public interface IPingable extends IIdentifiable { */ public void pingback(IManaBurst burst, UUID expectedIdentity); + /** + * @return A unique and persistent identifier for this IPingable + */ + public UUID getIdentifier(); + } diff --git a/src/main/java/vazkii/botania/api/mana/IRedirectable.java b/src/main/java/vazkii/botania/api/mana/IRedirectable.java deleted file mode 100644 index 00a1b6aa7..000000000 --- a/src/main/java/vazkii/botania/api/mana/IRedirectable.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [15/11/2015, 19:28:18 (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * This is an extension of IDirectioned for TileEntities - * that allow for their rotation to be public and modifiable outside. - * This is used in botania for the Redirective mana lens. - */ -public interface IRedirectable extends IDirectioned { - - public void setRotationX(float rot); - - public void setRotationY(float rot); - - /** - * This should be called after rotation setting is done to allow - * for the block to re-calculate. - */ - public void commitRedirection(); -} diff --git a/src/main/java/vazkii/botania/client/core/handler/BossBarHandler.java b/src/main/java/vazkii/botania/client/core/handler/BossBarHandler.java index 6e396f647..8a78d6fe3 100644 --- a/src/main/java/vazkii/botania/client/core/handler/BossBarHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/BossBarHandler.java @@ -11,23 +11,17 @@ package vazkii.botania.client.core.handler; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.lwjgl.opengl.ARBShaderObjects; import org.lwjgl.opengl.GL11; import vazkii.botania.api.boss.IBotaniaBoss; -import vazkii.botania.api.boss.IBotaniaBossWithShader; import vazkii.botania.api.internal.ShaderCallback; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.core.helper.ShaderHelper; import vazkii.botania.client.lib.LibResources; -import vazkii.botania.common.core.helper.MathHelper; import java.awt.*; import java.util.HashSet; @@ -75,13 +69,12 @@ public final class BossBarHandler { } private static void drawBar(IBotaniaBoss currentBoss, int x, int y, int u, int v, int w, int h, boolean bg) { - boolean useShader = currentBoss instanceof IBotaniaBossWithShader; - if(useShader) { - IBotaniaBossWithShader shader = (IBotaniaBossWithShader) currentBoss; - int program = shader.getBossBarShaderProgram(bg); - ShaderCallback callback = program == 0 ? null : shader.getBossBarShaderCallback(bg, program); - barUniformCallback.set(u, v, callback); + int program = currentBoss.getBossBarShaderProgram(bg); + boolean useShader = program > 0; + if(useShader) { + ShaderCallback callback = currentBoss.getBossBarShaderCallback(bg, program); + barUniformCallback.set(u, v, callback); ShaderHelper.useShader(program, barUniformCallback); } diff --git a/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java b/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java index e421c3501..752a28cf9 100644 --- a/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java +++ b/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java @@ -30,7 +30,6 @@ import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.wrapper.CombinedInvWrapper; import org.lwjgl.opengl.GL11; import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.item.IExtendedWireframeCoordinateListProvider; import vazkii.botania.api.item.IWireframeCoordinateListProvider; import vazkii.botania.api.wand.ICoordBoundItem; import vazkii.botania.api.wand.IWireframeAABBProvider; @@ -77,11 +76,9 @@ public final class BoundTileRenderer { for(BlockPos coords : coordsList) renderBlockOutlineAt(coords, color); - if(stackInSlot.getItem() instanceof IExtendedWireframeCoordinateListProvider) { - BlockPos coords = ((IExtendedWireframeCoordinateListProvider) stackInSlot.getItem()).getSourceWireframe(player, stackInSlot); - if(coords != null && coords.getY() > -1) - renderBlockOutlineAt(coords, color, 5F); - } + BlockPos coords = provider.getSourceWireframe(player, stackInSlot); + if(coords != null && coords.getY() > -1) + renderBlockOutlineAt(coords, color, 5F); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java b/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java index 9f84b7608..1369dcab5 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java @@ -34,7 +34,6 @@ import net.minecraft.world.World; import org.lwjgl.opengl.GL11; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.VanillaPacketDispatcher; -import vazkii.botania.api.item.IDyablePool; import vazkii.botania.api.item.IManaDissolvable; import vazkii.botania.api.mana.IKeyLocked; import vazkii.botania.api.mana.IManaItem; @@ -48,7 +47,6 @@ import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.api.state.enums.PoolVariant; import vazkii.botania.client.core.handler.HUDHandler; -import vazkii.botania.client.core.handler.LightningHandler; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.Botania; @@ -66,7 +64,7 @@ import vazkii.botania.common.network.PacketHandler; import java.awt.*; import java.util.List; -public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLocked, ISparkAttachable, IThrottledPacket { +public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAttachable, IThrottledPacket { public static final int MAX_MANA = 1000000; public static final int MAX_MANA_DILLUTED = 10000; diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java index 08012084c..db14e56b6 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java @@ -37,6 +37,7 @@ import org.lwjgl.opengl.GL11; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.mana.BurstProperties; +import vazkii.botania.api.mana.IDirectioned; import vazkii.botania.api.mana.IKeyLocked; import vazkii.botania.api.mana.ILens; import vazkii.botania.api.mana.ILensControl; @@ -45,7 +46,6 @@ import vazkii.botania.api.mana.IManaCollector; import vazkii.botania.api.mana.IManaPool; import vazkii.botania.api.mana.IManaReceiver; import vazkii.botania.api.mana.IManaSpreader; -import vazkii.botania.api.mana.IRedirectable; import vazkii.botania.api.mana.IThrottledPacket; import vazkii.botania.api.mana.ManaNetworkEvent; import vazkii.botania.api.sound.BotaniaSoundEvents; @@ -65,7 +65,7 @@ import vazkii.botania.common.entity.EntityManaBurst.PositionProperties; import java.util.List; import java.util.UUID; -public class TileSpreader extends TileSimpleInventory implements IManaCollector, IWandBindable, IKeyLocked, IThrottledPacket, IManaSpreader, IRedirectable, ITickable { +public class TileSpreader extends TileSimpleInventory implements IManaCollector, IWandBindable, IKeyLocked, IThrottledPacket, IManaSpreader, IDirectioned, ITickable { private static final int MAX_MANA = 1000; private static final int ULTRA_MAX_MANA = 6400; diff --git a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java index 944c17ff3..7fa1a3ead 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java +++ b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java @@ -61,7 +61,7 @@ import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.ARBShaderObjects; -import vazkii.botania.api.boss.IBotaniaBossWithShader; +import vazkii.botania.api.boss.IBotaniaBoss; import vazkii.botania.api.internal.ShaderCallback; import vazkii.botania.api.lexicon.multiblock.Multiblock; import vazkii.botania.api.lexicon.multiblock.MultiblockSet; @@ -90,7 +90,7 @@ import java.util.List; import java.util.UUID; import java.util.regex.Pattern; -public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWithShader { +public class EntityDoppleganger extends EntityCreature implements IBotaniaBoss { public static final float ARENA_RANGE = 12F; private static final int SPAWN_TICKS = 160; diff --git a/src/main/java/vazkii/botania/common/item/ItemManaMirror.java b/src/main/java/vazkii/botania/common/item/ItemManaMirror.java index 941f6a90d..d0c10132c 100644 --- a/src/main/java/vazkii/botania/common/item/ItemManaMirror.java +++ b/src/main/java/vazkii/botania/common/item/ItemManaMirror.java @@ -12,6 +12,7 @@ package vazkii.botania.common.item; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; @@ -228,6 +229,14 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte return false; } + @Override + public EnumDyeColor getColor() { + return EnumDyeColor.WHITE; + } + + @Override + public void setColor(EnumDyeColor color) {} + } @Override diff --git a/src/main/java/vazkii/botania/common/item/lens/LensRedirect.java b/src/main/java/vazkii/botania/common/item/lens/LensRedirect.java index c739430ba..2e36da093 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensRedirect.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensRedirect.java @@ -17,7 +17,7 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; -import vazkii.botania.api.mana.IRedirectable; +import vazkii.botania.api.mana.IDirectioned; import vazkii.botania.api.mana.IThrottledPacket; import vazkii.botania.common.core.helper.Vector3; @@ -28,9 +28,9 @@ public class LensRedirect extends Lens { BlockPos coords = burst.getBurstSourceBlockPos(); if(!entity.worldObj.isRemote && pos.entityHit == null && coords.getY() != -1 && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) { TileEntity tile = entity.worldObj.getTileEntity(pos.getBlockPos()); - if(tile != null && tile instanceof IRedirectable) { + if(tile != null && tile instanceof IDirectioned) { if(!burst.isFake()) { - IRedirectable redir = (IRedirectable) tile; + IDirectioned redir = (IDirectioned) tile; Vector3 tileVec = Vector3.fromTileEntityCenter(tile); Vector3 sourceVec = new Vector3(coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5); diff --git a/src/main/java/vazkii/botania/common/item/material/ItemDye.java b/src/main/java/vazkii/botania/common/item/material/ItemDye.java index 9f66bda8d..0f78c5b40 100644 --- a/src/main/java/vazkii/botania/common/item/material/ItemDye.java +++ b/src/main/java/vazkii/botania/common/item/material/ItemDye.java @@ -25,7 +25,7 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import vazkii.botania.api.item.IDyablePool; +import vazkii.botania.api.mana.IManaPool; import vazkii.botania.common.item.Item16Colors; import vazkii.botania.common.lib.LibItemNames; @@ -47,10 +47,10 @@ public class ItemDye extends Item16Colors { } TileEntity tile = par3World.getTileEntity(pos); - if(tile instanceof IDyablePool) { - IDyablePool dyable = (IDyablePool) tile; - if(color != dyable.getColor()) { - dyable.setColor(color); + if(tile instanceof IManaPool) { + IManaPool pool = (IManaPool) tile; + if(color != pool.getColor()) { + pool.setColor(color); par1ItemStack.stackSize--; return EnumActionResult.SUCCESS; } diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java b/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java index 20db4643b..528f53fe0 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java @@ -29,7 +29,6 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; -import vazkii.botania.api.item.IExtendedWireframeCoordinateListProvider; import vazkii.botania.api.item.IWireframeCoordinateListProvider; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; @@ -41,7 +40,7 @@ import vazkii.botania.common.lib.LibItemNames; import java.util.List; import java.util.UUID; -public class ItemAesirRing extends ItemRelicBauble implements IExtendedWireframeCoordinateListProvider, ICraftAchievement { +public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordinateListProvider, ICraftAchievement { private final Multimap attributes = HashMultimap.create(); @@ -101,7 +100,7 @@ public class ItemAesirRing extends ItemRelicBauble implements IExtendedWireframe @Override public BlockPos getSourceWireframe(EntityPlayer player, ItemStack stack) { - return ((IExtendedWireframeCoordinateListProvider) ModItems.lokiRing).getSourceWireframe(player, stack); + return ((IWireframeCoordinateListProvider) ModItems.lokiRing).getSourceWireframe(player, stack); } @Override diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java b/src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java index 812b1838a..b51a0b508 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java @@ -36,8 +36,8 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import vazkii.botania.api.item.IExtendedWireframeCoordinateListProvider; import vazkii.botania.api.item.ISequentialBreaker; +import vazkii.botania.api.item.IWireframeCoordinateListProvider; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.common.core.helper.ItemNBTHelper; @@ -48,7 +48,7 @@ import vazkii.botania.common.lib.LibItemNames; import java.util.ArrayList; import java.util.List; -public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeCoordinateListProvider, IManaUsingItem { +public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinateListProvider, IManaUsingItem { private static final String TAG_CURSOR_LIST = "cursorList"; private static final String TAG_CURSOR_PREFIX = "cursor"; diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java index 8e3b129c0..c53eaf977 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java @@ -419,4 +419,9 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra return ImmutableList.of(); } + @Override + public BlockPos getSourceWireframe(EntityPlayer player, ItemStack stack) { + return null; + } + }