mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 20:22:33 +00:00
More work
This commit is contained in:
1 parent
17ccb624f8
commit
2fc16d628d
72 files changed
+347
-297
No files matched your search
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.api.subtile;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -235,7 +236,7 @@ public class TileEntityFunctionalFlower extends TileEntitySpecialFlower {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc) {
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc) {
|
||||
String name = I18n.format(getBlockState().getBlock().getTranslationKey());
|
||||
int color = getColor();
|
||||
BotaniaAPI.instance().internalHandler().drawComplexManaHUD(color, getMana(), getMaxMana(), name, BotaniaAPI.instance().internalHandler().getBindDisplayForFlowerType(this), isValidBinding());
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.api.subtile;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
@@ -289,7 +290,7 @@ public class TileEntityGeneratingFlower extends TileEntitySpecialFlower {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc) {
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc) {
|
||||
String name = I18n.format(getBlockState().getBlock().getTranslationKey());
|
||||
int color = getColor();
|
||||
BotaniaAPI.instance().internalHandler().drawComplexManaHUD(color, getMana(), getMaxMana(), name, BotaniaAPI.instance().internalHandler().getBindDisplayForFlowerType(this), isValidBinding());
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.api.subtile;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
@@ -298,7 +299,7 @@ public class TileEntitySpecialFlower extends TileEntity implements ITickableTile
|
||||
* Used to render a HUD portraying some data from this sub tile.
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void renderHUD(Minecraft mc) {}
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc) {}
|
||||
|
||||
/**
|
||||
* Gets the comparator input value for this SubTileEntity
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.api.wand;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -21,6 +22,6 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
public interface IWandHUD {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void renderHUD(Minecraft mc, World world, BlockPos pos);
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc, World world, BlockPos pos);
|
||||
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public final class BossBarHandler {
|
||||
mc.textureManager.bindTexture(currentBoss.getBossBarTexture());
|
||||
drawBar(currentBoss, x, y, bgRect.x, bgRect.y, bgRect.width, bgRect.height, true);
|
||||
drawBar(currentBoss, xf, yf, fgRect.x, fgRect.y, fw, fgRect.height, false);
|
||||
mc.fontRenderer.drawStringWithShadow(name, tx, y - 10, 0xA2018C);
|
||||
mc.fontRenderer.func_238405_a_(name, tx, y - 10, 0xA2018C);
|
||||
RenderSystem.enableBlend();
|
||||
evt.setIncrement(Math.max(bgRect.height, fgRect.height) + auxHeight + mc.fontRenderer.FONT_HEIGHT);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public final class BossBarHandler {
|
||||
ShaderHelper.useShader(program, barUniformCallback);
|
||||
}
|
||||
|
||||
RenderHelper.drawTexturedModalRect(x, y, u, v, w, h);
|
||||
RenderHelper.drawTexturedModalRect(ms, x, y, u, v, w, h);
|
||||
|
||||
if (program != null) {
|
||||
ShaderHelper.releaseShader();
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.client.core.handler;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -76,6 +77,7 @@ public final class HUDHandler {
|
||||
IProfiler profiler = mc.getProfiler();
|
||||
ItemStack main = mc.player.getHeldItemMainhand();
|
||||
ItemStack offhand = mc.player.getHeldItemOffhand();
|
||||
MatrixStack ms = null; // todo 1.16 Forge moment: ms is not accessible from the event currently
|
||||
|
||||
if (event.getType() == ElementType.ALL) {
|
||||
profiler.startSection("botania-hud");
|
||||
@@ -84,14 +86,14 @@ public final class HUDHandler {
|
||||
ItemStack tiara = EquipmentHandler.findOrEmpty(ModItems.flightTiara, mc.player);
|
||||
if (!tiara.isEmpty()) {
|
||||
profiler.startSection("flugelTiara");
|
||||
ItemFlightTiara.renderHUD(mc.player, tiara);
|
||||
ItemFlightTiara.renderHUD(ms, mc.player, tiara);
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
ItemStack dodgeRing = EquipmentHandler.findOrEmpty(ModItems.dodgeRing, mc.player);
|
||||
if (!dodgeRing.isEmpty()) {
|
||||
profiler.startSection("dodgeRing");
|
||||
ItemDodgeRing.renderHUD(mc.player, dodgeRing, event.getPartialTicks());
|
||||
ItemDodgeRing.renderHUD(ms, mc.player, dodgeRing, event.getPartialTicks());
|
||||
profiler.endSection();
|
||||
}
|
||||
}
|
||||
@@ -108,21 +110,21 @@ public final class HUDHandler {
|
||||
if (PlayerHelper.hasHeldItem(mc.player, ModItems.twigWand)) {
|
||||
if (block instanceof IWandHUD) {
|
||||
profiler.startSection("wandItem");
|
||||
((IWandHUD) block).renderHUD(mc, mc.world, bpos);
|
||||
((IWandHUD) block).renderHUD(ms, mc, mc.world, bpos);
|
||||
profiler.endSection();
|
||||
}
|
||||
}
|
||||
if (tile instanceof TilePool && !mc.player.getHeldItemMainhand().isEmpty()) {
|
||||
renderPoolRecipeHUD((TilePool) tile, mc.player.getHeldItemMainhand());
|
||||
renderPoolRecipeHUD(ms, (TilePool) tile, mc.player.getHeldItemMainhand());
|
||||
}
|
||||
}
|
||||
if (!PlayerHelper.hasHeldItem(mc.player, ModItems.lexicon)) {
|
||||
if (tile instanceof TileAltar) {
|
||||
((TileAltar) tile).renderHUD(mc);
|
||||
((TileAltar) tile).renderHUD(ms, mc);
|
||||
} else if (tile instanceof TileRuneAltar) {
|
||||
((TileRuneAltar) tile).renderHUD(mc);
|
||||
((TileRuneAltar) tile).renderHUD(ms, mc);
|
||||
} else if (tile instanceof TileCorporeaCrystalCube) {
|
||||
renderCrystalCubeHUD((TileCorporeaCrystalCube) tile);
|
||||
renderCrystalCubeHUD(ms, (TileCorporeaCrystalCube) tile);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,23 +132,23 @@ public final class HUDHandler {
|
||||
TileCorporeaIndex.getInputHandler();
|
||||
if (!InputHandler.getNearbyIndexes(mc.player).isEmpty() && mc.currentScreen instanceof ChatScreen) {
|
||||
profiler.startSection("nearIndex");
|
||||
renderNearIndexDisplay();
|
||||
renderNearIndexDisplay(ms);
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
if (!main.isEmpty() && main.getItem() instanceof ItemCraftingHalo) {
|
||||
profiler.startSection("craftingHalo_main");
|
||||
ItemCraftingHalo.renderHUD(mc.player, main);
|
||||
ItemCraftingHalo.renderHUD(ms, mc.player, main);
|
||||
profiler.endSection();
|
||||
} else if (!offhand.isEmpty() && offhand.getItem() instanceof ItemCraftingHalo) {
|
||||
profiler.startSection("craftingHalo_off");
|
||||
ItemCraftingHalo.renderHUD(mc.player, offhand);
|
||||
ItemCraftingHalo.renderHUD(ms, mc.player, offhand);
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
if (!main.isEmpty() && main.getItem() instanceof ItemSextant) {
|
||||
profiler.startSection("sextant");
|
||||
ItemSextant.renderHUD(mc.player, main);
|
||||
ItemSextant.renderHUD(ms, mc.player, main);
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
@@ -158,7 +160,7 @@ public final class HUDHandler {
|
||||
|
||||
if (Botania.proxy.isClientPlayerWearingMonocle()) {
|
||||
profiler.startSection("monocle");
|
||||
ItemMonocle.renderHUD(mc.player);
|
||||
ItemMonocle.renderHUD(ms, mc.player);
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
@@ -218,7 +220,7 @@ public final class HUDHandler {
|
||||
}
|
||||
|
||||
if (anyRequest) {
|
||||
renderManaInvBar(creative, totalMana, totalMaxMana);
|
||||
renderManaInvBar(ms, creative, totalMana, totalMaxMana);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,7 +233,7 @@ public final class HUDHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private static void renderManaInvBar(boolean hasCreative, int totalMana, int totalMaxMana) {
|
||||
private static void renderManaInvBar(MatrixStack ms, boolean hasCreative, int totalMana, int totalMaxMana) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
int width = 182;
|
||||
int x = mc.getMainWindow().getScaledWidth() / 2 - width / 2;
|
||||
@@ -262,12 +264,12 @@ public final class HUDHandler {
|
||||
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
RenderHelper.drawTexturedModalRect(x, y, 0, 251, width, 5);
|
||||
RenderHelper.drawTexturedModalRect(ms, x, y, 0, 251, width, 5);
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.color4f(1, 1, 1, 1);
|
||||
}
|
||||
|
||||
private static void renderPoolRecipeHUD(TilePool tile, ItemStack stack) {
|
||||
private static void renderPoolRecipeHUD(MatrixStack ms, TilePool tile, ItemStack stack) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
IProfiler profiler = mc.getProfiler();
|
||||
|
||||
@@ -284,7 +286,7 @@ public final class HUDHandler {
|
||||
RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
mc.textureManager.bindTexture(manaBar);
|
||||
RenderHelper.drawTexturedModalRect(x, y, u, v, 22, 15);
|
||||
RenderHelper.drawTexturedModalRect(ms, x, y, u, v, 22, 15);
|
||||
RenderSystem.color4f(1F, 1F, 1F, 1F);
|
||||
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(stack, x - 20, y);
|
||||
@@ -297,7 +299,7 @@ public final class HUDHandler {
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
private static void renderCrystalCubeHUD(TileCorporeaCrystalCube tile) {
|
||||
private static void renderCrystalCubeHUD(MatrixStack ms, TileCorporeaCrystalCube tile) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
IProfiler profiler = mc.getProfiler();
|
||||
|
||||
@@ -310,13 +312,13 @@ public final class HUDHandler {
|
||||
int w = mc.getMainWindow().getScaledWidth();
|
||||
int h = mc.getMainWindow().getScaledHeight();
|
||||
int boxH = h / 2 + (tile.locked ? 20 : 10);
|
||||
AbstractGui.fill(w / 2 + 8, h / 2 - 12, w / 2 + strlen + 32, boxH, 0x44000000);
|
||||
AbstractGui.fill(w / 2 + 6, h / 2 - 14, w / 2 + strlen + 34, boxH + 2, 0x44000000);
|
||||
AbstractGui.func_238467_a_(ms, w / 2 + 8, h / 2 - 12, w / 2 + strlen + 32, boxH, 0x44000000);
|
||||
AbstractGui.func_238467_a_(ms, w / 2 + 6, h / 2 - 14, w / 2 + strlen + 34, boxH + 2, 0x44000000);
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(s1, w / 2 + 30, h / 2 - 10, 0x6666FF);
|
||||
mc.fontRenderer.drawStringWithShadow(tile.getItemCount() + "x", w / 2 + 30, h / 2, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238405_a_(ms, s1, w / 2 + 30, h / 2 - 10, 0x6666FF);
|
||||
mc.fontRenderer.func_238405_a_(ms, tile.getItemCount() + "x", w / 2 + 30, h / 2, 0xFFFFFF);
|
||||
if (tile.locked) {
|
||||
mc.fontRenderer.drawStringWithShadow(I18n.format("botaniamisc.locked"), w / 2 + 30, h / 2 + 10, 0xFFAA00);
|
||||
mc.fontRenderer.func_238405_a_(ms, I18n.format("botaniamisc.locked"), w / 2 + 30, h / 2 + 10, 0xFFAA00);
|
||||
}
|
||||
RenderSystem.enableRescaleNormal();
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(target, w / 2 + 10, h / 2 - 10);
|
||||
@@ -325,7 +327,7 @@ public final class HUDHandler {
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
private static void renderNearIndexDisplay() {
|
||||
private static void renderNearIndexDisplay(MatrixStack ms) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
String txt0 = I18n.format("botaniamisc.nearIndex0");
|
||||
String txt1 = TextFormatting.GRAY + I18n.format("botaniamisc.nearIndex1");
|
||||
@@ -335,35 +337,35 @@ public final class HUDHandler {
|
||||
int x = mc.getMainWindow().getScaledWidth() - l - 20;
|
||||
int y = mc.getMainWindow().getScaledHeight() - 60;
|
||||
|
||||
AbstractGui.fill(x - 6, y - 6, x + l + 6, y + 37, 0x44000000);
|
||||
AbstractGui.fill(x - 4, y - 4, x + l + 4, y + 35, 0x44000000);
|
||||
AbstractGui.func_238467_a_(ms, x - 6, y - 6, x + l + 6, y + 37, 0x44000000);
|
||||
AbstractGui.func_238467_a_(ms, x - 4, y - 4, x + l + 4, y + 35, 0x44000000);
|
||||
RenderSystem.enableRescaleNormal();
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(new ItemStack(ModBlocks.corporeaIndex), x, y + 10);
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(txt0, x + 20, y, 0xFFFFFF);
|
||||
mc.fontRenderer.drawStringWithShadow(txt1, x + 20, y + 14, 0xFFFFFF);
|
||||
mc.fontRenderer.drawStringWithShadow(txt2, x + 20, y + 24, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238405_a_(ms, txt0, x + 20, y, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238405_a_(ms, txt1, x + 20, y + 14, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238405_a_(ms, txt2, x + 20, y + 24, 0xFFFFFF);
|
||||
}
|
||||
|
||||
public static void drawSimpleManaHUD(int color, int mana, int maxMana, String name) {
|
||||
public static void drawSimpleManaHUD(MatrixStack ms, int color, int mana, int maxMana, String name) {
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
int x = mc.getMainWindow().getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(name) / 2;
|
||||
int y = mc.getMainWindow().getScaledHeight() / 2 + 10;
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(name, x, y, color);
|
||||
mc.fontRenderer.func_238405_a_(ms, name, x, y, color);
|
||||
|
||||
x = mc.getMainWindow().getScaledWidth() / 2 - 51;
|
||||
y += 10;
|
||||
|
||||
renderManaBar(x, y, color, 1F, mana, maxMana);
|
||||
renderManaBar(ms, x, y, color, 1F, mana, maxMana);
|
||||
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
|
||||
public static void drawComplexManaHUD(int color, int mana, int maxMana, String name, ItemStack bindDisplay, boolean properlyBound) {
|
||||
drawSimpleManaHUD(color, mana, maxMana, name);
|
||||
public static void drawComplexManaHUD(int color, MatrixStack ms, int mana, int maxMana, String name, ItemStack bindDisplay, boolean properlyBound) {
|
||||
drawSimpleManaHUD(ms, color, mana, maxMana, name);
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
||||
@@ -375,21 +377,21 @@ public final class HUDHandler {
|
||||
|
||||
RenderSystem.disableDepthTest();
|
||||
if (properlyBound) {
|
||||
mc.fontRenderer.drawStringWithShadow("\u2714", x + 10, y + 9, 0x004C00);
|
||||
mc.fontRenderer.drawStringWithShadow("\u2714", x + 10, y + 8, 0x0BD20D);
|
||||
mc.fontRenderer.func_238405_a_(ms, "\u2714", x + 10, y + 9, 0x004C00);
|
||||
mc.fontRenderer.func_238405_a_(ms, "\u2714", x + 10, y + 8, 0x0BD20D);
|
||||
} else {
|
||||
mc.fontRenderer.drawStringWithShadow("\u2718", x + 10, y + 9, 0x4C0000);
|
||||
mc.fontRenderer.drawStringWithShadow("\u2718", x + 10, y + 8, 0xD2080D);
|
||||
mc.fontRenderer.func_238405_a_(ms, "\u2718", x + 10, y + 9, 0x4C0000);
|
||||
mc.fontRenderer.func_238405_a_(ms, "\u2718", x + 10, y + 8, 0xD2080D);
|
||||
}
|
||||
RenderSystem.enableDepthTest();
|
||||
}
|
||||
|
||||
public static void renderManaBar(int x, int y, int color, float alpha, int mana, int maxMana) {
|
||||
public static void renderManaBar(MatrixStack ms, int x, int y, int color, float alpha, int mana, int maxMana) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
||||
RenderSystem.color4f(1F, 1F, 1F, alpha);
|
||||
mc.textureManager.bindTexture(manaBar);
|
||||
RenderHelper.drawTexturedModalRect(x, y, 0, 0, 102, 5);
|
||||
RenderHelper.drawTexturedModalRect(ms, x, y, 0, 0, 102, 5);
|
||||
|
||||
int manaPercentage = Math.max(0, (int) ((double) mana / (double) maxMana * 100));
|
||||
|
||||
@@ -397,13 +399,13 @@ public final class HUDHandler {
|
||||
manaPercentage = 1;
|
||||
}
|
||||
|
||||
RenderHelper.drawTexturedModalRect(x + 1, y + 1, 0, 5, 100, 3);
|
||||
RenderHelper.drawTexturedModalRect(ms, x + 1, y + 1, 0, 5, 100, 3);
|
||||
|
||||
float red = (color >> 16 & 0xFF) / 255F;
|
||||
float green = (color >> 8 & 0xFF) / 255F;
|
||||
float blue = (color & 0xFF) / 255F;
|
||||
RenderSystem.color4f(red, green, blue, alpha);
|
||||
RenderHelper.drawTexturedModalRect(x + 1, y + 1, 0, 5, Math.min(100, manaPercentage), 3);
|
||||
RenderHelper.drawTexturedModalRect(ms, x + 1, y + 1, 0, 5, Math.min(100, manaPercentage), 3);
|
||||
RenderSystem.color4f(1, 1, 1, 1);
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ public final class ItemsRemainingRenderHandler {
|
||||
}
|
||||
|
||||
int color = 0x00FFFFFF | (int) (alpha * 0xFF) << 24;
|
||||
mc.fontRenderer.drawStringWithShadow(text, x + 20, y + 6, color);
|
||||
mc.fontRenderer.func_238405_a_(text, x + 20, y + 6, color);
|
||||
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.enableAlphaTest();
|
||||
|
||||
@@ -71,7 +71,7 @@ public class KonamiHandler {
|
||||
|
||||
RenderSystem.translated(currWidth, evt.gui.height / 2 - 10, 0);
|
||||
RenderSystem.scalef(4, 4, 4);
|
||||
Minecraft.getInstance().fontRenderer.drawStringWithShadow(meme, 0, 0, 0xFFFFFF);
|
||||
Minecraft.getInstance().fontRenderer.func_238405_a_(meme, 0, 0, 0xFFFFFF);
|
||||
RenderSystem.popMatrix();
|
||||
RenderSystem.enableDepthTest();
|
||||
}
|
||||
|
||||
@@ -66,10 +66,10 @@ public final class TooltipAdditionDisplayHandler {
|
||||
RenderSystem.disableLighting();
|
||||
RenderSystem.pushMatrix();
|
||||
RenderSystem.translatef(0, 0, 300);
|
||||
font.drawStringWithShadow(rank, mouseX, mouseY - 12, 0xFFFFFF);
|
||||
font.func_238405_a_(rank, mouseX, mouseY - 12, 0xFFFFFF);
|
||||
if (!ss) {
|
||||
rank = I18n.format("botania.rank" + (level + 1)).replaceAll("&", "\u00a7");
|
||||
font.drawStringWithShadow(rank, mouseX + width - font.getStringWidth(rank), mouseY - 12, 0xFFFFFF);
|
||||
font.func_238405_a_(rank, mouseX + width - font.getStringWidth(rank), mouseY - 12, 0xFFFFFF);
|
||||
}
|
||||
RenderSystem.popMatrix();
|
||||
RenderSystem.enableLighting();
|
||||
|
||||
@@ -28,6 +28,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.vector.Matrix4f;
|
||||
import net.minecraft.util.math.vector.Vector3f;
|
||||
import net.minecraft.world.World;
|
||||
@@ -186,8 +187,8 @@ public final class RenderHelper {
|
||||
return RenderType.makeType(LibResources.PREFIX_MOD + "crafting_halo", DefaultVertexFormats.POSITION_COLOR_TEX, GL11.GL_QUADS, 64, false, true, glState);
|
||||
}
|
||||
|
||||
public static void drawTexturedModalRect(int x, int y, int u, int v, int width, int height) {
|
||||
AbstractGui.blit(x, y, u, v, width, height, 256, 256);
|
||||
public static void drawTexturedModalRect(MatrixStack ms, int x, int y, int u, int v, int width, int height) {
|
||||
AbstractGui.func_238463_a_(ms, x, y, u, v, width, height, 256, 256);
|
||||
}
|
||||
|
||||
public static void renderStar(MatrixStack ms, IRenderTypeBuffer buffers, int color, float xScale, float yScale, float zScale, long seed) {
|
||||
@@ -247,7 +248,7 @@ public final class RenderHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public static void renderProgressPie(int x, int y, float progress, ItemStack stack) {
|
||||
public static void renderProgressPie(MatrixStack ms, int x, int y, float progress, ItemStack stack) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(stack, x, y);
|
||||
|
||||
@@ -277,16 +278,17 @@ public final class RenderHelper {
|
||||
RenderSystem.stencilMask(0x00);
|
||||
RenderSystem.stencilFunc(GL11.GL_EQUAL, 1, 0xFF);
|
||||
|
||||
Matrix4f mat = ms.getLast().getMatrix();
|
||||
BufferBuilder buf = Tessellator.getInstance().getBuffer();
|
||||
buf.begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR);
|
||||
buf.pos(centerX, centerY, 0).color(0, 0.5F, 0.5F, a).endVertex();
|
||||
buf.pos(mat, centerX, centerY, 0).color(0, 0.5F, 0.5F, a).endVertex();
|
||||
|
||||
for (int i = degs; i > 0; i--) {
|
||||
double rad = (i - 90) / 180F * Math.PI;
|
||||
buf.pos(centerX + Math.cos(rad) * r, centerY + Math.sin(rad) * r, 0).color(0F, 1F, 0.5F, a).endVertex();
|
||||
float rad = (i - 90) / 180F * (float) Math.PI;
|
||||
buf.pos(mat, centerX + MathHelper.cos(rad) * r, centerY + MathHelper.sin(rad) * r, 0).color(0F, 1F, 0.5F, a).endVertex();
|
||||
}
|
||||
|
||||
buf.pos(centerX, centerY, 0).color(0F, 1F, 0.5F, a).endVertex();
|
||||
buf.pos(mat, centerX, centerY, 0).color(0F, 1F, 0.5F, a).endVertex();
|
||||
Tessellator.getInstance().draw();
|
||||
|
||||
RenderSystem.disableBlend();
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.client.core.proxy;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.FlowerBlock;
|
||||
import net.minecraft.block.TallFlowerBlock;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -20,7 +21,10 @@ import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.particles.IParticleData;
|
||||
import net.minecraft.util.IItemProvider;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Rotation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
@@ -50,29 +54,44 @@ import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.block.decor.BlockFloatingFlower;
|
||||
import vazkii.botania.common.block.decor.BlockModMushroom;
|
||||
import vazkii.botania.common.block.mana.BlockPool;
|
||||
import vazkii.botania.common.block.subtile.functional.BergamuteEventHandler;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.core.proxy.IProxy;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
import vazkii.botania.common.item.ItemSextant;
|
||||
import vazkii.botania.common.item.*;
|
||||
import vazkii.botania.common.item.brew.ItemBrewBase;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemDodgeRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemMagnetRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemMonocle;
|
||||
import vazkii.botania.common.item.equipment.tool.bow.ItemLivingwoodBow;
|
||||
import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraAxe;
|
||||
import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraPick;
|
||||
import vazkii.botania.common.item.relic.ItemInfiniteFruit;
|
||||
import vazkii.botania.common.item.rod.ItemTornadoRod;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import vazkii.patchouli.api.IMultiblock;
|
||||
import vazkii.patchouli.api.PatchouliAPI;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.Month;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.SortedMap;
|
||||
|
||||
import static vazkii.botania.common.lib.ResourceLocationHelper.prefix;
|
||||
|
||||
public class ClientProxy implements IProxy {
|
||||
|
||||
public static boolean jingleTheBells = false;
|
||||
public static boolean dootDoot = false;
|
||||
private static final MethodHandle REGISTER_PROPERTY_GETTER = LibObfuscation.getMethod(ItemModelsProperties.class, "func_239418_a_", Item.class, ResourceLocation.class, IItemPropertyGetter.class);
|
||||
|
||||
public static KeyBinding CORPOREA_REQUEST;
|
||||
|
||||
@@ -139,9 +158,103 @@ public class ClientProxy implements IProxy {
|
||||
ClientRegistry.registerKeyBinding(ClientProxy.CORPOREA_REQUEST);
|
||||
});
|
||||
|
||||
registerPropertyGetters();
|
||||
registerRenderTypes();
|
||||
}
|
||||
|
||||
private static void registerPropertyGetter(IItemProvider item, ResourceLocation id, IItemPropertyGetter propGetter) {
|
||||
try {
|
||||
REGISTER_PROPERTY_GETTER.invokeExact(item.asItem(), id, propGetter);
|
||||
} catch (Throwable throwable) {
|
||||
throw new RuntimeException(throwable);
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerPropertyGetters() {
|
||||
registerPropertyGetter(ModItems.blackHoleTalisman, prefix("active"),
|
||||
(stack, world, entity) -> ItemNBTHelper.getBoolean(stack, ItemBlackHoleTalisman.TAG_ACTIVE, false) ? 1 : 0);
|
||||
registerPropertyGetter(ModItems.manaBottle, prefix("swigs_taken"),
|
||||
(stack, world, entity) -> ItemBottledMana.SWIGS - ItemBottledMana.getSwigsLeft(stack));
|
||||
|
||||
ResourceLocation vuvuzelaId = prefix("vuvuzela");
|
||||
IItemPropertyGetter isVuvuzela = (stack, world, entity) -> stack.getDisplayName().getString().toLowerCase(Locale.ROOT).contains("vuvuzela") ? 1 : 0;
|
||||
registerPropertyGetter(ModItems.grassHorn, vuvuzelaId, isVuvuzela);
|
||||
registerPropertyGetter(ModItems.leavesHorn, vuvuzelaId, isVuvuzela);
|
||||
registerPropertyGetter(ModItems.snowHorn, vuvuzelaId, isVuvuzela);
|
||||
|
||||
registerPropertyGetter(ModItems.lexicon, prefix("elven"), (stack, world, living) -> ModItems.lexicon.isElvenItem(stack) ? 1 : 0);
|
||||
registerPropertyGetter(ModItems.manaCookie, prefix("totalbiscuit"),
|
||||
(stack, world, entity) -> stack.getDisplayName().getString().toLowerCase(Locale.ROOT).contains("totalbiscuit") ? 1F : 0F);
|
||||
registerPropertyGetter(ModItems.slimeBottle, prefix("active"),
|
||||
(stack, world, entity) -> stack.hasTag() && stack.getTag().getBoolean(ItemSlimeBottle.TAG_ACTIVE) ? 1.0F : 0.0F);
|
||||
registerPropertyGetter(ModItems.spawnerMover, prefix("full"),
|
||||
(stack, world, entity) -> ItemSpawnerMover.hasData(stack) ? 1 : 0);
|
||||
registerPropertyGetter(ModItems.temperanceStone, prefix("active"),
|
||||
(stack, world, entity) -> ItemNBTHelper.getBoolean(stack, ItemTemperanceStone.TAG_ACTIVE, false) ? 1 : 0);
|
||||
registerPropertyGetter(ModItems.twigWand, prefix("bindmode"),
|
||||
(stack, world, entity) -> ItemTwigWand.getBindMode(stack) ? 1 : 0);
|
||||
|
||||
ResourceLocation poolFullId = prefix("full");
|
||||
IItemPropertyGetter poolFull = (stack, world, entity) -> {
|
||||
Block block = ((BlockItem) stack.getItem()).getBlock();
|
||||
boolean renderFull = ((BlockPool) block).variant == BlockPool.Variant.CREATIVE || stack.hasTag() && stack.getTag().getBoolean("RenderFull");
|
||||
return renderFull ? 1F : 0F;
|
||||
};
|
||||
registerPropertyGetter(ModBlocks.manaPool, poolFullId, poolFull);
|
||||
registerPropertyGetter(ModBlocks.dilutedPool, poolFullId, poolFull);
|
||||
registerPropertyGetter(ModBlocks.creativePool, poolFullId, poolFull);
|
||||
registerPropertyGetter(ModBlocks.fabulousPool, poolFullId, poolFull);
|
||||
|
||||
IItemPropertyGetter brewGetter = (stack, world, entity) -> {
|
||||
ItemBrewBase item = ((ItemBrewBase) stack.getItem());
|
||||
return item.getSwigs() - item.getSwigsLeft(stack);
|
||||
};
|
||||
registerPropertyGetter(ModItems.brewVial, prefix("swigs_taken"), brewGetter);
|
||||
registerPropertyGetter(ModItems.brewFlask, prefix("swigs_taken"), brewGetter);
|
||||
|
||||
ResourceLocation holidayId = prefix("holiday");
|
||||
IItemPropertyGetter holidayGetter = (stack, worldIn, entityIn) -> ClientProxy.jingleTheBells ? 1 : 0;
|
||||
registerPropertyGetter(ModItems.manaweaveHelm, holidayId, holidayGetter);
|
||||
registerPropertyGetter(ModItems.manaweaveChest, holidayId, holidayGetter);
|
||||
registerPropertyGetter(ModItems.manaweaveBoots, holidayId, holidayGetter);
|
||||
registerPropertyGetter(ModItems.manaweaveLegs, holidayId, holidayGetter);
|
||||
|
||||
IItemPropertyGetter ringOnGetter = (stack, worldIn, entityIn) -> ItemMagnetRing.getCooldown(stack) <= 0 ? 1 : 0;
|
||||
registerPropertyGetter(ModItems.magnetRing, prefix("on"), ringOnGetter);
|
||||
registerPropertyGetter(ModItems.magnetRingGreater, prefix("on"), ringOnGetter);
|
||||
|
||||
registerPropertyGetter(ModItems.elementiumShears, prefix("reddit"),
|
||||
(stack, world, entity) -> stack.getDisplayName().getString().equalsIgnoreCase("dammit reddit") ? 1F : 0F);
|
||||
registerPropertyGetter(ModItems.manasteelSword, prefix("elucidator"),
|
||||
(stack, world, entity) -> "the elucidator".equals(stack.getDisplayName().getString().toLowerCase().trim()) ? 1 : 0);
|
||||
registerPropertyGetter(ModItems.terraAxe, prefix("terraaxe_on"),
|
||||
(stack, world, entity) -> entity instanceof PlayerEntity && !ItemTerraAxe.shouldBreak((PlayerEntity) entity) ? 0 : 1);
|
||||
registerPropertyGetter(ModItems.terraPick, prefix("tipped"),
|
||||
(stack, world, entity) -> ItemTerraPick.isTipped(stack) ? 1 : 0);
|
||||
registerPropertyGetter(ModItems.terraPick, prefix("enabled"),
|
||||
(stack, world, entity) -> ItemTerraPick.isEnabled(stack) ? 1 : 0);
|
||||
registerPropertyGetter(ModItems.infiniteFruit, prefix("boot"),
|
||||
(stack, worldIn, entity) -> ItemInfiniteFruit.isBoot(stack) ? 1F : 0F);
|
||||
registerPropertyGetter(ModItems.tornadoRod, prefix("flying"),
|
||||
(stack, world, living) -> ItemTornadoRod.isFlying(stack) ? 1 : 0);
|
||||
|
||||
IItemPropertyGetter pulling = ItemModelsProperties.func_239417_a_(Items.BOW, new ResourceLocation("pulling"));
|
||||
IItemPropertyGetter pull = (stack, worldIn, entity) -> {
|
||||
if (entity == null) {
|
||||
return 0.0F;
|
||||
} else {
|
||||
ItemLivingwoodBow item = ((ItemLivingwoodBow) stack.getItem());
|
||||
return entity.getActiveItemStack() != stack
|
||||
? 0.0F
|
||||
: (stack.getUseDuration() - entity.getItemInUseCount()) * item.chargeVelocityMultiplier() / 20.0F;
|
||||
}
|
||||
};
|
||||
registerPropertyGetter(ModItems.livingwoodBow, new ResourceLocation("pulling"), pulling);
|
||||
registerPropertyGetter(ModItems.livingwoodBow, new ResourceLocation("pull"), pull);
|
||||
registerPropertyGetter(ModItems.crystalBow, new ResourceLocation("pulling"), pulling);
|
||||
registerPropertyGetter(ModItems.crystalBow, new ResourceLocation("pull"), pull);
|
||||
}
|
||||
|
||||
private static void registerRenderTypes() {
|
||||
RenderTypeLookup.setRenderLayer(ModBlocks.defaultAltar, RenderType.getCutout());
|
||||
RenderTypeLookup.setRenderLayer(ModBlocks.forestAltar, RenderType.getCutout());
|
||||
|
||||
@@ -63,7 +63,7 @@ public class GuiFlowerBag extends ContainerScreen<ContainerFlowerBag> {
|
||||
int x = guiLeft + slot.xPos;
|
||||
int y = guiTop + slot.yPos;
|
||||
mc.getItemRenderer().renderItemIntoGUI(stack, x, y);
|
||||
mc.fontRenderer.drawStringWithShadow("0", x + 11, y + 9, 0xFF6666);
|
||||
mc.fontRenderer.func_238405_a_("0", x + 11, y + 9, 0xFF6666);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ public class ManaPoolRecipeCategory implements IRecipeCategory<IManaInfusionReci
|
||||
RenderSystem.enableAlphaTest();
|
||||
RenderSystem.enableBlend();
|
||||
overlay.draw(48, 0);
|
||||
HUDHandler.renderManaBar(28, 50, 0x0000FF, 0.75F, recipe.getManaToConsume(), TilePool.MAX_MANA / 10);
|
||||
HUDHandler.renderManaBar(ms, 28, 50, 0x0000FF, 0.75F, recipe.getManaToConsume(), TilePool.MAX_MANA / 10);
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.disableAlphaTest();
|
||||
}
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ public class RunicAltarRecipeCategory implements IRecipeCategory<IRuneAltarRecip
|
||||
RenderSystem.enableAlphaTest();
|
||||
RenderSystem.enableBlend();
|
||||
overlay.draw();
|
||||
HUDHandler.renderManaBar(28, 113, 0x0000FF, 0.75F, recipe.getManaUsage(), TilePool.MAX_MANA / 10);
|
||||
HUDHandler.renderManaBar(ms, 28, 113, 0x0000FF, 0.75F, recipe.getManaUsage(), TilePool.MAX_MANA / 10);
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.disableAlphaTest();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ManaComponent implements ICustomComponent {
|
||||
if (context.isAreaHovered(mouseX, mouseY, x, y - 2, 102, 5 + 20)) {
|
||||
ratio = 1;
|
||||
}
|
||||
HUDHandler.renderManaBar(x, y + 10, 0x0000FF, 0.75F,
|
||||
HUDHandler.renderManaBar(ms, x, y + 10, 0x0000FF, 0.75F,
|
||||
manaValues[(context.getTicksInBook() / 20) % manaValues.length], TilePool.MAX_MANA / ratio);
|
||||
|
||||
String ratioString = I18n.format("botaniamisc.ratio", ratio);
|
||||
|
||||
@@ -10,7 +10,6 @@ package vazkii.botania.client.render.world;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
@@ -21,7 +20,7 @@ public final class SkyblockRenderEvents {
|
||||
public static void onRender(RenderWorldLastEvent event) {
|
||||
World world = Minecraft.getInstance().world;
|
||||
if (ConfigHandler.CLIENT.enableFancySkybox.get()
|
||||
&& world.getDimension().getType() == DimensionType.OVERWORLD
|
||||
&& world.func_234923_W_() == World.field_234918_g_
|
||||
&& (ConfigHandler.CLIENT.enableFancySkyboxInNormalWorlds.get()
|
||||
|| WorldTypeSkyblock.isWorldSkyblock(world))) {
|
||||
if (!(world.getDimension().getSkyRenderer() instanceof SkyblockSkyRenderer)) {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
@@ -82,8 +83,8 @@ public class BlockAnimatedTorch extends BlockModWaterloggable implements ITileEn
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void renderHUD(Minecraft mc, World world, BlockPos pos) {
|
||||
((TileAnimatedTorch) world.getTileEntity(pos)).renderHUD(mc);
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc, World world, BlockPos pos) {
|
||||
((TileAnimatedTorch) world.getTileEntity(pos)).renderHUD(ms, mc);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -48,7 +49,7 @@ public class BlockCraftyCrate extends BlockOpenCrate implements IWandHUD {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, World world, BlockPos pos) {
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc, World world, BlockPos pos) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileCraftCrate) {
|
||||
TileCraftCrate craft = (TileCraftCrate) tile;
|
||||
@@ -58,8 +59,8 @@ public class BlockCraftyCrate extends BlockOpenCrate implements IWandHUD {
|
||||
int xc = mc.getMainWindow().getScaledWidth() / 2 + 20;
|
||||
int yc = mc.getMainWindow().getScaledHeight() / 2 - height / 2;
|
||||
|
||||
AbstractGui.fill(xc - 6, yc - 6, xc + width + 6, yc + height + 6, 0x22000000);
|
||||
AbstractGui.fill(xc - 4, yc - 4, xc + width + 4, yc + height + 4, 0x22000000);
|
||||
AbstractGui.func_238467_a_(ms, xc - 6, yc - 6, xc + width + 6, yc + height + 6, 0x22000000);
|
||||
AbstractGui.func_238467_a_(ms, xc - 4, yc - 4, xc + width + 4, yc + height + 4, 0x22000000);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
@@ -72,7 +73,7 @@ public class BlockCraftyCrate extends BlockOpenCrate implements IWandHUD {
|
||||
enabled = craft.getPattern().openSlots.get(index);
|
||||
}
|
||||
|
||||
AbstractGui.fill(xp, yp, xp + 16, yp + 16, enabled ? 0x22FFFFFF : 0x22FF0000);
|
||||
AbstractGui.func_238467_a_(ms, xp, yp, xp + 16, yp + 16, enabled ? 0x22FFFFFF : 0x22FF0000);
|
||||
|
||||
ItemStack item = craft.getItemHandler().getStackInSlot(index);
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(item, xp, yp);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
@@ -122,8 +123,8 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, World world, BlockPos pos) {
|
||||
((TileEntitySpecialFlower) world.getTileEntity(pos)).renderHUD(mc);
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc, World world, BlockPos pos) {
|
||||
((TileEntitySpecialFlower) world.getTileEntity(pos)).renderHUD(ms, mc);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
@@ -28,7 +29,6 @@ import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -157,7 +157,7 @@ public class BlockHourglass extends BlockModWaterloggable implements IManaTrigge
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, World world, BlockPos pos) {
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc, World world, BlockPos pos) {
|
||||
TileHourglass tile = (TileHourglass) world.getTileEntity(pos);
|
||||
tile.renderHUD();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.FlowerBlock;
|
||||
@@ -144,7 +145,7 @@ public class BlockSpecialFlower extends FlowerBlock implements ITileEntityProvid
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, World world, BlockPos pos) {
|
||||
((TileEntitySpecialFlower) world.getTileEntity(pos)).renderHUD(mc);
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc, World world, BlockPos pos) {
|
||||
((TileEntitySpecialFlower) world.getTileEntity(pos)).renderHUD(ms, mc);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
@@ -110,8 +111,8 @@ public class BlockBrewery extends BlockModWaterloggable implements ITileEntityPr
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, World world, BlockPos pos) {
|
||||
((TileBrewery) world.getTileEntity(pos)).renderHUD(mc);
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc, World world, BlockPos pos) {
|
||||
((TileBrewery) world.getTileEntity(pos)).renderHUD(ms, mc);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
@@ -107,7 +108,7 @@ public class BlockEnchanter extends BlockMod implements ITileEntityProvider, IWa
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, World world, BlockPos pos) {
|
||||
((TileEnchanter) world.getTileEntity(pos)).renderHUD();
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc, World world, BlockPos pos) {
|
||||
((TileEnchanter) world.getTileEntity(pos)).renderHUD(ms);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
@@ -112,7 +113,7 @@ public class BlockPool extends BlockModWaterloggable implements ITileEntityProvi
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, World world, BlockPos pos) {
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc, World world, BlockPos pos) {
|
||||
((TilePool) world.getTileEntity(pos)).renderHUD(mc);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ package vazkii.botania.common.block.mana;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -204,7 +204,7 @@ public class BlockSpreader extends BlockModWaterloggable implements ITileEntityP
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, World world, BlockPos pos) {
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc, World world, BlockPos pos) {
|
||||
((TileSpreader) world.getTileEntity(pos)).renderHUD(mc);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -42,7 +42,7 @@ public class BlockTurntable extends BlockMod implements ITileEntityProvider, IWa
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, World world, BlockPos pos) {
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc, World world, BlockPos pos) {
|
||||
((TileTurntable) world.getTileEntity(pos)).renderHUD(mc);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
@@ -29,7 +30,6 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.corporea.InvWithLocation;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
@@ -37,7 +37,6 @@ import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.TileEntityFunctionalFlower;
|
||||
import vazkii.botania.common.block.ModSubtiles;
|
||||
import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -239,14 +238,14 @@ public class SubTileHopperhock extends TileEntityFunctionalFlower {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc) {
|
||||
super.renderHUD(mc);
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc) {
|
||||
super.renderHUD(ms, mc);
|
||||
|
||||
String filter = I18n.format("botaniamisc.filter" + filterType);
|
||||
int x = mc.getMainWindow().getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(filter) / 2;
|
||||
int y = mc.getMainWindow().getScaledHeight() / 2 + 30;
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(filter, x, y, TextFormatting.GRAY.getColor());
|
||||
mc.fontRenderer.func_238405_a_(ms, filter, x, y, TextFormatting.GRAY.getColor());
|
||||
RenderSystem.disableLighting();
|
||||
}
|
||||
|
||||
|
||||
+4
-5
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -28,14 +29,12 @@ import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.item.IFlowerPlaceable;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.TileEntityFunctionalFlower;
|
||||
import vazkii.botania.common.block.ModSubtiles;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -143,8 +142,8 @@ public class SubTileRannuncarpus extends TileEntityFunctionalFlower {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc) {
|
||||
super.renderHUD(mc);
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc) {
|
||||
super.renderHUD(ms, mc);
|
||||
|
||||
BlockState filter = getUnderlyingBlock();
|
||||
ItemStack recieverStack = new ItemStack(filter.getBlock());
|
||||
@@ -156,7 +155,7 @@ public class SubTileRannuncarpus extends TileEntityFunctionalFlower {
|
||||
int x = mc.getMainWindow().getScaledWidth() / 2 - width;
|
||||
int y = mc.getMainWindow().getScaledHeight() / 2 + 30;
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(stackName, x + 20, y + 5, color);
|
||||
mc.fontRenderer.func_238407_a_(ms, stackName, x + 20, y + 5, color);
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(recieverStack, x, y);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.generating;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -21,7 +22,6 @@ import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.particles.ItemParticleData;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
@@ -29,14 +29,11 @@ import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.TileEntityGeneratingFlower;
|
||||
import vazkii.botania.common.block.ModSubtiles;
|
||||
import vazkii.botania.common.block.tile.ModTiles;
|
||||
import vazkii.botania.common.core.helper.ColorHelper;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
@@ -127,19 +124,19 @@ public class SubTileSpectrolus extends TileEntityGeneratingFlower {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc) {
|
||||
super.renderHUD(mc);
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc) {
|
||||
super.renderHUD(ms, mc);
|
||||
|
||||
ItemStack stack = new ItemStack(ColorHelper.WOOL_MAP.get(nextColor).get());
|
||||
int color = getColor();
|
||||
|
||||
if (!stack.isEmpty()) {
|
||||
ITextComponent stackName = stack.getDisplayName();
|
||||
int width = 16 + mc.fontRenderer.getStringWidth(stackName.getString()) / 2;
|
||||
int width = 16 + mc.fontRenderer.func_238414_a_(stackName) / 2;
|
||||
int x = mc.getMainWindow().getScaledWidth() / 2 - width;
|
||||
int y = mc.getMainWindow().getScaledHeight() / 2 + 30;
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(stackName.getFormattedText(), x + 20, y + 5, color);
|
||||
mc.fontRenderer.func_238407_a_(ms, stackName, x + 20, y + 5, color);
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(stack, x, y);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.block.Blocks;
|
||||
@@ -26,7 +27,6 @@ import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
@@ -41,7 +41,6 @@ import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandlerItem;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.minecraftforge.items.wrapper.RecipeWrapper;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.item.IPetalApothecary;
|
||||
@@ -53,8 +52,6 @@ import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.crafting.ModRecipeTypes;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -368,7 +365,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary,
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void renderHUD(Minecraft mc) {
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc) {
|
||||
int xc = mc.getMainWindow().getScaledWidth() / 2;
|
||||
int yc = mc.getMainWindow().getScaledHeight() / 2;
|
||||
|
||||
@@ -390,13 +387,13 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary,
|
||||
maybeRecipe.ifPresent(recipe -> {
|
||||
RenderSystem.color4f(1F, 1F, 1F, 1F);
|
||||
mc.textureManager.bindTexture(HUDHandler.manaBar);
|
||||
RenderHelper.drawTexturedModalRect(xc + radius + 9, yc - 8, 0, 8, 22, 15);
|
||||
RenderHelper.drawTexturedModalRect(ms, xc + radius + 9, yc - 8, 0, 8, 22, 15);
|
||||
|
||||
ItemStack stack = recipe.getCraftingResult(inv);
|
||||
|
||||
mc.getItemRenderer().renderItemIntoGUI(stack, xc + radius + 32, yc - 8);
|
||||
mc.getItemRenderer().renderItemIntoGUI(new ItemStack(Items.WHEAT_SEEDS), xc + radius + 16, yc + 6);
|
||||
mc.fontRenderer.drawStringWithShadow("+", xc + radius + 14, yc + 10, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238421_b_(ms, "+", xc + radius + 14, yc + 10, 0xFFFFFF);
|
||||
});
|
||||
|
||||
for (int i = 0; i < amt; i++) {
|
||||
@@ -410,9 +407,9 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary,
|
||||
}
|
||||
} else if (recipeKeepTicks > 0 && getFluid() == Fluids.WATER) {
|
||||
String s = I18n.format("botaniamisc.altarRefill0");
|
||||
mc.fontRenderer.drawStringWithShadow(s, xc - mc.fontRenderer.getStringWidth(s) / 2, yc + 10, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238421_b_(ms, s, xc - mc.fontRenderer.getStringWidth(s) / 2, yc + 10, 0xFFFFFF);
|
||||
s = I18n.format("botaniamisc.altarRefill1");
|
||||
mc.fontRenderer.drawStringWithShadow(s, xc - mc.fontRenderer.getStringWidth(s) / 2, yc + 20, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238421_b_(ms, s, xc - mc.fontRenderer.getStringWidth(s) / 2, yc + 20, 0xFFFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
@@ -133,12 +134,12 @@ public class TileAnimatedTorch extends TileMod implements ITickableTileEntity {
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void renderHUD(Minecraft mc) {
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc) {
|
||||
int x = mc.getMainWindow().getScaledWidth() / 2 + 10;
|
||||
int y = mc.getMainWindow().getScaledHeight() / 2 - 8;
|
||||
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(new ItemStack(Blocks.REDSTONE_TORCH), x, y);
|
||||
mc.fontRenderer.drawStringWithShadow(I18n.format("botania.animatedTorch." + torchMode.name().toLowerCase()), x + 18, y + 6, 0xFF4444);
|
||||
mc.fontRenderer.func_238405_a_(ms, I18n.format("botania.animatedTorch." + torchMode.name().toLowerCase()), x + 18, y + 6, 0xFF4444);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -15,11 +16,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.brew.IBrewContainer;
|
||||
import vazkii.botania.api.brew.IBrewItem;
|
||||
@@ -33,8 +32,6 @@ import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.brew.ModBrews;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.crafting.ModRecipeTypes;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -257,7 +254,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver, I
|
||||
return !isFull();
|
||||
}
|
||||
|
||||
public void renderHUD(Minecraft mc) {
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc) {
|
||||
int manaToGet = getManaCost();
|
||||
if (manaToGet > 0) {
|
||||
int x = mc.getMainWindow().getScaledWidth() / 2 + 20;
|
||||
@@ -267,7 +264,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver, I
|
||||
return;
|
||||
}
|
||||
|
||||
RenderHelper.renderProgressPie(x, y, (float) mana / (float) manaToGet, recipe.getOutput(itemHandler.getStackInSlot(0)));
|
||||
RenderHelper.renderProgressPie(ms, x, y, (float) mana / (float) manaToGet, recipe.getOutput(itemHandler.getStackInSlot(0)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package vazkii.botania.common.block.tile;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -24,7 +25,6 @@ import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -32,7 +32,6 @@ import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
@@ -44,8 +43,6 @@ import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.lib.ModTags;
|
||||
import vazkii.botania.common.network.PacketBotaniaEffect;
|
||||
import vazkii.botania.common.network.PacketHandler;
|
||||
@@ -496,12 +493,12 @@ public class TileEnchanter extends TileMod implements ISparkAttachable, ITickabl
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void renderHUD() {
|
||||
public void renderHUD(MatrixStack ms) {
|
||||
if (manaRequired > 0 && !itemToEnchant.isEmpty()) {
|
||||
int x = Minecraft.getInstance().getMainWindow().getScaledWidth() / 2 + 20;
|
||||
int y = Minecraft.getInstance().getMainWindow().getScaledHeight() / 2 - 8;
|
||||
|
||||
RenderHelper.renderProgressPie(x, y, (float) mana / (float) manaRequired, itemToEnchant);
|
||||
RenderHelper.renderProgressPie(ms, x, y, (float) mana / (float) manaRequired, itemToEnchant);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ public class TileHourglass extends TileSimpleInventory implements ITickableTileE
|
||||
|
||||
int time = getTotalTime();
|
||||
String timeStr = StringUtils.ticksToElapsedTime(time);
|
||||
mc.fontRenderer.drawStringWithShadow(timeStr, x + 20, y, getColor());
|
||||
mc.fontRenderer.func_238405_a_(timeStr, x + 20, y, getColor());
|
||||
|
||||
String status = "";
|
||||
if (lock) {
|
||||
@@ -236,7 +236,7 @@ public class TileHourglass extends TileSimpleInventory implements ITickableTileE
|
||||
status = status.isEmpty() ? "stopped" : "lockedStopped";
|
||||
}
|
||||
if (!status.isEmpty()) {
|
||||
mc.fontRenderer.drawStringWithShadow(I18n.format("botaniamisc." + status), x + 20, y + 12, getColor());
|
||||
mc.fontRenderer.func_238405_a_(I18n.format("botaniamisc." + status), x + 20, y + 12, getColor());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -18,13 +19,11 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.vector.Vector3d;
|
||||
import net.minecraftforge.items.wrapper.RecipeWrapper;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -42,8 +41,6 @@ import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.crafting.ModRecipeTypes;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.material.ItemRune;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -363,7 +360,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver,
|
||||
return !isFull();
|
||||
}
|
||||
|
||||
public void renderHUD(Minecraft mc) {
|
||||
public void renderHUD(MatrixStack ms, Minecraft mc) {
|
||||
int xc = mc.getMainWindow().getScaledWidth() / 2;
|
||||
int yc = mc.getMainWindow().getScaledHeight() / 2;
|
||||
|
||||
@@ -389,36 +386,36 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver,
|
||||
|
||||
mc.textureManager.bindTexture(HUDHandler.manaBar);
|
||||
RenderSystem.color4f(1F, 1F, 1F, 1F);
|
||||
RenderHelper.drawTexturedModalRect(xc + radius + 9, yc - 8, progress == 1F ? 0 : 22, 8, 22, 15);
|
||||
RenderHelper.drawTexturedModalRect(ms, xc + radius + 9, yc - 8, progress == 1F ? 0 : 22, 8, 22, 15);
|
||||
|
||||
if (progress == 1F) {
|
||||
mc.getItemRenderer().renderItemIntoGUI(new ItemStack(ModBlocks.livingrock), xc + radius + 16, yc + 8);
|
||||
RenderSystem.translatef(0F, 0F, 100F);
|
||||
ms.translate(0, 0, 100);
|
||||
mc.getItemRenderer().renderItemIntoGUI(new ItemStack(ModItems.twigWand), xc + radius + 24, yc + 8);
|
||||
RenderSystem.translatef(0F, 0F, -100F);
|
||||
ms.translate(0, 0, -100);
|
||||
}
|
||||
|
||||
RenderHelper.renderProgressPie(xc + radius + 32, yc - 8, progress, recipe.getCraftingResult(inv));
|
||||
RenderHelper.renderProgressPie(ms, xc + radius + 32, yc - 8, progress, recipe.getCraftingResult(inv));
|
||||
|
||||
if (progress == 1F) {
|
||||
mc.fontRenderer.drawStringWithShadow("+", xc + radius + 14, yc + 12, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238421_b_(ms, "+", xc + radius + 14, yc + 12, 0xFFFFFF);
|
||||
}
|
||||
});
|
||||
|
||||
for (int i = 0; i < amt; i++) {
|
||||
double xPos = xc + Math.cos(angle * Math.PI / 180D) * radius - 8;
|
||||
double yPos = yc + Math.sin(angle * Math.PI / 180D) * radius - 8;
|
||||
RenderSystem.translated(xPos, yPos, 0);
|
||||
ms.translate(xPos, yPos, 0);
|
||||
mc.getItemRenderer().renderItemIntoGUI(itemHandler.getStackInSlot(i), 0, 0);
|
||||
RenderSystem.translated(-xPos, -yPos, 0);
|
||||
ms.translate(-xPos, -yPos, 0);
|
||||
|
||||
angle += anglePer;
|
||||
}
|
||||
} else if (recipeKeepTicks > 0) {
|
||||
String s = I18n.format("botaniamisc.altarRefill0");
|
||||
mc.fontRenderer.drawStringWithShadow(s, xc - mc.fontRenderer.getStringWidth(s) / 2, yc + 10, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238405_a_(ms, s, xc - mc.fontRenderer.getStringWidth(s) / 2, yc + 10, 0xFFFFFF);
|
||||
s = I18n.format("botaniamisc.altarRefill1");
|
||||
mc.fontRenderer.drawStringWithShadow(s, xc - mc.fontRenderer.getStringWidth(s) / 2, yc + 20, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238405_a_(ms, s, xc - mc.fontRenderer.getStringWidth(s) / 2, yc + 20, 0xFFFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,13 +23,11 @@ import net.minecraft.item.crafting.RecipeManager;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -55,8 +53,6 @@ import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.crafting.ModRecipeTypes;
|
||||
import vazkii.botania.common.item.ItemManaTablet;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -399,7 +395,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
|
||||
ItemStack pool = new ItemStack(getBlockState().getBlock());
|
||||
String name = pool.getDisplayName().getString();
|
||||
int color = 0x4444FF;
|
||||
HUDHandler.drawSimpleManaHUD(color, getCurrentMana(), manaCap, name);
|
||||
HUDHandler.drawSimpleManaHUD(ms, color, getCurrentMana(), manaCap, name);
|
||||
|
||||
int x = Minecraft.getInstance().getMainWindow().getScaledWidth() / 2 - 11;
|
||||
int y = Minecraft.getInstance().getMainWindow().getScaledHeight() / 2 + 30;
|
||||
@@ -411,7 +407,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
|
||||
RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
mc.textureManager.bindTexture(HUDHandler.manaBar);
|
||||
RenderHelper.drawTexturedModalRect(x, y, u, v, 22, 15);
|
||||
RenderHelper.drawTexturedModalRect(ms, x, y, u, v, 22, 15);
|
||||
RenderSystem.color4f(1F, 1F, 1F, 1F);
|
||||
|
||||
ItemStack tablet = new ItemStack(ModItems.manaTablet);
|
||||
|
||||
@@ -22,7 +22,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Mirror;
|
||||
import net.minecraft.util.Rotation;
|
||||
@@ -31,7 +30,6 @@ import net.minecraft.util.math.*;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
@@ -47,8 +45,6 @@ import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.entity.EntityManaBurst;
|
||||
import vazkii.botania.common.entity.EntityManaBurst.PositionProperties;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -544,7 +540,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
public void renderHUD(Minecraft mc) {
|
||||
String name = new ItemStack(getBlockState().getBlock()).getDisplayName().getString();
|
||||
int color = getVariant().hudColor;
|
||||
HUDHandler.drawSimpleManaHUD(color, getCurrentMana(), getMaxMana(), name);
|
||||
HUDHandler.drawSimpleManaHUD(ms, color, getCurrentMana(), getMaxMana(), name);
|
||||
|
||||
ItemStack lens = itemHandler.getStackInSlot(0);
|
||||
if (!lens.isEmpty()) {
|
||||
@@ -553,7 +549,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
int x = mc.getMainWindow().getScaledWidth() / 2 - width;
|
||||
int y = mc.getMainWindow().getScaledHeight() / 2 + 50;
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(lensName, x + 20, y + 5, color);
|
||||
mc.fontRenderer.func_238405_a_(lensName, x + 20, y + 5, color);
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(lens, x, y);
|
||||
RenderSystem.disableLighting();
|
||||
}
|
||||
@@ -567,7 +563,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
int x = mc.getMainWindow().getScaledWidth() / 2 - width;
|
||||
int y = mc.getMainWindow().getScaledHeight() / 2 + 30;
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(stackName, x + 20, y + 5, color);
|
||||
mc.fontRenderer.func_238405_a_(stackName, x + 20, y + 5, color);
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(recieverStack, x, y);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ public class TileTurntable extends TileMod implements ITickableTileEntity {
|
||||
|
||||
int x = mc.getMainWindow().getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(speed) / 2;
|
||||
int y = mc.getMainWindow().getScaledHeight() / 2 - 15;
|
||||
mc.fontRenderer.drawStringWithShadow(speed, x, y, color);
|
||||
mc.fontRenderer.func_238405_a_(speed, x, y, color);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -60,12 +60,12 @@ public class InternalMethodHandler extends DummyMethodHandler {
|
||||
|
||||
@Override
|
||||
public void drawSimpleManaHUD(int color, int mana, int maxMana, String name) {
|
||||
HUDHandler.drawSimpleManaHUD(color, mana, maxMana, name);
|
||||
HUDHandler.drawSimpleManaHUD(ms, color, mana, maxMana, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawComplexManaHUD(int color, int mana, int maxMana, String name, ItemStack bindDisplay, boolean properlyBound) {
|
||||
HUDHandler.drawComplexManaHUD(color, mana, maxMana, name, bindDisplay, properlyBound);
|
||||
HUDHandler.drawComplexManaHUD(color, ms, mana, maxMana, name, bindDisplay, properlyBound);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -953,7 +953,7 @@ public class EntityDoppleganger extends MobEntity implements IEntityAdditionalSp
|
||||
ItemStack stack = new ItemStack(Items.PLAYER_HEAD);
|
||||
mc.getItemRenderer().renderItemIntoGUI(stack, px, py);
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow("" + playerCount, px + 15, py + 4, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238405_a_("" + playerCount, px + 15, py + 4, 0xFFFFFF);
|
||||
RenderSystem.popMatrix();
|
||||
|
||||
return 5;
|
||||
|
||||
@@ -40,14 +40,12 @@ import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemBlackHoleTalisman extends Item implements IBlockProvider {
|
||||
private static final String TAG_ACTIVE = "active";
|
||||
public static final String TAG_ACTIVE = "active";
|
||||
private static final String TAG_BLOCK_NAME = "blockName";
|
||||
private static final String TAG_BLOCK_COUNT = "blockCount";
|
||||
|
||||
public ItemBlackHoleTalisman(Properties props) {
|
||||
super(props);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "active"),
|
||||
(stack, worldIn, entityIn) -> ItemNBTHelper.getBoolean(stack, TAG_ACTIVE, false) ? 1 : 0);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -43,13 +43,12 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class ItemBottledMana extends Item {
|
||||
private static final int SWIGS = 6;
|
||||
public static final int SWIGS = 6;
|
||||
private static final String TAG_SWIGS_LEFT = "swigsLeft";
|
||||
private static final String TAG_SEED = "randomSeed";
|
||||
|
||||
public ItemBottledMana(Properties props) {
|
||||
super(props);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "swigs_taken"), (stack, world, entity) -> SWIGS - getSwigsLeft(stack));
|
||||
}
|
||||
|
||||
public void effect(ItemStack stack, LivingEntity living, int id) {
|
||||
@@ -254,7 +253,7 @@ public class ItemBottledMana extends Item {
|
||||
return UseAction.DRINK;
|
||||
}
|
||||
|
||||
private int getSwigsLeft(ItemStack stack) {
|
||||
public static int getSwigsLeft(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, TAG_SWIGS_LEFT, SWIGS);
|
||||
}
|
||||
|
||||
|
||||
@@ -528,7 +528,7 @@ public class ItemCraftingHalo extends Item {
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static void renderHUD(PlayerEntity player, ItemStack stack) {
|
||||
public static void renderHUD(MatrixStack ms, PlayerEntity player, ItemStack stack) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
int slot = getSegmentLookedAt(stack, player);
|
||||
|
||||
@@ -538,11 +538,11 @@ public class ItemCraftingHalo extends Item {
|
||||
int x = mc.getMainWindow().getScaledWidth() / 2 - l / 2;
|
||||
int y = mc.getMainWindow().getScaledHeight() / 2 - 65;
|
||||
|
||||
AbstractGui.fill(x - 6, y - 6, x + l + 6, y + 37, 0x22000000);
|
||||
AbstractGui.fill(x - 4, y - 4, x + l + 4, y + 35, 0x22000000);
|
||||
AbstractGui.func_238467_a_(ms, x - 6, y - 6, x + l + 6, y + 37, 0x22000000);
|
||||
AbstractGui.func_238467_a_(ms, x - 4, y - 4, x + l + 4, y + 35, 0x22000000);
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(craftingTable, mc.getMainWindow().getScaledWidth() / 2 - 8, mc.getMainWindow().getScaledHeight() / 2 - 52);
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(name, x, y, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238405_a_(ms, name, x, y, 0xFFFFFF);
|
||||
} else {
|
||||
ItemStack[] recipe = getCraftingItems(stack, slot);
|
||||
ITextComponent label = new TranslationTextComponent("botaniamisc.unsetRecipe");
|
||||
@@ -555,30 +555,30 @@ public class ItemCraftingHalo extends Item {
|
||||
setRecipe = true;
|
||||
}
|
||||
|
||||
renderRecipe(label, recipe, player, setRecipe);
|
||||
renderRecipe(ms, label, recipe, player, setRecipe);
|
||||
}
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
private static void renderRecipe(ITextComponent label, ItemStack[] recipe, PlayerEntity player, boolean setRecipe) {
|
||||
private static void renderRecipe(MatrixStack ms, ITextComponent label, ItemStack[] recipe, PlayerEntity player, boolean setRecipe) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
||||
if (!recipe[9].isEmpty()) {
|
||||
int x = mc.getMainWindow().getScaledWidth() / 2 - 45;
|
||||
int y = mc.getMainWindow().getScaledHeight() / 2 - 90;
|
||||
|
||||
AbstractGui.fill(x - 6, y - 6, x + 90 + 6, y + 60, 0x22000000);
|
||||
AbstractGui.fill(x - 4, y - 4, x + 90 + 4, y + 58, 0x22000000);
|
||||
AbstractGui.func_238467_a_(ms, x - 6, y - 6, x + 90 + 6, y + 60, 0x22000000);
|
||||
AbstractGui.func_238467_a_(ms, x - 4, y - 4, x + 90 + 4, y + 58, 0x22000000);
|
||||
|
||||
AbstractGui.fill(x + 66, y + 14, x + 92, y + 40, 0x22000000);
|
||||
AbstractGui.fill(x - 2, y - 2, x + 56, y + 56, 0x22000000);
|
||||
AbstractGui.func_238467_a_(ms, x + 66, y + 14, x + 92, y + 40, 0x22000000);
|
||||
AbstractGui.func_238467_a_(ms, x - 2, y - 2, x + 56, y + 56, 0x22000000);
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
ItemStack stack = recipe[i];
|
||||
if (!stack.isEmpty()) {
|
||||
int xpos = x + i % 3 * 18;
|
||||
int ypos = y + i / 3 * 18;
|
||||
AbstractGui.fill(xpos, ypos, xpos + 16, ypos + 16, 0x22000000);
|
||||
AbstractGui.func_238467_a_(ms, xpos, ypos, xpos + 16, ypos + 16, 0x22000000);
|
||||
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(stack, xpos, ypos);
|
||||
}
|
||||
@@ -592,10 +592,10 @@ public class ItemCraftingHalo extends Item {
|
||||
int yoff = 110;
|
||||
if (setRecipe && !canCraft(recipe, getFakeInv(player))) {
|
||||
String warning = TextFormatting.RED + I18n.format("botaniamisc.cantCraft");
|
||||
mc.fontRenderer.drawStringWithShadow(warning, mc.getMainWindow().getScaledWidth() / 2.0F - mc.fontRenderer.getStringWidth(warning) / 2.0F, mc.getMainWindow().getScaledHeight() / 2.0F - yoff, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238405_a_(ms, warning, mc.getMainWindow().getScaledWidth() / 2.0F - mc.fontRenderer.getStringWidth(warning) / 2.0F, mc.getMainWindow().getScaledHeight() / 2.0F - yoff, 0xFFFFFF);
|
||||
yoff += 12;
|
||||
}
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(label.getFormattedText(), mc.getMainWindow().getScaledWidth() / 2.0F - mc.fontRenderer.getStringWidth(label.getString()) / 2.0F, mc.getMainWindow().getScaledHeight() / 2.0F - yoff, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238407_a_(ms, label, mc.getMainWindow().getScaledWidth() / 2.0F - mc.fontRenderer.getStringWidth(label.getString()) / 2.0F, mc.getMainWindow().getScaledHeight() / 2.0F - yoff, 0xFFFFFF);
|
||||
}
|
||||
}
|
||||
@@ -17,9 +17,9 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.RegistryKey;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ItemGrassSeeds extends Item implements IFloatingFlowerVariant {
|
||||
* Represents a map of dimension IDs to a set of all block swappers
|
||||
* active in that dimension.
|
||||
*/
|
||||
private static final Map<DimensionType, Set<BlockSwapper>> blockSwappers = new HashMap<>();
|
||||
private static final Map<RegistryKey<World>, Set<BlockSwapper>> blockSwappers = new HashMap<>();
|
||||
private static final Map<IslandType, float[]> COLORS = ImmutableMap.<IslandType, float[]>builder()
|
||||
.put(IslandType.GRASS, new float[] { 0F, 0.4F, 0F })
|
||||
.put(IslandType.PODZOL, new float[] { 0.5F, 0.37F, 0F })
|
||||
@@ -103,7 +103,7 @@ public class ItemGrassSeeds extends Item implements IFloatingFlowerVariant {
|
||||
|
||||
public static void onTickEnd(TickEvent.WorldTickEvent event) {
|
||||
if (event.side == LogicalSide.SERVER && event.phase == TickEvent.Phase.END) {
|
||||
DimensionType dim = event.world.getDimension().getType();
|
||||
RegistryKey<World> dim = event.world.func_234923_W_();
|
||||
if (blockSwappers.containsKey(dim)) {
|
||||
blockSwappers.get(dim).removeIf(next -> next == null || !next.tick());
|
||||
}
|
||||
@@ -126,7 +126,7 @@ public class ItemGrassSeeds extends Item implements IFloatingFlowerVariant {
|
||||
private static BlockSwapper addBlockSwapper(World world, BlockPos pos, IslandType type) {
|
||||
BlockSwapper swapper = new BlockSwapper(world, pos, stateForType(type));
|
||||
|
||||
DimensionType dim = world.getDimension().getType();
|
||||
RegistryKey<World> dim = world.func_234923_W_();
|
||||
blockSwappers.computeIfAbsent(dim, d -> new HashSet<>()).add(swapper);
|
||||
|
||||
return swapper;
|
||||
|
||||
@@ -37,8 +37,6 @@ import java.util.Locale;
|
||||
public class ItemHorn extends Item {
|
||||
public ItemHorn(Properties props) {
|
||||
super(props);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "vuvuzela"),
|
||||
(stack, worldIn, entityIn) -> stack.getDisplayName().getString().toLowerCase(Locale.ROOT).contains("vuvuzela") ? 1 : 0);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -40,7 +40,6 @@ public class ItemLexicon extends Item implements IElvenItem {
|
||||
|
||||
public ItemLexicon(Properties props) {
|
||||
super(props);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "elven"), (stack, world, living) -> isElvenItem(stack) ? 1 : 0);
|
||||
}
|
||||
|
||||
public static boolean isOpen() {
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* This class is 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
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class ItemManaCookie extends Item {
|
||||
|
||||
public ItemManaCookie(Properties props) {
|
||||
super(props);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "totalbiscuit"),
|
||||
(stack, worldIn, entityIn) -> stack.getDisplayName().getString().toLowerCase(Locale.ROOT).contains("totalbiscuit") ? 1F : 0F);
|
||||
}
|
||||
}
|
||||
@@ -57,12 +57,6 @@ public class ItemManaGun extends Item implements IManaUsingItem {
|
||||
super(props.defaultMaxDamage(COOLDOWN));
|
||||
}
|
||||
|
||||
// ItemRenderer does not call IBakedModel.getModelWithOverrides unless this is true, or we have called addPropertyOverride.
|
||||
@Override
|
||||
public boolean hasCustomProperties() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, PlayerEntity player, @Nonnull Hand hand) {
|
||||
|
||||
@@ -17,11 +17,12 @@ import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.RegistryKey;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.fml.server.ServerLifecycleHooks;
|
||||
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
@@ -154,9 +155,9 @@ public class ItemManaMirror extends Item implements IManaItem, ICoordBoundItem,
|
||||
}
|
||||
|
||||
ResourceLocation dim = new ResourceLocation(getDimension(stack));
|
||||
DimensionType type = DimensionType.byName(dim);
|
||||
if (type != null) {
|
||||
World world = server.getWorld(type);
|
||||
RegistryKey<World> type = RegistryKey.func_240903_a_(Registry.field_239699_ae_, dim);
|
||||
World world = server.getWorld(type);
|
||||
if (world != null) {
|
||||
TileEntity tile = world.getTileEntity(coords);
|
||||
if (tile instanceof IManaPool) {
|
||||
return (IManaPool) tile;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.block.Blocks;
|
||||
@@ -183,7 +184,7 @@ public class ItemSextant extends Item {
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static void renderHUD(PlayerEntity player, ItemStack stack) {
|
||||
public static void renderHUD(MatrixStack ms, PlayerEntity player, ItemStack stack) {
|
||||
ItemStack onUse = player.getActiveItemStack();
|
||||
int time = player.getItemInUseCount();
|
||||
|
||||
@@ -199,7 +200,7 @@ public class ItemSextant extends Item {
|
||||
s = TextFormatting.RED + s;
|
||||
}
|
||||
|
||||
font.drawStringWithShadow(s, x - font.getStringWidth(s) / 2, y - 4, 0xFFFFFF);
|
||||
font.func_238405_a_(ms, s, x - font.getStringWidth(s) / 2, y - 4, 0xFFFFFF);
|
||||
|
||||
if (inRange) {
|
||||
radius += 4;
|
||||
@@ -209,9 +210,9 @@ public class ItemSextant extends Item {
|
||||
RenderSystem.color4f(0F, 1F, 1F, 1F);
|
||||
for (int i = 0; i < 361; i++) {
|
||||
float radian = (float) (i * Math.PI / 180);
|
||||
double xp = x + Math.cos(radian) * radius;
|
||||
double yp = y + Math.sin(radian) * radius;
|
||||
Tessellator.getInstance().getBuffer().pos(xp, yp, 0).endVertex();
|
||||
float xp = x + net.minecraft.util.math.MathHelper.cos(radian) * (float) radius;
|
||||
float yp = y + net.minecraft.util.math.MathHelper.sin(radian) * (float) radius;
|
||||
Tessellator.getInstance().getBuffer().pos(ms.getLast().getMatrix(), xp, yp, 0).endVertex();
|
||||
}
|
||||
Tessellator.getInstance().draw();
|
||||
RenderSystem.enableTexture();
|
||||
|
||||
@@ -20,11 +20,10 @@ import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public class ItemSlimeBottle extends Item {
|
||||
private static final String TAG_ACTIVE = "active";
|
||||
public static final String TAG_ACTIVE = "active";
|
||||
|
||||
public ItemSlimeBottle(Properties builder) {
|
||||
super(builder);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "active"), (stack, worldIn, entityIn) -> stack.hasTag() && stack.getTag().getBoolean(TAG_ACTIVE) ? 1.0F : 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,7 +48,6 @@ public class ItemSpawnerMover extends Item {
|
||||
|
||||
public ItemSpawnerMover(Properties props) {
|
||||
super(props);
|
||||
addPropertyOverride(new ResourceLocation("botania", "full"), (stack, worldIn, entityIn) -> hasData(stack) ? 1 : 0);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -64,7 +63,7 @@ public class ItemSpawnerMover extends Item {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean hasData(ItemStack stack) {
|
||||
public static boolean hasData(ItemStack stack) {
|
||||
return getEntityId(stack) != null;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,6 @@ public class ItemTemperanceStone extends Item {
|
||||
|
||||
public ItemTemperanceStone(Properties builder) {
|
||||
super(builder);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "active"),
|
||||
(stack, worldIn, entityIn) -> ItemNBTHelper.getBoolean(stack, TAG_ACTIVE, false) ? 1 : 0);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -70,7 +70,6 @@ public class ItemTwigWand extends Item implements ICoordBoundItem {
|
||||
|
||||
public ItemTwigWand(Item.Properties builder) {
|
||||
super(builder);
|
||||
addPropertyOverride(new ResourceLocation("botania", "bindmode"), (stack, worldIn, entityIn) -> getBindMode(stack) ? 1 : 0);
|
||||
}
|
||||
|
||||
private static boolean tryCompleteBinding(BlockPos src, ItemStack stack, ItemUseContext ctx) {
|
||||
|
||||
@@ -82,7 +82,7 @@ import static vazkii.botania.common.block.ModBlocks.register;
|
||||
import static vazkii.botania.common.lib.ResourceLocationHelper.prefix;
|
||||
|
||||
public final class ModItems {
|
||||
public static final Item lexicon = new ItemLexicon(unstackable().rarity(Rarity.UNCOMMON));
|
||||
public static final ItemLexicon lexicon = new ItemLexicon(unstackable().rarity(Rarity.UNCOMMON));
|
||||
|
||||
public static final Item whitePetal = new ItemPetal(ModBlocks.getBuriedPetal(DyeColor.WHITE), DyeColor.WHITE, defaultBuilder());
|
||||
public static final Item orangePetal = new ItemPetal(ModBlocks.getBuriedPetal(DyeColor.ORANGE), DyeColor.ORANGE, defaultBuilder());
|
||||
@@ -190,7 +190,7 @@ public final class ModItems {
|
||||
|
||||
public static final Item manaTablet = new ItemManaTablet(unstackable());
|
||||
public static final Item manaGun = new ItemManaGun(unstackable().setNoRepair());
|
||||
public static final Item manaCookie = new ItemManaCookie(defaultBuilder().food(new Food.Builder().hunger(0).saturation(0.1F).effect(new EffectInstance(Effects.SATURATION, 20, 0), 1).build()));
|
||||
public static final Item manaCookie = new Item(defaultBuilder().food(new Food.Builder().hunger(0).saturation(0.1F).effect(new EffectInstance(Effects.SATURATION, 20, 0), 1).build()));
|
||||
public static final Item fertilizer = new ItemFertilizer(defaultBuilder());
|
||||
|
||||
public static final Item grassSeeds = new ItemGrassSeeds(IFloatingFlower.IslandType.GRASS, defaultBuilder());
|
||||
|
||||
@@ -31,10 +31,6 @@ public class ItemBlockPool extends BlockItem {
|
||||
|
||||
public ItemBlockPool(Block block, Properties props) {
|
||||
super(block, props);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "full"), (stack, worldIn, entityIn) -> {
|
||||
boolean renderFull = ((BlockPool) block).variant == BlockPool.Variant.CREATIVE || stack.hasTag() && stack.getTag().getBoolean("RenderFull");
|
||||
return renderFull ? 1F : 0F;
|
||||
});
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
||||
@@ -57,7 +57,6 @@ public class ItemBrewBase extends Item implements IBrewItem {
|
||||
this.swigs = swigs;
|
||||
this.drinkSpeed = drinkSpeed;
|
||||
this.baseItem = baseItem;
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "swigs_taken"), (stack, world, entity) -> swigs - getSwigsLeft(stack));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -211,6 +210,10 @@ public class ItemBrewBase extends Item implements IBrewItem {
|
||||
return stack.hasTag() ? ItemNBTHelper.getString(stack, TAG_BREW_KEY, "none") : "none";
|
||||
}
|
||||
|
||||
public int getSwigs() {
|
||||
return swigs;
|
||||
}
|
||||
|
||||
public int getSwigsLeft(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, TAG_SWIGS_LEFT, swigs);
|
||||
}
|
||||
|
||||
-1
@@ -36,7 +36,6 @@ public class ItemManaweaveArmor extends ItemManasteelArmor {
|
||||
|
||||
public ItemManaweaveArmor(EquipmentSlotType type, Properties props) {
|
||||
super(type, BotaniaAPI.instance().getManaweaveArmorMaterial(), props);
|
||||
addPropertyOverride(new ResourceLocation("botania", "holiday"), (stack, worldIn, entityIn) -> ClientProxy.jingleTheBells ? 1 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -119,7 +120,7 @@ public class ItemDodgeRing extends ItemBauble {
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static void renderHUD(PlayerEntity player, ItemStack stack, float pticks) {
|
||||
public static void renderHUD(MatrixStack ms, PlayerEntity player, ItemStack stack, float pticks) {
|
||||
int xo = Minecraft.getInstance().getMainWindow().getScaledWidth() / 2 - 20;
|
||||
int y = Minecraft.getInstance().getMainWindow().getScaledHeight() / 2 + 20;
|
||||
|
||||
@@ -128,8 +129,8 @@ public class ItemDodgeRing extends ItemBauble {
|
||||
int width = Math.min((int) ((cd - pticks) * 2), 40);
|
||||
RenderSystem.color4f(1F, 1F, 1F, 1F);
|
||||
if (width > 0) {
|
||||
AbstractGui.fill(xo, y - 2, xo + 40, y - 1, 0x88000000);
|
||||
AbstractGui.fill(xo, y - 2, xo + width, y - 1, 0xFFFFFFFF);
|
||||
AbstractGui.func_238467_a_(ms, xo, y - 2, xo + 40, y - 1, 0x88000000);
|
||||
AbstractGui.func_238467_a_(ms, xo, y - 2, xo + width, y - 1, 0xFFFFFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -445,7 +445,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem {
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static void renderHUD(PlayerEntity player, ItemStack stack) {
|
||||
public static void renderHUD(MatrixStack ms, PlayerEntity player, ItemStack stack) {
|
||||
int u = Math.max(1, getVariant(stack)) * 9 - 9;
|
||||
int v = 0;
|
||||
|
||||
@@ -472,7 +472,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem {
|
||||
}
|
||||
|
||||
RenderSystem.color4f(1F, 1F, 1F, trans);
|
||||
RenderHelper.drawTexturedModalRect(x, y, u, v, 9, 9);
|
||||
RenderHelper.drawTexturedModalRect(ms, x, y, u, v, 9, 9);
|
||||
x += 8;
|
||||
}
|
||||
|
||||
@@ -480,9 +480,9 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem {
|
||||
int width = ItemNBTHelper.getInt(stack, TAG_DASH_COOLDOWN, 0);
|
||||
RenderSystem.color4f(1F, 1F, 1F, 1F);
|
||||
if (width > 0) {
|
||||
AbstractGui.fill(xo, y - 2, xo + 80, y - 1, 0x88000000);
|
||||
AbstractGui.func_238467_a_(ms, xo, y - 2, xo + 80, y - 1, 0x88000000);
|
||||
}
|
||||
AbstractGui.fill(xo, y - 2, xo + width, y - 1, 0xFFFFFFFF);
|
||||
AbstractGui.func_238467_a_(ms, xo, y - 2, xo + width, y - 1, 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
RenderSystem.enableAlphaTest();
|
||||
|
||||
@@ -44,7 +44,6 @@ public class ItemMagnetRing extends ItemBauble {
|
||||
public ItemMagnetRing(Properties props, int range) {
|
||||
super(props);
|
||||
this.range = range;
|
||||
addPropertyOverride(new ResourceLocation("botania", "on"), (stack, worldIn, entityIn) -> ItemMagnetRing.getCooldown(stack) <= 0 ? 1 : 0);
|
||||
}
|
||||
|
||||
private void onTossItem(ItemTossEvent event) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static void renderHUD(PlayerEntity player) {
|
||||
public static void renderHUD(MatrixStack ms, PlayerEntity player) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
RayTraceResult ray = mc.objectMouseOver;
|
||||
if (ray == null || ray.getType() != RayTraceResult.Type.BLOCK) {
|
||||
@@ -84,7 +84,7 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm
|
||||
|
||||
mc.getItemRenderer().renderItemAndEffectIntoGUI(dispStack, x, y);
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(text, x + 20, y + 4, 0xFFFFFF);
|
||||
mc.fontRenderer.func_238405_a_(ms, text, x + 20, y + 4, 0xFFFFFF);
|
||||
}
|
||||
|
||||
public static boolean hasMonocle(PlayerEntity player) {
|
||||
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.item.equipment.bauble;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import net.minecraft.entity.ai.attributes.Attribute;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -23,8 +24,8 @@ public class ItemReachRing extends ItemBauble {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap<String, AttributeModifier> getEquippedAttributeModifiers(ItemStack stack) {
|
||||
Multimap<String, AttributeModifier> attributes = HashMultimap.create();
|
||||
public Multimap<Attribute, AttributeModifier> getEquippedAttributeModifiers(ItemStack stack) {
|
||||
Multimap<Attribute, AttributeModifier> attributes = HashMultimap.create();
|
||||
attributes.put(ForgeMod.REACH_DISTANCE.get(), new AttributeModifier(getBaubleUUID(stack), "Reach Ring", 3.5, AttributeModifier.Operation.ADDITION));
|
||||
return attributes;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ItemCrystalBow extends ItemLivingwoodBow {
|
||||
}
|
||||
|
||||
@Override
|
||||
float chargeVelocityMultiplier() {
|
||||
public float chargeVelocityMultiplier() {
|
||||
return 2F;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,14 +36,6 @@ public class ItemLivingwoodBow extends BowItem implements IManaUsingItem {
|
||||
|
||||
public ItemLivingwoodBow(Properties builder) {
|
||||
super(builder);
|
||||
addPropertyOverride(new ResourceLocation("minecraft:pull"), (stack, worldIn, entityIn) -> {
|
||||
if (entityIn == null) {
|
||||
return 0.0F;
|
||||
} else {
|
||||
ItemStack itemstack = entityIn.getActiveItemStack();
|
||||
return !itemstack.isEmpty() && itemstack.getItem() instanceof ItemLivingwoodBow ? (stack.getUseDuration() - entityIn.getItemInUseCount()) * chargeVelocityMultiplier() / 20.0F : 0.0F;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// [VanillaCopy] super
|
||||
@@ -92,7 +84,7 @@ public class ItemLivingwoodBow extends BowItem implements IManaUsingItem {
|
||||
ArrowItem arrowitem = (ArrowItem) (itemstack.getItem() instanceof ArrowItem ? itemstack.getItem() : Items.ARROW);
|
||||
AbstractArrowEntity abstractarrowentity = arrowitem.createArrow(worldIn, itemstack, playerentity);
|
||||
abstractarrowentity = customeArrow(abstractarrowentity);
|
||||
abstractarrowentity.shoot(playerentity, playerentity.rotationPitch, playerentity.rotationYaw, 0.0F, f * 3.0F, 1.0F);
|
||||
abstractarrowentity.func_234612_a_(playerentity, playerentity.rotationPitch, playerentity.rotationYaw, 0.0F, f * 3.0F, 1.0F);
|
||||
if (f == 1.0F) {
|
||||
abstractarrowentity.setIsCritical(true);
|
||||
}
|
||||
@@ -134,7 +126,7 @@ public class ItemLivingwoodBow extends BowItem implements IManaUsingItem {
|
||||
}
|
||||
}
|
||||
|
||||
float chargeVelocityMultiplier() {
|
||||
public float chargeVelocityMultiplier() {
|
||||
return 1F;
|
||||
}
|
||||
|
||||
|
||||
+23
-15
@@ -13,6 +13,7 @@ import com.google.common.base.Predicates;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.enchantment.Enchantments;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.IShearable;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -23,7 +24,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import net.minecraftforge.common.IForgeShearable;
|
||||
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.tool.ToolCommons;
|
||||
@@ -33,13 +34,12 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class ItemElementiumShears extends ItemManasteelShears {
|
||||
|
||||
public ItemElementiumShears(Properties props) {
|
||||
super(props);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "reddit"),
|
||||
(stack, worldIn, entityIn) -> stack.getDisplayName().getString().equalsIgnoreCase("dammit reddit") ? 1F : 0F);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -68,21 +68,29 @@ public class ItemElementiumShears extends ItemManasteelShears {
|
||||
|
||||
if (count != getUseDuration(stack) && count % 5 == 0) {
|
||||
int range = 12;
|
||||
List<Entity> sheep = living.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(living.getPosX() - range, living.getPosY() - range, living.getPosZ() - range, living.getPosX() + range, living.getPosY() + range, living.getPosZ() + range), Predicates.instanceOf(IShearable.class));
|
||||
if (sheep.size() > 0) {
|
||||
for (Entity entity : sheep) {
|
||||
@SuppressWarnings("unchecked")
|
||||
IShearable target = (IShearable) entity;
|
||||
if (target.isShearable(stack, entity.world, new BlockPos(entity))) {
|
||||
List<ItemStack> drops = target.onSheared(stack, entity.world, new BlockPos(entity), EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack));
|
||||
|
||||
for (ItemStack drop : drops) {
|
||||
entity.entityDropItem(drop, 1.0F);
|
||||
}
|
||||
|
||||
Predicate<Entity> shearablePred = e -> e instanceof IShearable || e instanceof IForgeShearable;
|
||||
List<Entity> shearable = living.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(living.getPosX() - range, living.getPosY() - range, living.getPosZ() - range, living.getPosX() + range, living.getPosY() + range, living.getPosZ() + range), shearablePred);
|
||||
if (shearable.size() > 0) {
|
||||
for (Entity entity : shearable) {
|
||||
if (entity instanceof IShearable && ((IShearable) entity).func_230262_K__()) {
|
||||
((IShearable) entity).func_230263_a_(living.getSoundCategory());
|
||||
ToolCommons.damageItem(stack, 1, living, MANA_PER_DAMAGE);
|
||||
break;
|
||||
} else {
|
||||
IForgeShearable target = (IForgeShearable) entity;
|
||||
if (target.isShearable(stack, entity.world, entity.func_233580_cy_())) {
|
||||
PlayerEntity player = living instanceof PlayerEntity ? (PlayerEntity) living : null;
|
||||
List<ItemStack> drops = target.onSheared(player, stack, entity.world, entity.func_233580_cy_(), EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack));
|
||||
|
||||
for (ItemStack drop : drops) {
|
||||
entity.entityDropItem(drop, 1.0F);
|
||||
}
|
||||
|
||||
ToolCommons.damageItem(stack, 1, living, MANA_PER_DAMAGE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -34,8 +34,6 @@ public class ItemManasteelSword extends SwordItem implements IManaUsingItem {
|
||||
|
||||
public ItemManasteelSword(IItemTier mat, Properties props) {
|
||||
super(mat, 3, -2.4F, props);
|
||||
addPropertyOverride(new ResourceLocation("botania", "elucidator"),
|
||||
(stack, worldIn, entityIn) -> "the elucidator".equals(stack.getDisplayName().getString().toLowerCase().trim()) ? 1 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-7
@@ -68,15 +68,9 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker
|
||||
public ItemTerraAxe(Properties props) {
|
||||
super(BotaniaAPI.instance().getTerrasteelItemTier(), props);
|
||||
MinecraftForge.EVENT_BUS.addListener(this::onTickEnd);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "terraaxe_on"), (stack, world, entity) -> {
|
||||
if (entity instanceof PlayerEntity && !shouldBreak((PlayerEntity) entity)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
}
|
||||
|
||||
private boolean shouldBreak(PlayerEntity player) {
|
||||
public static boolean shouldBreak(PlayerEntity player) {
|
||||
return !player.isSneaking() && !ItemTemperanceStone.hasTemperanceActive(player);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,8 +71,6 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ
|
||||
|
||||
public ItemTerraPick(Properties props) {
|
||||
super(BotaniaAPI.instance().getTerrasteelItemTier(), props, -2.8F);
|
||||
addPropertyOverride(new ResourceLocation("botania", TAG_TIPPED), (itemStack, world, entityLivingBase) -> isTipped(itemStack) ? 1 : 0);
|
||||
addPropertyOverride(new ResourceLocation("botania", TAG_ENABLED), (itemStack, world, entityLivingBase) -> isEnabled(itemStack) ? 1 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,8 +15,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.EndDimension;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ItemEnderAir extends Item {
|
||||
ItemStack stack = event.getItemStack();
|
||||
World world = event.getWorld();
|
||||
|
||||
if (!stack.isEmpty() && stack.getItem() == Items.GLASS_BOTTLE && world.getDimension() instanceof EndDimension) {
|
||||
if (!stack.isEmpty() && stack.getItem() == Items.GLASS_BOTTLE && world.func_234922_V_() == DimensionType.field_236001_e_) {
|
||||
List<AreaEffectCloudEntity> list = world.getEntitiesWithinAABB(AreaEffectCloudEntity.class,
|
||||
event.getPlayer().getBoundingBox().grow(3.5D),
|
||||
entity -> entity != null && entity.isAlive()
|
||||
|
||||
@@ -29,7 +29,6 @@ public class ItemInfiniteFruit extends ItemRelic implements IManaUsingItem {
|
||||
|
||||
public ItemInfiniteFruit(Properties props) {
|
||||
super(props);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "boot"), (stack, worldIn, entityIn) -> ItemInfiniteFruit.isBoot(stack) ? 1F : 0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,7 +73,7 @@ public class ItemInfiniteFruit extends ItemRelic implements IManaUsingItem {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isBoot(ItemStack stack) {
|
||||
public static boolean isBoot(ItemStack stack) {
|
||||
String name = stack.getDisplayName().getString().toLowerCase(Locale.ROOT).trim();
|
||||
return name.equals("das boot");
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ public class ItemTornadoRod extends Item implements IManaUsingItem, IAvatarWield
|
||||
|
||||
public ItemTornadoRod(Properties props) {
|
||||
super(props);
|
||||
addPropertyOverride(new ResourceLocation("botania", "flying"), (stack, world, living) -> isFlying(stack) ? 1 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -117,7 +116,7 @@ public class ItemTornadoRod extends Item implements IManaUsingItem, IAvatarWield
|
||||
return ActionResult.resultPass(stack);
|
||||
}
|
||||
|
||||
private boolean isFlying(ItemStack stack) {
|
||||
public static boolean isFlying(ItemStack stack) {
|
||||
return ItemNBTHelper.getBoolean(stack, TAG_FLYING, false);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user