mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
So many errors....
This commit is contained in:
parent
4b57b9fb45
commit
01ee39973a
8 changed files with 42 additions and 40 deletions
|
@ -1,6 +1,8 @@
|
||||||
package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||||
|
|
||||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.widget.button.Button;
|
import net.minecraft.client.gui.widget.button.Button;
|
||||||
|
@ -29,34 +31,32 @@ public class Buttons {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(MatrixStack matrices, int x, int y, float f) {
|
public void render(MatrixStack matrixStack, int x, int y, float f) {
|
||||||
/*
|
|
||||||
if (this.visible) {
|
if (this.visible) {
|
||||||
Minecraft.getInstance().getTextureManager().bind(this.resLoc);
|
Minecraft.getInstance().getTextureManager().bind(this.resLoc);
|
||||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.isHovered = x >= this.x && y >= this.y && x < this.x + this.width && y < this.y + this.height;
|
this.isHovered = x >= this.x && y >= this.y && x < this.x + this.width && y < this.y + this.height;
|
||||||
//int k = this.getHoverState(this.hovered);
|
int k = this.getYImage(this.isHovered);
|
||||||
GlStateManager._enableBlend();
|
GlStateManager._enableBlend();
|
||||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
GlStateManager.glBlendFuncSeparate(770, 771, 1, 0);
|
||||||
GlStateManager._blendFunc(770, 771);
|
GlStateManager._blendFunc(770, 771);
|
||||||
this.blit(matrices, this.x, this.y, this.smaller
|
this.blit(matrixStack, this.x, this.y, this.smaller
|
||||||
? 200
|
? 200
|
||||||
: 176, k * this.height, this.width, this.height);
|
: 176, k * this.height, this.width, this.height);
|
||||||
//this.mouseDragged(mc, x, y);
|
//this.mouseDragged(mc, x, y); // The heck was this doing here?
|
||||||
|
|
||||||
int color = 14737632;
|
int color = 14737632;
|
||||||
if (this.packedFGColour != 0) {
|
if (this.packedFGColor != 0) {
|
||||||
color = this.packedFGColour;
|
color = this.packedFGColor;
|
||||||
} else if (!this.enabled) {
|
} else if (!this.active) {
|
||||||
color = 10526880;
|
color = 10526880;
|
||||||
} else if (this.isHovered) {
|
} else if (this.isHovered) {
|
||||||
color = 16777120;
|
color = 16777120;
|
||||||
}
|
}
|
||||||
|
|
||||||
//this.drawCenteredString(Minecraft.getInstance().font, this.getMessage().getString(), this.x + this.width / 2, this.y + (this.height - 8) / 2, color);
|
drawCenteredString(matrixStack, Minecraft.getInstance().font, this.getMessage().getString(), this.x + this.width / 2, this.y + (this.height - 8) / 2, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,19 +69,19 @@ public class Buttons {
|
||||||
super(x, y, 8, 8, new StringTextComponent(""), Button::onPress);
|
super(x, y, 8, 8, new StringTextComponent(""), Button::onPress);
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Override
|
@Override
|
||||||
public void drawButton(Minecraft mc, int x, int y, float f) {
|
public void render(MatrixStack matrixStack, int x, int y, float f) {
|
||||||
// if (this.visible) {
|
if (this.visible) {
|
||||||
// mc.getTextureManager().bind(this.resLoc);
|
Minecraft.getInstance().getTextureManager().bind(this.resLoc);
|
||||||
// RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
// this.hovered = x >= this.x && y >= this.y && x < this.x + this.width && y < this.y + this.height;
|
this.isHovered = x >= this.x && y >= this.y && x < this.x + this.width && y < this.y + this.height;
|
||||||
// int k = this.getHoverState(this.hovered);
|
int k = this.getYImage(this.isHovered);
|
||||||
// GlStateManager._enableBlend();
|
GlStateManager._enableBlend();
|
||||||
// GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
GlStateManager.glBlendFuncSeparate(770, 771, 1, 0);
|
||||||
// GlStateManager._blendFunc(770, 771);
|
GlStateManager._blendFunc(770, 771);
|
||||||
// this.blit(matrices, this.x, this.y, 192, k * 8, 8, 8);
|
this.blit(matrixStack, this.x, this.y, 192, k * 8, 8, 8);
|
||||||
// this.mouseDragged(mc, x, y);
|
//this.mouseDragged(mc, x, y);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.client.gui.AbstractGui;
|
||||||
import net.minecraft.client.gui.widget.button.Button;
|
import net.minecraft.client.gui.widget.button.Button;
|
||||||
import net.minecraft.util.text.StringTextComponent;
|
import net.minecraft.util.text.StringTextComponent;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
import net.minecraft.util.text.TranslationTextComponent;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
|
@ -38,19 +39,19 @@ public class FilterSettingsGui extends AbstractGui {
|
||||||
public FilterSettingsGui(FilterSettings settings, int x, int y, List<Button> buttonList) {
|
public FilterSettingsGui(FilterSettings settings, int x, int y, List<Button> buttonList) {
|
||||||
this.theSettings = settings;
|
this.theSettings = settings;
|
||||||
|
|
||||||
this.whitelistButton = new Buttons.SmallerButton(this.theSettings.whitelistButtonId, x, y, true);
|
this.whitelistButton = new Buttons.SmallerButton( x, y, new TranslationTextComponent(""), true, Button::onPress); //TODO these need translation keys
|
||||||
buttonList.add(this.whitelistButton);
|
buttonList.add(this.whitelistButton);
|
||||||
y += 14;
|
y += 14;
|
||||||
this.metaButton = new Buttons.SmallerButton(this.theSettings.metaButtonId, x, y, true);
|
this.metaButton = new Buttons.SmallerButton( x, y, new TranslationTextComponent(""), true, Button::onPress); //TODO also button actions
|
||||||
buttonList.add(this.metaButton);
|
buttonList.add(this.metaButton);
|
||||||
y += 14;
|
y += 14;
|
||||||
this.nbtButton = new Buttons.SmallerButton(this.theSettings.nbtButtonId, x, y, true);
|
this.nbtButton = new Buttons.SmallerButton( x, y, new TranslationTextComponent(""), true, Button::onPress);
|
||||||
buttonList.add(this.nbtButton);
|
buttonList.add(this.nbtButton);
|
||||||
y += 14;
|
y += 14;
|
||||||
this.oredictButton = new Buttons.SmallerButton(this.theSettings.oredictButtonId, x, y, true);
|
this.oredictButton = new Buttons.SmallerButton( x, y, new TranslationTextComponent(""), true, Button::onPress);
|
||||||
buttonList.add(this.oredictButton);
|
buttonList.add(this.oredictButton);
|
||||||
y += 15;
|
y += 15;
|
||||||
this.modButton = new Buttons.SmallerButton(this.theSettings.modButtonId, x, y, true);
|
this.modButton = new Buttons.SmallerButton( x, y, new TranslationTextComponent(""), true, Button::onPress);
|
||||||
buttonList.add(this.modButton);
|
buttonList.add(this.modButton);
|
||||||
|
|
||||||
this.tick();
|
this.tick();
|
||||||
|
@ -103,7 +104,7 @@ public class FilterSettingsGui extends AbstractGui {
|
||||||
//list.addAll(mc.font.listFormattedStringToWidth(StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.respectModInfo"), 200));
|
//list.addAll(mc.font.listFormattedStringToWidth(StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.respectModInfo"), 200));
|
||||||
|
|
||||||
//GuiUtils.drawHoveringText(list, mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.font);
|
//GuiUtils.drawHoveringText(list, mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.font);
|
||||||
} else if (this.oredictButton.isMouseOver()) {
|
} else if (this.oredictButton.isMouseOver(mouseX, mouseY)) {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
list.add(TextFormatting.BOLD + (this.theSettings.respectOredict == 0
|
list.add(TextFormatting.BOLD + (this.theSettings.respectOredict == 0
|
||||||
? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.ignoreOredict")
|
? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.ignoreOredict")
|
||||||
|
|
|
@ -39,8 +39,8 @@ public class GuiCanolaPress extends GuiWtfMojang<ContainerCanolaPress> {
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
this.energy = new EnergyDisplay(this.leftPos + 42, this.topPos + 5, this.press.storage);
|
//this.energy = new EnergyDisplay(this.leftPos + 42, this.topPos + 5, this.press.storage);
|
||||||
this.fluid = new FluidDisplay(this.leftPos + 116, this.topPos + 5, this.press.tank);
|
//this.fluid = new FluidDisplay(this.leftPos + 116, this.topPos + 5, this.press.tank);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class GuiFluidCollector extends GuiWtfMojang<ContainerFluidCollector> {
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
this.fluid = new FluidDisplay(this.leftPos + 67, this.topPos + 5, this.collector.tank);
|
//this.fluid = new FluidDisplay(this.leftPos + 67, this.topPos + 5, this.collector.tank);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -43,8 +43,8 @@ public class GuiOilGenerator extends GuiWtfMojang<ContainerOilGenerator> {
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
this.energy = new EnergyDisplay(this.leftPos + 42, this.topPos + 5, this.generator.storage);
|
//this.energy = new EnergyDisplay(this.leftPos + 42, this.topPos + 5, this.generator.storage);
|
||||||
this.fluid = new FluidDisplay(this.leftPos + 116, this.topPos + 5, this.generator.tank);
|
//this.fluid = new FluidDisplay(this.leftPos + 116, this.topPos + 5, this.generator.tank);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -12,6 +12,6 @@ package de.ellpeck.actuallyadditions.mod.items.base;
|
||||||
|
|
||||||
public class ItemFoodBase extends ItemBase {
|
public class ItemFoodBase extends ItemBase {
|
||||||
public ItemFoodBase(int heal, float saturation, boolean wolfFood) {
|
public ItemFoodBase(int heal, float saturation, boolean wolfFood) {
|
||||||
super(heal, saturation, wolfFood);
|
//super(heal, saturation, wolfFood);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class ItemFoodSeed /*extends ItemSeedFood */{ //TODO what is this?!
|
||||||
this.maxUseDuration = maxUseDuration;
|
this.maxUseDuration = maxUseDuration;
|
||||||
|
|
||||||
if (plant instanceof BlockPlant) {
|
if (plant instanceof BlockPlant) {
|
||||||
((BlockPlant) plant).doStuff(this, returnItem, returnMeta);
|
//((BlockPlant) plant).doStuff(this, returnItem, returnMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,13 +14,14 @@ import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.Items;
|
import net.minecraft.item.Items;
|
||||||
import net.minecraft.item.Rarity;
|
import net.minecraft.item.Rarity;
|
||||||
|
import net.minecraft.potion.Effects;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public enum ThePotionRings {
|
public enum ThePotionRings {
|
||||||
|
|
||||||
SPEED(
|
SPEED(
|
||||||
MobEffects.SPEED.getName(),
|
Effects.SPEED.getName(),
|
||||||
8171462,
|
8171462,
|
||||||
MobEffects.SPEED,
|
MobEffects.SPEED,
|
||||||
0,
|
0,
|
||||||
|
@ -32,7 +33,7 @@ public enum ThePotionRings {
|
||||||
),
|
),
|
||||||
//Slowness
|
//Slowness
|
||||||
HASTE(
|
HASTE(
|
||||||
MobEffects.HASTE.getName(),
|
Effects.HASTE.getName(),
|
||||||
14270531,
|
14270531,
|
||||||
MobEffects.HASTE,
|
MobEffects.HASTE,
|
||||||
0,
|
0,
|
||||||
|
@ -156,7 +157,7 @@ public enum ThePotionRings {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.color = color;
|
this.color = color;
|
||||||
this.rarity = rarity;
|
this.rarity = rarity;
|
||||||
this.effectID = Potion.getIdFromPotion(effect);
|
this.effectID = Potion.byName(effect);
|
||||||
this.normalAmplifier = normalAmplifier;
|
this.normalAmplifier = normalAmplifier;
|
||||||
this.advancedAmplifier = advancedAmplifier;
|
this.advancedAmplifier = advancedAmplifier;
|
||||||
this.activeTime = activeTime;
|
this.activeTime = activeTime;
|
||||||
|
|
Loading…
Reference in a new issue