mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
Move potion textures to vanilla atlas
This commit is contained in:
1 parent
9d46ff7fe0
commit
56320fce98
15 files changed
+19
-84
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user