diff --git a/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java b/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java index bccb46323..e031d7e03 100644 --- a/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java @@ -66,7 +66,7 @@ public final class MultiblockRenderHandler { @SubscribeEvent public static void onWorldRenderLast(RenderWorldLastEvent event) { Minecraft mc = Minecraft.getInstance(); - if(mc.player != null && mc.objectMouseOver != null && mc.objectMouseOver.getType() != RayTraceResult.Type.BLOCK + if(mc.player != null && mc.objectMouseOver != null && mc.objectMouseOver.getType() == RayTraceResult.Type.BLOCK && (!mc.player.isSneaking() || anchor != null)) { renderPlayerLook(mc.player, (BlockRayTraceResult) mc.objectMouseOver); } diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionAllure.java b/src/main/java/vazkii/botania/common/brew/potion/PotionAllure.java index 8ec3e767c..913b482a3 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionAllure.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionAllure.java @@ -13,15 +13,16 @@ package vazkii.botania.common.brew.potion; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.projectile.FishingBobberEntity; +import net.minecraft.potion.Effect; import net.minecraft.potion.EffectType; import vazkii.botania.common.lib.LibPotionNames; import javax.annotation.Nonnull; -public class PotionAllure extends PotionMod { +public class PotionAllure extends Effect { public PotionAllure() { - super(EffectType.BENEFICIAL, 0x0034E4, 5); + super(EffectType.BENEFICIAL, 0x0034E4); } @Override diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionBloodthirst.java b/src/main/java/vazkii/botania/common/brew/potion/PotionBloodthirst.java index b546f3b24..4d17a004a 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionBloodthirst.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionBloodthirst.java @@ -13,6 +13,7 @@ package vazkii.botania.common.brew.potion; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.potion.Effect; import net.minecraft.potion.EffectType; import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.event.entity.living.LivingSpawnEvent; @@ -23,12 +24,12 @@ import vazkii.botania.common.brew.ModPotions; import vazkii.botania.common.lib.LibMisc; @Mod.EventBusSubscriber(modid = LibMisc.MOD_ID) -public class PotionBloodthirst extends PotionMod { +public class PotionBloodthirst extends Effect { private static final int RANGE = 64; public PotionBloodthirst() { - super(EffectType.BENEFICIAL, 0xC30000, 3); + super(EffectType.BENEFICIAL, 0xC30000); } @SubscribeEvent diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionClear.java b/src/main/java/vazkii/botania/common/brew/potion/PotionClear.java index b056b4500..9b46e84b5 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionClear.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionClear.java @@ -14,14 +14,15 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.item.Items; import net.minecraft.item.ItemStack; +import net.minecraft.potion.Effect; import net.minecraft.potion.EffectType; import javax.annotation.Nonnull; -public class PotionClear extends PotionMod { +public class PotionClear extends Effect { public PotionClear() { - super(EffectType.NEUTRAL, 0xFFFFFF, 0); + super(EffectType.NEUTRAL, 0xFFFFFF); } @Override diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionEmptiness.java b/src/main/java/vazkii/botania/common/brew/potion/PotionEmptiness.java index 6f35cbd32..660c0b10f 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionEmptiness.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionEmptiness.java @@ -13,6 +13,7 @@ package vazkii.botania.common.brew.potion; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.potion.Effect; import net.minecraft.potion.EffectType; import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.event.entity.living.LivingSpawnEvent; @@ -20,12 +21,12 @@ import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.eventbus.api.SubscribeEvent; import vazkii.botania.common.brew.ModPotions; -public class PotionEmptiness extends PotionMod { +public class PotionEmptiness extends Effect { private static final int RANGE = 128; public PotionEmptiness() { - super(EffectType.BENEFICIAL, 0xFACFFF, 2); + super(EffectType.BENEFICIAL, 0xFACFFF); } @SubscribeEvent diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionFeatherfeet.java b/src/main/java/vazkii/botania/common/brew/potion/PotionFeatherfeet.java index ed6f4bb03..47bf86d6c 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionFeatherfeet.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionFeatherfeet.java @@ -12,14 +12,15 @@ package vazkii.botania.common.brew.potion; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity; +import net.minecraft.potion.Effect; import net.minecraft.potion.EffectType; import javax.annotation.Nonnull; -public class PotionFeatherfeet extends PotionMod { +public class PotionFeatherfeet extends Effect { public PotionFeatherfeet() { - super(EffectType.BENEFICIAL, 0x26ADFF, 1); + super(EffectType.BENEFICIAL, 0x26ADFF); } @Override diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionMod.java b/src/main/java/vazkii/botania/common/brew/potion/PotionMod.java deleted file mode 100644 index a94fdcdb1..000000000 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionMod.java +++ /dev/null @@ -1,71 +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 @ [Nov 2, 2014, 10:12:45 PM (GMT)] - */ -package vazkii.botania.common.brew.potion; - -import javafx.geometry.Side; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.AbstractGui; -import net.minecraft.client.gui.DisplayEffectsScreen; -import net.minecraft.client.renderer.BufferBuilder; -import com.mojang.blaze3d.platform.GlStateManager; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.entity.LivingEntity; -import net.minecraft.potion.Effect; -import net.minecraft.potion.EffectInstance; -import net.minecraft.potion.EffectType; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import vazkii.botania.client.lib.LibResources; - -public class PotionMod extends Effect { - - private static final ResourceLocation resource = new ResourceLocation(LibResources.GUI_POTIONS); - private final int iconIndex; - - public PotionMod(EffectType type, int color, int iconIndex) { - super(type, color); - this.iconIndex = iconIndex; - } - - @Override - @OnlyIn(Dist.CLIENT) - public void renderInventoryEffect(EffectInstance effect, DisplayEffectsScreen gui, int x, int y, float z) { - render(x + 6, y + 7, 1); - } - - @Override - @OnlyIn(Dist.CLIENT) - public void renderHUDEffect(EffectInstance effect, AbstractGui gui, int x, int y, float z, float alpha) { - render(x + 3, y + 3, alpha); - } - - @OnlyIn(Dist.CLIENT) - private void render(int x, int y, float alpha) { - Minecraft.getInstance().getTextureManager().bindTexture(resource); - Tessellator tessellator = Tessellator.getInstance(); - BufferBuilder buf = tessellator.getBuffer(); - buf.begin(7, DefaultVertexFormats.POSITION_TEX); - GlStateManager.color4f(1, 1, 1, alpha); - - int textureX = iconIndex % 8 * 18; - int textureY = 198 + iconIndex / 8 * 18; - - buf.pos(x, y + 18, 0).tex(textureX * 0.00390625, (textureY + 18) * 0.00390625).endVertex(); - buf.pos(x + 18, y + 18, 0).tex((textureX + 18) * 0.00390625, (textureY + 18) * 0.00390625).endVertex(); - buf.pos(x + 18, y, 0).tex((textureX + 18) * 0.00390625, textureY * 0.00390625).endVertex(); - buf.pos(x, y, 0).tex(textureX * 0.00390625, textureY * 0.00390625).endVertex(); - - tessellator.draw(); - } - -} diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionSoulCross.java b/src/main/java/vazkii/botania/common/brew/potion/PotionSoulCross.java index a578aa1dd..92667cac4 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionSoulCross.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionSoulCross.java @@ -13,6 +13,7 @@ package vazkii.botania.common.brew.potion; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity; +import net.minecraft.potion.Effect; import net.minecraft.potion.EffectType; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -21,10 +22,10 @@ import vazkii.botania.common.brew.ModPotions; import vazkii.botania.common.lib.LibMisc; @Mod.EventBusSubscriber(modid = LibMisc.MOD_ID) -public class PotionSoulCross extends PotionMod { +public class PotionSoulCross extends Effect { public PotionSoulCross() { - super(EffectType.BENEFICIAL, 0x47453d, 0); + super(EffectType.BENEFICIAL, 0x47453d); } @SubscribeEvent diff --git a/src/main/resources/assets/botania/textures/gui/potions.png b/src/main/resources/assets/botania/textures/gui/potions.png deleted file mode 100644 index e9b720bea..000000000 Binary files a/src/main/resources/assets/botania/textures/gui/potions.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/mob_effect/allure.png b/src/main/resources/assets/botania/textures/mob_effect/allure.png new file mode 100644 index 000000000..323bcfcba Binary files /dev/null and b/src/main/resources/assets/botania/textures/mob_effect/allure.png differ diff --git a/src/main/resources/assets/botania/textures/mob_effect/bloodthirst.png b/src/main/resources/assets/botania/textures/mob_effect/bloodthirst.png new file mode 100644 index 000000000..e4c07acbd Binary files /dev/null and b/src/main/resources/assets/botania/textures/mob_effect/bloodthirst.png differ diff --git a/src/main/resources/assets/botania/textures/mob_effect/clear.png b/src/main/resources/assets/botania/textures/mob_effect/clear.png new file mode 100644 index 000000000..acf1270f5 Binary files /dev/null and b/src/main/resources/assets/botania/textures/mob_effect/clear.png differ diff --git a/src/main/resources/assets/botania/textures/mob_effect/emptiness.png b/src/main/resources/assets/botania/textures/mob_effect/emptiness.png new file mode 100644 index 000000000..966c54967 Binary files /dev/null and b/src/main/resources/assets/botania/textures/mob_effect/emptiness.png differ diff --git a/src/main/resources/assets/botania/textures/mob_effect/feather_feet.png b/src/main/resources/assets/botania/textures/mob_effect/feather_feet.png new file mode 100644 index 000000000..877d37355 Binary files /dev/null and b/src/main/resources/assets/botania/textures/mob_effect/feather_feet.png differ diff --git a/src/main/resources/assets/botania/textures/mob_effect/soul_cross.png b/src/main/resources/assets/botania/textures/mob_effect/soul_cross.png new file mode 100644 index 000000000..98479069e Binary files /dev/null and b/src/main/resources/assets/botania/textures/mob_effect/soul_cross.png differ