From 56320fce98ba3d5206c0eb2bbe34f35675a0d2bb Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Mon, 1 Jul 2019 21:43:50 -0700 Subject: [PATCH] Move potion textures to vanilla atlas --- .../core/handler/MultiblockRenderHandler.java | 2 +- .../common/brew/potion/PotionAllure.java | 5 +- .../common/brew/potion/PotionBloodthirst.java | 5 +- .../common/brew/potion/PotionClear.java | 5 +- .../common/brew/potion/PotionEmptiness.java | 5 +- .../common/brew/potion/PotionFeatherfeet.java | 5 +- .../botania/common/brew/potion/PotionMod.java | 71 ------------------ .../common/brew/potion/PotionSoulCross.java | 5 +- .../assets/botania/textures/gui/potions.png | Bin 3111 -> 0 bytes .../botania/textures/mob_effect/allure.png | Bin 0 -> 271 bytes .../textures/mob_effect/bloodthirst.png | Bin 0 -> 430 bytes .../botania/textures/mob_effect/clear.png | Bin 0 -> 421 bytes .../botania/textures/mob_effect/emptiness.png | Bin 0 -> 412 bytes .../textures/mob_effect/feather_feet.png | Bin 0 -> 337 bytes .../textures/mob_effect/soul_cross.png | Bin 0 -> 317 bytes 15 files changed, 19 insertions(+), 84 deletions(-) delete mode 100644 src/main/java/vazkii/botania/common/brew/potion/PotionMod.java delete mode 100644 src/main/resources/assets/botania/textures/gui/potions.png create mode 100644 src/main/resources/assets/botania/textures/mob_effect/allure.png create mode 100644 src/main/resources/assets/botania/textures/mob_effect/bloodthirst.png create mode 100644 src/main/resources/assets/botania/textures/mob_effect/clear.png create mode 100644 src/main/resources/assets/botania/textures/mob_effect/emptiness.png create mode 100644 src/main/resources/assets/botania/textures/mob_effect/feather_feet.png create mode 100644 src/main/resources/assets/botania/textures/mob_effect/soul_cross.png 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 e9b720beadb7ef9bbe89271c6ffe9bd3d7a38d31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3111 zcmcguc{tQtAO8)J=H75GUUEf?B`I05HLj&smPoQ2Wn`POPnNO7h$PE!jk*Y>kYwMD z3E|GjGL~sdjbX}=eFiaTws(4;_n-Hl`~KB?o^zh>=X{^@oag)fe4g()-*g9itAk*9 zFaQ7tZLBRE0RSX`AV5r1V6NVJ5g;%J!mT|b06@I&`vS?FxR@kx9`UtyyaWJoDgcm_ z0swn_fn5TCC@lb3_6C4+1ppu$hJoQN0pO=v8w+#i7|JRY7VP;BG_XNKkd*zPUqUab zD|a{<3w1j%w%KD#E7g3d5a6~9qfYVE+2zNe~sP_eUCqES-f zA+9k>>~z&J3r`l{G;uEY9^9Zp{o>FG6h;*;!RqSj-gsiDa>%P&Y4BK8NuJ@{Z6K;x1PlU~)SaBZ}9?{z6Y(r9H0&9>*@5+mK2;k(A%`YmsdkI)udu zD~2{2jTWG6oRVhie0#dZ`I3^7<;BGU{a=b}Yv9icbUb}su>S3Yg5&{|7u~sFcV5x= z!$@gB4v5-tvnw7K#+Hf>4z3|J(Y9EulM3RvoeD?w9lD>+Qr)Rv)9)&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zCPYnytAo0AS-sJH1SNE(*LBiJ{RR=n^NKF+y(h{)U@?QBzRkC?v?P;A&mKQkY;A3= zs;;&@)5B>ZEwwV}efz8}n} zVXSM38uXrl*YwwXk;`wy2$X5{yjRn;r4qE=7c-cd{K_=PSa$C(pT~{5_(`LvFGTj$63^Tuq~%&maz74#7ve>CxwhiKBYLqjNj^%~a~PG>|G~Ut^hiWBCv*_u#$=y(8_ESMuY!vBY3E zDZFufg?i`ZtKqEa9J`5>FkQ;@{ejAo&=mn61o|B8;|aM+3xIeqeO-vuPsB88{qN(A z_7U3I%;cy1y|I47RC*S}1D{d(XRNT6XK#^&2f?F&-k@}C%3wxX+Wid<;DEzT4DB7K z+(CcW_c;`S*1af3o@t6;==U46QU&K?Ud?(y1#;TM;0RLS}n?(6p@XPfZ zF6fFo-IoE9bpOVT0Dg?%4H{?qCG)Q8#+G~N`pwOr- z5)+mpMYi)|e<$#_R!qb-H-9k#kh>!ZLd4yl{<&3(5G6@ejR-NVs!6^OXTe^{RU?-B z$Dy?Ez>-E`@0D~AGn1LU!E%*7#Op4BVs}ZN;|4RMEK2~|wxzCX2r(Tvtl@N}*scJI zf!I2%r`mtzoNxKKyASlqwe}pqw>o|5GbMJuvflU!F~z=mOFf{ZJ|GME*%$d^y8|wt V!fE4k{4f9j002ovPDHLkV1nQ&Z#@72 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..e4c07acbd52f06e94cd02550079cc4f5ffd9f399 GIT binary patch literal 430 zcmV;f0a5;mP)NwHbAIQ{oMB)+lTkri2U0c78CV!3 zRh1S&Rf4RV=CUwltgM>m#1RUZyHpSnX;A<&lgS{ZLU3$eIs{(8_fMaz?BVjDP0Ql+`i{zN5!-V)NbXU}7s%b0i6{1zAfeFYLoQ1) zl}5LAC|4=~oF5-uBggY`KkB@`57^QS03M%eq|z}2hO#3isL^T@ z1ObWNZ2(4|OU$xyhCU Y0^$L!K3X2O2LJ#707*qoM6N<$f&(_Z2LJ#7 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..acf1270f579ef4f33f5e8adade8c169709a425c7 GIT binary patch literal 421 zcmV;W0b2fvP)Ev^DF6otQ%r%6o(Oi}>~Gb64fVF`m^Jt#JU#G+UQh9xu% zW=H@5_C7`5{J*-5xowD`eHA_biKJ!r-88625h(6n%(7c3Bc`k zW3$;r5x_iKQ-HE8xn8eP#28Z>tJMmC)9HlwKDOS3I_FeGR8?zPRnMrZP9~ElAJ5es zdGE=x?By+0EEbDq_rqgN5kpVP> zKnQ`NC^#Grs4B*oT289Ud_KooOHmYYo5shE;W_7YHk)Y^d7i6?w1TFoR3*maG1gj= zBq2>xcDo%R1p56x)>`)a{X31eGeAW|opVhW@4m-Nv6g7lbys{{_!WKuW|ykg&l?E} P00000NkvXXu0mjftPHXO literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..966c54967bdc8efbf8912506e9d7ac603e986c93 GIT binary patch literal 412 zcmV;N0b~A&P)fQg!b7b2I0V7P>^>(1C9S(YIS{K;fy&YbzqoSBn>^`yfFYaNJ`at;;*X;Y*q zsL7zEl*_`5zFJB-T?jZVY$k{Z9Z>-KfI~D2h~eY%i-(1UO#+4Ho!8)A0OBFwgsLVZ zpAFL3q!DQPbkX?6T;oP7a9cdau@j_{Ta1Q1h*@---(2228~u&Xe_c32d4f)NK%?EE z)@Y+V#ZSLS?mV+7_MCL-Dy#oh&Y$VWVs1LWE1Vi%)|gte_Co36gt)Uq`KbaxOlPTo zzEN#;jM0stf#>7at9*P7*|cl`?jI`bXHp34d+y9N zOnMP!tW=P}LS6)kQaIr3;;OKqU$Bnm@{Ev(+Oz6c0>B?}#=7SYb}}{q0000Zq}6ox;dsuyv@z!jP+aEs1NxkT>JDO*)#GD9xlD=;A3 zm2BD5;blN}46%u&{t}X{_xSjXF$M9+VqPTrk_`f&wFaQ7DgcyHSuhXLT8p(-VhJq6 zaT*5rn?tCz*4MPwS+MY_GnfN8=u3)k-2XfohV!f?no*=Nk_~!Gkv@*rkBj25VQxor zBjxE~v}X6xs2?o-@NAdLCRJ#5igK#}D7T7cr)Kr8>t^$qk(g0t7NK1#OOTjR`2L+N z`s<&!J71s&+O`Ftu4`C1Hqsc8@+897&A(_4!*m57>hi|up>=U~=L?hF=X=s(xwNoJ jav`gQh<^5O3F(WYg%=G0T}dS zvh;-?cntb6%hgUgs{n0|M6o6S4*RWw0fbSP(Rf;^H)T}L#sQq=YKI?qWa-Q5+!%H{ z=y1E9B}~hzF=#mHspt7DspMp8OPiD=J|Plrg4jT+m3Gik4hw*_?(>DPwX$ApYFpDX za$T2}=V>;-?V5HV^E~Hqf2uPh6-Hf%tQ>Pj#nuCraLaeCQP_Md`VYMUS*B4Ruute0 P00000NkvXXu0mjfoKu28 literal 0 HcmV?d00001