mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
So many errors...
This commit is contained in:
parent
789570e25d
commit
4b57b9fb45
38 changed files with 281 additions and 363 deletions
|
@ -49,7 +49,6 @@ public class ActuallyAdditionsClient {
|
||||||
ScreenManager.register(ActuallyContainers.FLUID_COLLECTOR_CONTAINER.get(), GuiFluidCollector::new);
|
ScreenManager.register(ActuallyContainers.FLUID_COLLECTOR_CONTAINER.get(), GuiFluidCollector::new);
|
||||||
ScreenManager.register(ActuallyContainers.FURNACE_DOUBLE_CONTAINER.get(), GuiFurnaceDouble::new);
|
ScreenManager.register(ActuallyContainers.FURNACE_DOUBLE_CONTAINER.get(), GuiFurnaceDouble::new);
|
||||||
ScreenManager.register(ActuallyContainers.GRINDER_CONTAINER.get(), GuiGrinder::new);
|
ScreenManager.register(ActuallyContainers.GRINDER_CONTAINER.get(), GuiGrinder::new);
|
||||||
ScreenManager.register(ActuallyContainers.INPUTTER_CONTAINER.get(), GuiInputter::new);
|
|
||||||
ScreenManager.register(ActuallyContainers.LASER_RELAY_ITEM_WHITELIST_CONTAINER.get(), GuiLaserRelayItemWhitelist::new);
|
ScreenManager.register(ActuallyContainers.LASER_RELAY_ITEM_WHITELIST_CONTAINER.get(), GuiLaserRelayItemWhitelist::new);
|
||||||
ScreenManager.register(ActuallyContainers.MINER_CONTAINER.get(), GuiMiner::new);
|
ScreenManager.register(ActuallyContainers.MINER_CONTAINER.get(), GuiMiner::new);
|
||||||
ScreenManager.register(ActuallyContainers.OIL_GENERATOR_CONTAINER.get(), GuiOilGenerator::new);
|
ScreenManager.register(ActuallyContainers.OIL_GENERATOR_CONTAINER.get(), GuiOilGenerator::new);
|
||||||
|
|
|
@ -21,8 +21,6 @@ import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.client.MainWindow;
|
import net.minecraft.client.MainWindow;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
|
||||||
import net.minecraft.inventory.container.INamedContainerProvider;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
@ -39,7 +37,6 @@ import net.minecraft.world.IBlockReader;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
import net.minecraftforge.fml.network.NetworkHooks;
|
|
||||||
|
|
||||||
|
|
||||||
public class BlockPhantom extends BlockContainerBase implements IHudDisplay {
|
public class BlockPhantom extends BlockContainerBase implements IHudDisplay {
|
||||||
|
@ -107,14 +104,14 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay {
|
||||||
if (this.tryToggleRedstone(world, pos, player)) {
|
if (this.tryToggleRedstone(world, pos, player)) {
|
||||||
return ActionResultType.PASS;
|
return ActionResultType.PASS;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
TileEntity tile = world.getBlockEntity(pos);
|
TileEntity tile = world.getBlockEntity(pos);
|
||||||
if (tile instanceof IPhantomTile && ((IPhantomTile) tile).getGuiID() != -1) {
|
if (tile instanceof IPhantomTile && ((IPhantomTile) tile).getGuiID() != -1) {
|
||||||
NetworkHooks.openGui((ServerPlayerEntity) player, (INamedContainerProvider) tile, pos);
|
NetworkHooks.openGui((ServerPlayerEntity) player, (INamedContainerProvider) tile, pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return ActionResultType.PASS;
|
return ActionResultType.PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ public class ActuallyContainers {
|
||||||
public static final RegistryObject<ContainerType<ContainerFluidCollector>> FLUID_COLLECTOR_CONTAINER = CONTAINERS.register("fluid_collector_container", () -> IForgeContainerType.create(ContainerFluidCollector::fromNetwork));
|
public static final RegistryObject<ContainerType<ContainerFluidCollector>> FLUID_COLLECTOR_CONTAINER = CONTAINERS.register("fluid_collector_container", () -> IForgeContainerType.create(ContainerFluidCollector::fromNetwork));
|
||||||
public static final RegistryObject<ContainerType<ContainerFurnaceDouble>> FURNACE_DOUBLE_CONTAINER = CONTAINERS.register("furnace_double_container", () -> IForgeContainerType.create(ContainerFurnaceDouble::fromNetwork));
|
public static final RegistryObject<ContainerType<ContainerFurnaceDouble>> FURNACE_DOUBLE_CONTAINER = CONTAINERS.register("furnace_double_container", () -> IForgeContainerType.create(ContainerFurnaceDouble::fromNetwork));
|
||||||
public static final RegistryObject<ContainerType<ContainerGrinder>> GRINDER_CONTAINER = CONTAINERS.register("grinder_container", () -> IForgeContainerType.create(ContainerGrinder::fromNetwork));
|
public static final RegistryObject<ContainerType<ContainerGrinder>> GRINDER_CONTAINER = CONTAINERS.register("grinder_container", () -> IForgeContainerType.create(ContainerGrinder::fromNetwork));
|
||||||
public static final RegistryObject<ContainerType<ContainerInputter>> INPUTTER_CONTAINER = CONTAINERS.register("inputter_container", () -> IForgeContainerType.create(ContainerInputter::fromNetwork));
|
|
||||||
public static final RegistryObject<ContainerType<ContainerLaserRelayItemWhitelist>> LASER_RELAY_ITEM_WHITELIST_CONTAINER = CONTAINERS.register("laser_relay_item_whitelist_container", () -> IForgeContainerType.create(ContainerLaserRelayItemWhitelist::fromNetwork));
|
public static final RegistryObject<ContainerType<ContainerLaserRelayItemWhitelist>> LASER_RELAY_ITEM_WHITELIST_CONTAINER = CONTAINERS.register("laser_relay_item_whitelist_container", () -> IForgeContainerType.create(ContainerLaserRelayItemWhitelist::fromNetwork));
|
||||||
public static final RegistryObject<ContainerType<ContainerMiner>> MINER_CONTAINER = CONTAINERS.register("miner_container", () -> IForgeContainerType.create(ContainerMiner::fromNetwork));
|
public static final RegistryObject<ContainerType<ContainerMiner>> MINER_CONTAINER = CONTAINERS.register("miner_container", () -> IForgeContainerType.create(ContainerMiner::fromNetwork));
|
||||||
public static final RegistryObject<ContainerType<ContainerOilGenerator>> OIL_GENERATOR_CONTAINER = CONTAINERS.register("oil_generator_container", () -> IForgeContainerType.create(ContainerOilGenerator::fromNetwork));
|
public static final RegistryObject<ContainerType<ContainerOilGenerator>> OIL_GENERATOR_CONTAINER = CONTAINERS.register("oil_generator_container", () -> IForgeContainerType.create(ContainerOilGenerator::fromNetwork));
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
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;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
import net.minecraft.util.text.StringTextComponent;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
|
@ -31,30 +30,33 @@ public class Buttons {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(MatrixStack matrices, int x, int y, float f) {
|
public void render(MatrixStack matrices, 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.getHoverState(this.hovered);
|
||||||
GlStateManager._enableBlend();
|
GlStateManager._enableBlend();
|
||||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||||
GlStateManager._blendFunc(770, 771);
|
GlStateManager._blendFunc(770, 771);
|
||||||
this.blit(matrices, this.x, this.y, this.smaller
|
this.blit(matrices, 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);
|
||||||
|
|
||||||
int color = 14737632;
|
int color = 14737632;
|
||||||
if (this.packedFGColour != 0) {
|
if (this.packedFGColour != 0) {
|
||||||
color = this.packedFGColour;
|
color = this.packedFGColour;
|
||||||
} else if (!this.enabled) {
|
} else if (!this.enabled) {
|
||||||
color = 10526880;
|
color = 10526880;
|
||||||
} else if (this.hovered) {
|
} else if (this.isHovered) {
|
||||||
color = 16777120;
|
color = 16777120;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.drawCenteredString(mc.fontRenderer, this.displayString, this.x + this.width / 2, this.y + (this.height - 8) / 2, color);
|
//this.drawCenteredString(Minecraft.getInstance().font, this.getMessage().getString(), this.x + this.width / 2, this.y + (this.height - 8) / 2, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,22 +66,22 @@ public class Buttons {
|
||||||
public final ResourceLocation resLoc = AssetUtil.getGuiLocation("gui_inputter");
|
public final ResourceLocation resLoc = AssetUtil.getGuiLocation("gui_inputter");
|
||||||
|
|
||||||
public TinyButton(int id, int x, int y) {
|
public TinyButton(int id, int x, int y) {
|
||||||
super(id, x, y, 8, 8, "");
|
super(x, y, 8, 8, new StringTextComponent(""), Button::onPress);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
//@Override
|
||||||
public void drawButton(Minecraft mc, int x, int y, float f) {
|
public void drawButton(Minecraft mc, int x, int y, float f) {
|
||||||
if (this.visible) {
|
// if (this.visible) {
|
||||||
mc.getTextureManager().bind(this.resLoc);
|
// mc.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.hovered = 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.getHoverState(this.hovered);
|
||||||
GlStateManager._enableBlend();
|
// GlStateManager._enableBlend();
|
||||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
// GlStateManager.tryBlendFuncSeparate(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(matrices, this.x, this.y, 192, k * 8, 8, 8);
|
||||||
this.mouseDragged(mc, x, y);
|
// this.mouseDragged(mc, x, y);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,6 @@
|
||||||
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 de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.AbstractGui;
|
import net.minecraft.client.gui.AbstractGui;
|
||||||
import net.minecraft.fluid.Fluid;
|
import net.minecraft.fluid.Fluid;
|
||||||
|
@ -21,16 +18,11 @@ import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.capability.templates.FluidTank;
|
|
||||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
|
||||||
|
|
||||||
import java.text.NumberFormat;
|
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class FluidDisplay extends AbstractGui {
|
public class FluidDisplay extends AbstractGui {
|
||||||
|
|
||||||
private FluidTank fluidReference;
|
private FluidStack fluidReference;
|
||||||
private Fluid oldFluid;
|
private Fluid oldFluid;
|
||||||
|
|
||||||
private int x;
|
private int x;
|
||||||
|
@ -41,15 +33,15 @@ public class FluidDisplay extends AbstractGui {
|
||||||
|
|
||||||
private boolean drawTextNextTo;
|
private boolean drawTextNextTo;
|
||||||
|
|
||||||
public FluidDisplay(int x, int y, FluidTank fluidReference, boolean outline, boolean drawTextNextTo) {
|
public FluidDisplay(int x, int y, FluidStack fluidReference, boolean outline, boolean drawTextNextTo) {
|
||||||
this.setData(x, y, fluidReference, outline, drawTextNextTo);
|
this.setData(x, y, fluidReference, outline, drawTextNextTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FluidDisplay(int x, int y, FluidTank fluidReference) {
|
public FluidDisplay(int x, int y, FluidStack fluidReference) {
|
||||||
this(x, y, fluidReference, false, false);
|
this(x, y, fluidReference, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setData(int x, int y, FluidTank fluidReference, boolean outline, boolean drawTextNextTo) {
|
public void setData(int x, int y, FluidStack fluidReference, boolean outline, boolean drawTextNextTo) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.fluidReference = fluidReference;
|
this.fluidReference = fluidReference;
|
||||||
|
@ -58,7 +50,7 @@ public class FluidDisplay extends AbstractGui {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void draw(MatrixStack matrices) {
|
public void draw(MatrixStack matrices) {
|
||||||
Minecraft mc = Minecraft.getInstance();
|
/* Minecraft mc = Minecraft.getInstance();
|
||||||
mc.getTextureManager().bind(AssetUtil.GUI_INVENTORY_LOCATION);
|
mc.getTextureManager().bind(AssetUtil.GUI_INVENTORY_LOCATION);
|
||||||
|
|
||||||
int barX = this.x;
|
int barX = this.x;
|
||||||
|
@ -101,7 +93,7 @@ public class FluidDisplay extends AbstractGui {
|
||||||
|
|
||||||
if (this.drawTextNextTo) {
|
if (this.drawTextNextTo) {
|
||||||
this.drawString(mc.font, this.getOverlayText(), barX + 25, barY + 78, StringUtil.DECIMAL_COLOR_WHITE);
|
this.drawString(mc.font, this.getOverlayText(), barX + 25, barY + 78, StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(MatrixStack matrices, int mouseX, int mouseY) {
|
public void render(MatrixStack matrices, int mouseX, int mouseY) {
|
||||||
|
@ -111,16 +103,17 @@ public class FluidDisplay extends AbstractGui {
|
||||||
? 93
|
? 93
|
||||||
: 85)) {
|
: 85)) {
|
||||||
Minecraft mc = Minecraft.getInstance();
|
Minecraft mc = Minecraft.getInstance();
|
||||||
GuiUtils.drawHoveringText(Collections.singletonList(this.getOverlayText()), mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.font);
|
//GuiUtils.drawHoveringText(Collections.singletonList(this.getOverlayText()), mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.font);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getOverlayText() {
|
private String getOverlayText() {
|
||||||
NumberFormat format = NumberFormat.getInstance();
|
/* NumberFormat format = NumberFormat.getInstance();
|
||||||
FluidStack stack = this.fluidReference.getFluid();
|
FluidStack stack = this.fluidReference.getFluid();
|
||||||
String cap = format.format(this.fluidReference.getCapacity());
|
String cap = format.format(this.fluidReference.getCapacity());
|
||||||
return stack == null || stack.getFluid() == null
|
return stack == null || stack.getFluid() == null
|
||||||
? "0/" + cap + " mB"
|
? "0/" + cap + " mB"
|
||||||
: format.format(this.fluidReference.getFluidAmount()) + "/" + cap + " mB " + stack.getLocalizedName();
|
: format.format(this.fluidReference.getFluidAmount()) + "/" + cap + " mB " + stack.getLocalizedName();*/
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,23 +12,12 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||||
|
|
||||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerBag;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerBag;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.widget.button.Button;
|
import net.minecraft.client.gui.widget.button.Button;
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class GuiBag extends GuiWtfMojang<ContainerBag> {
|
public class GuiBag extends GuiWtfMojang<ContainerBag> {
|
||||||
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_bag");
|
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_bag");
|
||||||
|
@ -51,22 +40,22 @@ public class GuiBag extends GuiWtfMojang<ContainerBag> {
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
this.filter = new FilterSettingsGui(this.container.filter, this.leftPos + 138, this.topPos + 10, this.buttons);
|
// this.filter = new FilterSettingsGui(this.container.filter, this.leftPos + 138, this.topPos + 10, this.buttons);
|
||||||
|
//
|
||||||
this.buttonAutoInsert = new Button(0, this.leftPos - 21, this.topPos + 8, 20, 20, (this.container.autoInsert
|
// this.buttonAutoInsert = new Button(0, this.leftPos - 21, this.topPos + 8, 20, 20, (this.container.autoInsert
|
||||||
? TextFormatting.DARK_GREEN
|
// ? TextFormatting.DARK_GREEN
|
||||||
: TextFormatting.RED) + "I");
|
// : TextFormatting.RED) + "I");
|
||||||
this.addButton(this.buttonAutoInsert);
|
this.addButton(this.buttonAutoInsert);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
protected void actionPerformed(Button button) throws IOException {
|
// protected void actionPerformed(Button button) throws IOException {
|
||||||
CompoundNBT data = new CompoundNBT();
|
// CompoundNBT data = new CompoundNBT();
|
||||||
data.putInt("ButtonID", button.id);
|
// data.putInt("ButtonID", button.id);
|
||||||
data.putInt("PlayerID", Minecraft.getInstance().player.getId());
|
// data.putInt("PlayerID", Minecraft.getInstance().player.getId());
|
||||||
data.putInt("WorldID", Minecraft.getInstance().level.provider.getDimension());
|
// data.putInt("WorldID", Minecraft.getInstance().level.provider.getDimension());
|
||||||
PacketHandler.THE_NETWORK.sendToServer(new PacketClientToServer(data, PacketHandler.GUI_BUTTON_TO_CONTAINER_HANDLER));
|
// PacketHandler.THE_NETWORK.sendToServer(new PacketClientToServer(data, PacketHandler.GUI_BUTTON_TO_CONTAINER_HANDLER));
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
|
@ -78,19 +67,19 @@ public class GuiBag extends GuiWtfMojang<ContainerBag> {
|
||||||
// : TextFormatting.RED) + "I";
|
// : TextFormatting.RED) + "I";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/* @Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y) {
|
public void drawGuiContainerForegroundLayer(int x, int y) {
|
||||||
AssetUtil.displayNameString(this.font, this.imageWidth, -10, StringUtil.localize("container." + ActuallyAdditions.MODID + "." + (this.isVoid
|
AssetUtil.displayNameString(this.font, this.imageWidth, -10, StringUtil.localize("container." + ActuallyAdditions.MODID + "." + (this.isVoid
|
||||||
? "voidBag"
|
? "voidBag"
|
||||||
: "bag") + ".name"));
|
: "bag") + ".name"));
|
||||||
}
|
}*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
|
public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
|
||||||
super.render(stack, mouseX, mouseY, partialTicks);
|
super.render(stack, mouseX, mouseY, partialTicks);
|
||||||
this.filter.drawHover(mouseX, mouseY);
|
this.filter.drawHover(mouseX, mouseY);
|
||||||
|
|
||||||
if (this.buttonAutoInsert.isMouseOver()) {
|
/* if (this.buttonAutoInsert.isMouseOver()) {
|
||||||
List<String> text = new ArrayList<>();
|
List<String> text = new ArrayList<>();
|
||||||
text.add(TextFormatting.BOLD + "Auto-Insert " + (this.container.autoInsert
|
text.add(TextFormatting.BOLD + "Auto-Insert " + (this.container.autoInsert
|
||||||
? "On"
|
? "On"
|
||||||
|
@ -98,7 +87,7 @@ public class GuiBag extends GuiWtfMojang<ContainerBag> {
|
||||||
text.addAll(this.font.listFormattedStringToWidth("Turn this on to make items that get picked up automatically go into the bag.", 200));
|
text.addAll(this.font.listFormattedStringToWidth("Turn this on to make items that get picked up automatically go into the bag.", 200));
|
||||||
text.addAll(this.font.listFormattedStringToWidth(TextFormatting.GRAY + "" + TextFormatting.ITALIC + "Note that this WON'T work when you are holding the bag in your hand.", 200));
|
text.addAll(this.font.listFormattedStringToWidth(TextFormatting.GRAY + "" + TextFormatting.ITALIC + "Note that this WON'T work when you are holding the bag in your hand.", 200));
|
||||||
this.renderToolTip(stack, text, mouseX, mouseY, this.getMinecraft().font);
|
this.renderToolTip(stack, text, mouseX, mouseY, this.getMinecraft().font);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
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.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerBioReactor;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerBioReactor;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
|
@ -41,7 +42,7 @@ public class GuiBioReactor extends GuiWtfMojang<ContainerBioReactor> {
|
||||||
@Override
|
@Override
|
||||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
|
public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
|
||||||
super.render(matrices, mouseX, mouseY, partialTicks);
|
super.render(matrices, mouseX, mouseY, partialTicks);
|
||||||
this.energy.render(mouseX, mouseY);
|
//this.energy.render(mouseX, mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -68,6 +69,6 @@ public class GuiBioReactor extends GuiWtfMojang<ContainerBioReactor> {
|
||||||
drawCenteredString(matrices, this.font, this.tile.producePerTick + " " + I18n.get("actuallyadditions.cft"), this.leftPos + 87, this.topPos + 86, 0xFFFFFF);
|
drawCenteredString(matrices, this.font, this.tile.producePerTick + " " + I18n.get("actuallyadditions.cft"), this.leftPos + 87, this.topPos + 86, 0xFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.energy.draw();
|
//this.energy.draw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
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.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCanolaPress;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCanolaPress;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCanolaPress;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCanolaPress;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
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.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoalGenerator;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoalGenerator;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
|
|
|
@ -14,19 +14,15 @@ import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoffeeMachine;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoffeeMachine;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||||
import net.minecraft.client.gui.widget.button.Button;
|
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class GuiCoffeeMachine extends GuiWtfMojang<ContainerCoffeeMachine> {
|
public class GuiCoffeeMachine extends GuiWtfMojang<ContainerCoffeeMachine> {
|
||||||
|
|
||||||
|
@ -47,11 +43,11 @@ public class GuiCoffeeMachine extends GuiWtfMojang<ContainerCoffeeMachine> {
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
Button buttonOkay = new Button(this.leftPos + 60, this.topPos + 11, 58, 20, StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.ok"));
|
// Button buttonOkay = new Button(this.leftPos + 60, this.topPos + 11, 58, 20, StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.ok"));
|
||||||
this.addButton(buttonOkay);
|
// this.addButton(buttonOkay);
|
||||||
|
//
|
||||||
this.energy = new EnergyDisplay(this.leftPos + 16, this.topPos + 5, this.machine.storage);
|
// this.energy = new EnergyDisplay(this.leftPos + 16, this.topPos + 5, this.machine.storage);
|
||||||
this.fluid = new FluidDisplay(this.leftPos - 30, this.topPos + 1, this.machine.tank, true, false);
|
// this.fluid = new FluidDisplay(this.leftPos - 30, this.topPos + 1, this.machine.tank, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -60,7 +56,7 @@ public class GuiCoffeeMachine extends GuiWtfMojang<ContainerCoffeeMachine> {
|
||||||
|
|
||||||
String text2 = this.machine.coffeeCacheAmount + "/" + TileEntityCoffeeMachine.COFFEE_CACHE_MAX_AMOUNT + " " + StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.coffee");
|
String text2 = this.machine.coffeeCacheAmount + "/" + TileEntityCoffeeMachine.COFFEE_CACHE_MAX_AMOUNT + " " + StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.coffee");
|
||||||
if (x >= this.leftPos + 40 && y >= this.topPos + 25 && x <= this.leftPos + 49 && y <= this.topPos + 56) {
|
if (x >= this.leftPos + 40 && y >= this.topPos + 25 && x <= this.leftPos + 49 && y <= this.topPos + 56) {
|
||||||
this.drawHoveringText(Collections.singletonList(text2), x, y);
|
//this.drawHoveringText(Collections.singletonList(text2), x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.energy.render(matrices, x, y);
|
this.energy.render(matrices, x, y);
|
||||||
|
@ -99,8 +95,8 @@ public class GuiCoffeeMachine extends GuiWtfMojang<ContainerCoffeeMachine> {
|
||||||
this.fluid.draw(matrices);
|
this.fluid.draw(matrices);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void actionPerformed(Button button) {
|
// public void actionPerformed(Button button) {
|
||||||
PacketHandlerHelper.sendButtonPacket(this.machine, button.id);
|
// PacketHandlerHelper.sendButtonPacket(this.machine, button.id);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
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.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDirectionalBreaker;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDirectionalBreaker;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLongRangeBreaker;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLongRangeBreaker;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
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.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDrill;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDrill;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
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.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDropper;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDropper;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityDropper;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityDropper;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
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.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnergizer;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnergizer;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
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.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnervator;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnervator;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
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.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFarmer;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFarmer;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFarmer;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFarmer;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
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.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFeeder;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFeeder;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFeeder;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFeeder;
|
||||||
|
@ -22,8 +23,6 @@ import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class GuiFeeder extends GuiWtfMojang<ContainerFeeder> {
|
public class GuiFeeder extends GuiWtfMojang<ContainerFeeder> {
|
||||||
|
|
||||||
|
@ -46,7 +45,7 @@ public class GuiFeeder extends GuiWtfMojang<ContainerFeeder> {
|
||||||
: this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD
|
: this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD
|
||||||
? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.tooMany")
|
? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.tooMany")
|
||||||
: StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.notEnough")};
|
: StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.notEnough")};
|
||||||
this.drawHoveringText(Arrays.asList(array), x, y);
|
//this.drawHoveringText(Arrays.asList(array), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
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.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFermentingBarrel;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFermentingBarrel;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
|
@ -46,8 +47,8 @@ public class GuiFermentingBarrel extends GuiWtfMojang<ContainerFermentingBarrel>
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
this.input = new FluidDisplay(this.leftPos + 60, this.topPos + 5, this.press.canolaTank);
|
this.input = new FluidDisplay(this.leftPos + 60, this.topPos + 5, this.press.tanks.canolaTank);
|
||||||
this.output = new FluidDisplay(this.leftPos + 98, this.topPos + 5, this.press.oilTank);
|
this.output = new FluidDisplay(this.leftPos + 98, this.topPos + 5, this.press.tanks.oilTank);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -12,12 +12,9 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||||
|
|
||||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFurnaceDouble;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFurnaceDouble;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPoweredFurnace;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPoweredFurnace;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
|
||||||
import net.minecraft.client.gui.widget.button.Button;
|
import net.minecraft.client.gui.widget.button.Button;
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
@ -27,9 +24,6 @@ import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class GuiFurnaceDouble extends GuiWtfMojang<ContainerFurnaceDouble> {
|
public class GuiFurnaceDouble extends GuiWtfMojang<ContainerFurnaceDouble> {
|
||||||
|
|
||||||
|
@ -51,11 +45,11 @@ public class GuiFurnaceDouble extends GuiWtfMojang<ContainerFurnaceDouble> {
|
||||||
super.render(matrices, x, y, f);
|
super.render(matrices, x, y, f);
|
||||||
this.energy.render(matrices, x, y);
|
this.energy.render(matrices, x, y);
|
||||||
|
|
||||||
if (this.buttonAutoSplit.isMouseOver(x, y)) {
|
// if (this.buttonAutoSplit.isMouseOver(x, y)) {
|
||||||
this.drawHoveringText(Collections.singletonList(TextFormatting.BOLD + (this.tileFurnace.isAutoSplit
|
// this.drawHoveringText(Collections.singletonList(TextFormatting.BOLD + (this.tileFurnace.isAutoSplit
|
||||||
? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.on")
|
// ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.on")
|
||||||
: StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.off"))), x, y);
|
// : StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.off"))), x, y);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -63,8 +57,8 @@ public class GuiFurnaceDouble extends GuiWtfMojang<ContainerFurnaceDouble> {
|
||||||
super.init();
|
super.init();
|
||||||
this.energy = new EnergyDisplay(this.leftPos + 27, this.topPos + 5, this.tileFurnace.storage);
|
this.energy = new EnergyDisplay(this.leftPos + 27, this.topPos + 5, this.tileFurnace.storage);
|
||||||
|
|
||||||
this.buttonAutoSplit = new GuiInputter.SmallerButton(0, this.leftPos, this.topPos, "S");
|
// this.buttonAutoSplit = new GuiInputter.SmallerButton(0, this.leftPos, this.topPos, "S");
|
||||||
this.addButton(this.buttonAutoSplit);
|
// this.addButton(this.buttonAutoSplit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,12 +71,12 @@ public class GuiFurnaceDouble extends GuiWtfMojang<ContainerFurnaceDouble> {
|
||||||
: TextFormatting.RED));
|
: TextFormatting.RED));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
protected void actionPerformed(Button button) throws IOException {
|
// protected void actionPerformed(Button button) throws IOException {
|
||||||
if (button.id == 0) {
|
// if (button.id == 0) {
|
||||||
PacketHandlerHelper.sendButtonPacket(this.tileFurnace, button.id);
|
// PacketHandlerHelper.sendButtonPacket(this.tileFurnace, button.id);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderLabels(MatrixStack matrices, int x, int y) {
|
public void renderLabels(MatrixStack matrices, int x, int y) {
|
||||||
|
|
|
@ -12,12 +12,9 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||||
|
|
||||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerGrinder;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerGrinder;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCrusher;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCrusher;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
|
||||||
import net.minecraft.client.gui.widget.button.Button;
|
import net.minecraft.client.gui.widget.button.Button;
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
@ -27,9 +24,6 @@ import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class GuiGrinder extends GuiWtfMojang<ContainerGrinder> {
|
public class GuiGrinder extends GuiWtfMojang<ContainerGrinder> {
|
||||||
|
|
||||||
|
@ -56,18 +50,18 @@ public class GuiGrinder extends GuiWtfMojang<ContainerGrinder> {
|
||||||
? 13
|
? 13
|
||||||
: 42), this.topPos + 5, this.tileGrinder.storage);
|
: 42), this.topPos + 5, this.tileGrinder.storage);
|
||||||
|
|
||||||
if (this.isDouble) {
|
// if (this.isDouble) {
|
||||||
this.buttonAutoSplit = new GuiInputter.SmallerButton(0, this.leftPos - 10, this.topPos, "S");
|
// this.buttonAutoSplit = new GuiInputter.SmallerButton(0, this.leftPos - 10, this.topPos, "S");
|
||||||
this.addButton(this.buttonAutoSplit);
|
// this.addButton(this.buttonAutoSplit);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
protected void actionPerformed(Button button) throws IOException {
|
// protected void actionPerformed(Button button) throws IOException {
|
||||||
if (this.isDouble && button.id == 0) {
|
// if (this.isDouble && button.id == 0) {
|
||||||
PacketHandlerHelper.sendButtonPacket(this.tileGrinder, button.id);
|
// PacketHandlerHelper.sendButtonPacket(this.tileGrinder, button.id);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
|
@ -85,12 +79,12 @@ public class GuiGrinder extends GuiWtfMojang<ContainerGrinder> {
|
||||||
super.render(matrices, x, y, f);
|
super.render(matrices, x, y, f);
|
||||||
this.energy.render(matrices, x, y);
|
this.energy.render(matrices, x, y);
|
||||||
|
|
||||||
if (this.isDouble && this.buttonAutoSplit.isMouseOver()) {
|
// if (this.isDouble && this.buttonAutoSplit.isMouseOver()) {
|
||||||
|
//
|
||||||
this.drawHoveringText(Collections.singletonList(TextFormatting.BOLD + (this.tileGrinder.isAutoSplit
|
// this.drawHoveringText(Collections.singletonList(TextFormatting.BOLD + (this.tileGrinder.isAutoSplit
|
||||||
? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.on")
|
// ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.on")
|
||||||
: StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.off"))), x, y);
|
// : StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.off"))), x, y);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -14,7 +14,6 @@ import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerLaserRelayItemWhitelist;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerLaserRelayItemWhitelist;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemAdvanced;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemAdvanced;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||||
|
@ -22,13 +21,9 @@ import net.minecraft.client.gui.widget.button.Button;
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class GuiLaserRelayItemWhitelist extends GuiWtfMojang<ContainerLaserRelayItemWhitelist> {
|
public class GuiLaserRelayItemWhitelist extends GuiWtfMojang<ContainerLaserRelayItemWhitelist> {
|
||||||
|
|
||||||
|
@ -60,30 +55,30 @@ public class GuiLaserRelayItemWhitelist extends GuiWtfMojang<ContainerLaserRelay
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
this.leftFilter = new FilterSettingsGui(this.tile.leftFilter, this.leftPos + 3, this.topPos + 6, this.buttonList);
|
// this.leftFilter = new FilterSettingsGui(this.tile.leftFilter, this.leftPos + 3, this.topPos + 6, this.buttonList);
|
||||||
this.rightFilter = new FilterSettingsGui(this.tile.rightFilter, this.leftPos + 157, this.topPos + 6, this.buttonList);
|
// this.rightFilter = new FilterSettingsGui(this.tile.rightFilter, this.leftPos + 157, this.topPos + 6, this.buttonList);
|
||||||
|
//
|
||||||
this.buttonSmartWhitelistLeft = new Buttons.SmallerButton(2, this.leftPos + 3, this.topPos + 79, "S");
|
// this.buttonSmartWhitelistLeft = new Buttons.SmallerButton(2, this.leftPos + 3, this.topPos + 79, "S");
|
||||||
this.buttonSmartWhitelistRight = new Buttons.SmallerButton(3, this.leftPos + 157, this.topPos + 79, "S");
|
// this.buttonSmartWhitelistRight = new Buttons.SmallerButton(3, this.leftPos + 157, this.topPos + 79, "S");
|
||||||
this.addButton(this.buttonSmartWhitelistLeft);
|
// this.addButton(this.buttonSmartWhitelistLeft);
|
||||||
this.addButton(this.buttonSmartWhitelistRight);
|
// this.addButton(this.buttonSmartWhitelistRight);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(Button button) {
|
|
||||||
PacketHandlerHelper.sendButtonPacket(this.tile, button.id);
|
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void actionPerformed(Button button) {
|
||||||
|
// PacketHandlerHelper.sendButtonPacket(this.tile, button.id);
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(MatrixStack matrices, int x, int y, float f) {
|
public void render(MatrixStack matrices, int x, int y, float f) {
|
||||||
super.render(matrices, x, y, f);
|
super.render(matrices, x, y, f);
|
||||||
|
//
|
||||||
if (this.buttonSmartWhitelistLeft.isMouseOver() || this.buttonSmartWhitelistRight.isMouseOver()) {
|
// if (this.buttonSmartWhitelistLeft.isMouseOver() || this.buttonSmartWhitelistRight.isMouseOver()) {
|
||||||
List<String> list = new ArrayList<>();
|
// List<String> list = new ArrayList<>();
|
||||||
list.add(TextFormatting.BOLD + StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.smart"));
|
// list.add(TextFormatting.BOLD + StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.smart"));
|
||||||
list.addAll(this.font.listFormattedStringToWidth(StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.smartInfo"), 200));
|
// list.addAll(this.font.listFormattedStringToWidth(StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.smartInfo"), 200));
|
||||||
this.drawHoveringText(list, x, y);
|
// this.drawHoveringText(list, x, y);
|
||||||
}
|
// }
|
||||||
|
|
||||||
this.leftFilter.drawHover(x, y);
|
this.leftFilter.drawHover(x, y);
|
||||||
this.rightFilter.drawHover(x, y);
|
this.rightFilter.drawHover(x, y);
|
||||||
|
|
|
@ -13,11 +13,9 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerMiner;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerMiner;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityVerticalDigger;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityVerticalDigger;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||||
import net.minecraft.client.gui.widget.button.Button;
|
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
@ -42,13 +40,13 @@ public class GuiMiner extends GuiWtfMojang<ContainerMiner> {
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
Button buttonMode = new Button(this.leftPos + this.imageWidth / 2 - 51, this.topPos + 75, 50, 20, "Mode", button -> {
|
// Button buttonMode = new Button(this.leftPos + this.imageWidth / 2 - 51, this.topPos + 75, 50, 20, "Mode", button -> {
|
||||||
});
|
// });
|
||||||
this.addButton(buttonMode);
|
// this.addButton(buttonMode);
|
||||||
|
//
|
||||||
Button buttonReset = new Button(this.leftPos + this.imageWidth / 2 + 1, this.topPos + 75, 50, 20, "Reset", button -> {
|
// Button buttonReset = new Button(this.leftPos + this.imageWidth / 2 + 1, this.topPos + 75, 50, 20, "Reset", button -> {
|
||||||
});
|
// });
|
||||||
this.addButton(buttonReset);
|
// this.addButton(buttonReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -72,8 +70,8 @@ public class GuiMiner extends GuiWtfMojang<ContainerMiner> {
|
||||||
this.font.draw(matrices, mining, this.leftPos + this.imageWidth / 2 - this.font.width(mining) / 2, this.topPos + 8, StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
this.font.draw(matrices, mining, this.leftPos + this.imageWidth / 2 - this.font.width(mining) / 2, this.topPos + 8, StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void actionPerformed(Button button) {
|
// public void actionPerformed(Button button) {
|
||||||
PacketHandlerHelper.sendButtonPacket(this.miner, button.id);
|
// PacketHandlerHelper.sendButtonPacket(this.miner, button.id);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,24 +12,15 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||||
|
|
||||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerPhantomPlacer;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerPhantomPlacer;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
|
||||||
import net.minecraft.client.gui.widget.button.Button;
|
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class GuiPhantomPlacer extends GuiWtfMojang<ContainerPhantomPlacer> {
|
public class GuiPhantomPlacer extends GuiWtfMojang<ContainerPhantomPlacer> {
|
||||||
|
|
||||||
|
@ -47,44 +38,44 @@ public class GuiPhantomPlacer extends GuiWtfMojang<ContainerPhantomPlacer> {
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
if (!this.placer.isBreaker) {
|
// if (!this.placer.isBreaker) {
|
||||||
this.addButton(new Button(0, this.leftPos + 63, this.topPos + 75, 50, 20, this.getSide()));
|
// this.addButton(new Button(0, this.leftPos + 63, this.topPos + 75, 50, 20, this.getSide()));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
super.tick();
|
super.tick();
|
||||||
|
|
||||||
if (!this.placer.isBreaker) {
|
// if (!this.placer.isBreaker) {
|
||||||
this.buttonList.get(0).displayString = this.getSide();
|
// this.buttonList.get(0).displayString = this.getSide();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
|
public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
|
||||||
super.render(matrices, mouseX, mouseY, partialTicks);
|
super.render(matrices, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
if (!this.placer.isBreaker && this.buttonList.get(0).isMouseOver()) {
|
// if (!this.placer.isBreaker && this.buttonList.get(0).isMouseOver()) {
|
||||||
String loc = "info." + ActuallyAdditions.MODID + ".placer.sides";
|
// String loc = "info." + ActuallyAdditions.MODID + ".placer.sides";
|
||||||
|
//
|
||||||
List<String> textList = new ArrayList<>();
|
// List<String> textList = new ArrayList<>();
|
||||||
textList.add(TextFormatting.GOLD + StringUtil.localize(loc + ".1"));
|
// textList.add(TextFormatting.GOLD + StringUtil.localize(loc + ".1"));
|
||||||
textList.addAll(this.font.listFormattedStringToWidth(StringUtil.localize(loc + ".2"), 200));
|
// textList.addAll(this.font.listFormattedStringToWidth(StringUtil.localize(loc + ".2"), 200));
|
||||||
this.drawHoveringText(textList, mouseX, mouseY);
|
// this.drawHoveringText(textList, mouseX, mouseY);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
protected void actionPerformed(Button button) throws IOException {
|
// protected void actionPerformed(Button button) throws IOException {
|
||||||
if (!this.placer.isBreaker) {
|
// if (!this.placer.isBreaker) {
|
||||||
PacketHandlerHelper.sendButtonPacket(this.placer, button.id);
|
// PacketHandlerHelper.sendButtonPacket(this.placer, button.id);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
private String getSide() {
|
// private String getSide() {
|
||||||
return GuiInputter.SIDES[this.placer.side + 1];
|
// return GuiInputter.SIDES[this.placer.side + 1];
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderLabels(MatrixStack matrices, int x, int y) {
|
public void renderLabels(MatrixStack matrices, int x, int y) {
|
||||||
|
|
|
@ -13,10 +13,8 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerRangedCollector;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerRangedCollector;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import net.minecraft.client.gui.widget.button.Button;
|
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
@ -43,14 +41,14 @@ public class GuiRangedCollector extends GuiWtfMojang<ContainerRangedCollector> {
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
this.filter = new FilterSettingsGui(this.collector.filter, this.leftPos + 3, this.topPos + 6, this.buttonList);
|
//this.filter = new FilterSettingsGui(this.collector.filter, this.leftPos + 3, this.topPos + 6, this.buttonList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(MatrixStack matrices, int x, int y, float f) {
|
public void render(MatrixStack matrices, int x, int y, float f) {
|
||||||
super.render(matrices, x, y, f);
|
super.render(matrices, x, y, f);
|
||||||
|
|
||||||
this.filter.drawHover(matrices, x, y);
|
//this.filter.drawHover(matrices, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -76,8 +74,8 @@ public class GuiRangedCollector extends GuiWtfMojang<ContainerRangedCollector> {
|
||||||
this.blit(matrices, this.leftPos, this.topPos, 0, 0, 176, 86);
|
this.blit(matrices, this.leftPos, this.topPos, 0, 0, 176, 86);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void actionPerformed(Button button) {
|
// public void actionPerformed(Button button) {
|
||||||
PacketHandlerHelper.sendButtonPacket(this.collector, button.id);
|
// PacketHandlerHelper.sendButtonPacket(this.collector, button.id);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,16 +13,12 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerXPSolidifier;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerXPSolidifier;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.widget.button.Button;
|
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.text.StringTextComponent;
|
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
|
@ -43,35 +39,35 @@ public class GuiXPSolidifier extends GuiWtfMojang<ContainerXPSolidifier> {
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
|
//
|
||||||
Button buttonOne = new GuiInputter.SmallerButton(this.leftPos + 62, this.topPos + 44, new StringTextComponent("1"), btn -> {
|
// Button buttonOne = new GuiInputter.SmallerButton(this.leftPos + 62, this.topPos + 44, new StringTextComponent("1"), btn -> {
|
||||||
});
|
// });
|
||||||
Button buttonFive = new GuiInputter.SmallerButton(this.leftPos + 80, this.topPos + 44, new StringTextComponent("5"), btn -> {
|
// Button buttonFive = new GuiInputter.SmallerButton(this.leftPos + 80, this.topPos + 44, new StringTextComponent("5"), btn -> {
|
||||||
});
|
// });
|
||||||
Button buttonTen = new GuiInputter.SmallerButton(this.leftPos + 99, this.topPos + 44, new StringTextComponent("10"), btn -> {
|
// Button buttonTen = new GuiInputter.SmallerButton(this.leftPos + 99, this.topPos + 44, new StringTextComponent("10"), btn -> {
|
||||||
});
|
// });
|
||||||
Button buttonTwenty = new GuiInputter.SmallerButton(this.leftPos + 62, this.topPos + 61, new StringTextComponent("20"), btn -> {
|
// Button buttonTwenty = new GuiInputter.SmallerButton(this.leftPos + 62, this.topPos + 61, new StringTextComponent("20"), btn -> {
|
||||||
});
|
// });
|
||||||
Button buttonThirty = new GuiInputter.SmallerButton(this.leftPos + 80, this.topPos + 61, new StringTextComponent("30"), btn -> {
|
// Button buttonThirty = new GuiInputter.SmallerButton(this.leftPos + 80, this.topPos + 61, new StringTextComponent("30"), btn -> {
|
||||||
});
|
// });
|
||||||
Button buttonForty = new GuiInputter.SmallerButton(this.leftPos + 99, this.topPos + 61, new StringTextComponent("40"), btn -> {
|
// Button buttonForty = new GuiInputter.SmallerButton(this.leftPos + 99, this.topPos + 61, new StringTextComponent("40"), btn -> {
|
||||||
});
|
// });
|
||||||
Button buttonFifty = new GuiInputter.SmallerButton(this.leftPos + 62, this.topPos + 78, new StringTextComponent("50"), btn -> {
|
// Button buttonFifty = new GuiInputter.SmallerButton(this.leftPos + 62, this.topPos + 78, new StringTextComponent("50"), btn -> {
|
||||||
});
|
// });
|
||||||
Button buttonSixtyFour = new GuiInputter.SmallerButton(this.leftPos + 80, this.topPos + 78, new StringTextComponent("64"), btn -> {
|
// Button buttonSixtyFour = new GuiInputter.SmallerButton(this.leftPos + 80, this.topPos + 78, new StringTextComponent("64"), btn -> {
|
||||||
});
|
// });
|
||||||
Button buttonAll = new GuiInputter.SmallerButton(this.leftPos + 99, this.topPos + 78, new StringTextComponent("All"), btn -> {
|
// Button buttonAll = new GuiInputter.SmallerButton(this.leftPos + 99, this.topPos + 78, new StringTextComponent("All"), btn -> {
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
this.addButton(buttonOne);
|
// this.addButton(buttonOne);
|
||||||
this.addButton(buttonFive);
|
// this.addButton(buttonFive);
|
||||||
this.addButton(buttonTen);
|
// this.addButton(buttonTen);
|
||||||
this.addButton(buttonTwenty);
|
// this.addButton(buttonTwenty);
|
||||||
this.addButton(buttonThirty);
|
// this.addButton(buttonThirty);
|
||||||
this.addButton(buttonForty);
|
// this.addButton(buttonForty);
|
||||||
this.addButton(buttonFifty);
|
// this.addButton(buttonFifty);
|
||||||
this.addButton(buttonSixtyFour);
|
// this.addButton(buttonSixtyFour);
|
||||||
this.addButton(buttonAll);
|
// this.addButton(buttonAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -92,10 +88,10 @@ public class GuiXPSolidifier extends GuiWtfMojang<ContainerXPSolidifier> {
|
||||||
drawCenteredString(matrices, this.font, Integer.toString(this.solidifier.amount), this.leftPos + 88, this.topPos + 30, StringUtil.DECIMAL_COLOR_WHITE);
|
drawCenteredString(matrices, this.font, Integer.toString(this.solidifier.amount), this.leftPos + 88, this.topPos + 30, StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void actionPerformed(Button button) {
|
// public void actionPerformed(Button button) {
|
||||||
PacketHandlerHelper.sendButtonPacket(this.solidifier, button.id);
|
// PacketHandlerHelper.sendButtonPacket(this.solidifier, button.id);
|
||||||
|
//
|
||||||
this.solidifier.onButtonPressed(button.id, Minecraft.getInstance().player);
|
// this.solidifier.onButtonPressed(button.id, Minecraft.getInstance().player);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,17 +12,17 @@ package de.ellpeck.actuallyadditions.mod.items;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
import de.ellpeck.actuallyadditions.mod.items.base.ItemArmorAA;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.base.*;
|
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.items.base.ItemHoeAA;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.items.base.ItemSwordAA;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.lens.ItemLens;
|
import de.ellpeck.actuallyadditions.mod.items.lens.ItemLens;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.material.ArmorMaterials;
|
import de.ellpeck.actuallyadditions.mod.material.ArmorMaterials;
|
||||||
import de.ellpeck.actuallyadditions.mod.material.ToolMaterials;
|
import de.ellpeck.actuallyadditions.mod.material.ToolMaterials;
|
||||||
import net.minecraft.inventory.EquipmentSlotType;
|
import net.minecraft.inventory.EquipmentSlotType;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.ItemTier;
|
import net.minecraft.item.ItemTier;
|
||||||
import net.minecraft.item.Items;
|
|
||||||
import net.minecraftforge.fml.RegistryObject;
|
import net.minecraftforge.fml.RegistryObject;
|
||||||
import net.minecraftforge.registries.DeferredRegister;
|
import net.minecraftforge.registries.DeferredRegister;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraftforge.registries.ForgeRegistries;
|
||||||
|
@ -144,7 +144,7 @@ public final class ActuallyItems {
|
||||||
public static final RegistryObject<Item> COFFEE = ITEMS.register("coffee", ItemCoffee::new);
|
public static final RegistryObject<Item> COFFEE = ITEMS.register("coffee", ItemCoffee::new);
|
||||||
public static final RegistryObject<Item> PHANTOM_CONNECTOR = ITEMS.register("phantom_connector", ItemPhantomConnector::new);
|
public static final RegistryObject<Item> PHANTOM_CONNECTOR = ITEMS.register("phantom_connector", ItemPhantomConnector::new);
|
||||||
public static final RegistryObject<Item> RESONANT_RICE = ITEMS.register("resonant_rice", ItemResonantRice::new);
|
public static final RegistryObject<Item> RESONANT_RICE = ITEMS.register("resonant_rice", ItemResonantRice::new);
|
||||||
public static final RegistryObject<Item> FOOD = ITEMS.register("food", ItemFoods::new); //just... food?
|
public static final RegistryObject<Item> FOOD = ITEMS.register("food", ItemBase::new); //just... food? //TODO
|
||||||
public static final RegistryObject<Item> JAM = ITEMS.register("jam", ItemJams::new);
|
public static final RegistryObject<Item> JAM = ITEMS.register("jam", ItemJams::new);
|
||||||
public static final RegistryObject<Item> KNIFE = ITEMS.register("knife", ItemKnife::new);
|
public static final RegistryObject<Item> KNIFE = ITEMS.register("knife", ItemKnife::new);
|
||||||
public static final RegistryObject<Item> CRAFTER_ON_A_STICK = ITEMS.register("crafter_on_a_stick", ItemCrafterOnAStick::new);
|
public static final RegistryObject<Item> CRAFTER_ON_A_STICK = ITEMS.register("crafter_on_a_stick", ItemCrafterOnAStick::new);
|
||||||
|
@ -160,10 +160,10 @@ public final class ActuallyItems {
|
||||||
public static final RegistryObject<Item> HAIRY_BALL = ITEMS.register("hairy_ball", ItemHairBall::new);
|
public static final RegistryObject<Item> HAIRY_BALL = ITEMS.register("hairy_ball", ItemHairBall::new);
|
||||||
public static final RegistryObject<Item> COFFEE_BEANS = ITEMS.register("coffee_beans", ItemCoffeeBean::new);
|
public static final RegistryObject<Item> COFFEE_BEANS = ITEMS.register("coffee_beans", ItemCoffeeBean::new);
|
||||||
|
|
||||||
public static final RegistryObject<Item> RICE_SEED = ITEMS.register("rice_seed", () -> new ItemSeed("seedRice", ActuallyBlocks.RICE.get(), FOOD.get(), TheFoods.RICE.ordinal()));
|
public static final RegistryObject<Item> RICE_SEED = ITEMS.register("rice_seed", ItemBase::new); //() -> new ItemSeed("seedRice", ActuallyBlocks.RICE.get(), FOOD.get(), TheFoods.RICE.ordinal()));
|
||||||
public static final RegistryObject<Item> CANOLA_SEED = ITEMS.register("canola_seed", () -> new ItemFoodSeed("seedCanola", ActuallyBlocks.CANOLA, itemMisc, 0, 1, 0.01F, 10).setPotionEffect(new PotionEffect(MobEffects.NAUSEA, 1000, 0), 0.2F));
|
public static final RegistryObject<Item> CANOLA_SEED = ITEMS.register("canola_seed", ItemBase::new); //() -> new ItemFoodSeed("seedCanola", ActuallyBlocks.CANOLA, itemMisc, 0, 1, 0.01F, 10).setPotionEffect(new PotionEffect(MobEffects.NAUSEA, 1000, 0), 0.2F));
|
||||||
public static final RegistryObject<Item> FLAX_SEED = ITEMS.register("flax_seed", () -> new ItemSeed("seedFlax", ActuallyBlocks.FLAX, Items.STRING, 0));
|
public static final RegistryObject<Item> FLAX_SEED = ITEMS.register("flax_seed", ItemBase::new); //() -> new ItemSeed("seedFlax", ActuallyBlocks.FLAX, Items.STRING, 0));
|
||||||
public static final RegistryObject<Item> COFFEE_SEED = ITEMS.register("coffee_seed", () -> new ItemSeed("seedCoffeeBeans", ActuallyBlocks.COFFEE, COFFEE_BEANS, 0));
|
public static final RegistryObject<Item> COFFEE_SEED = ITEMS.register("coffee_seed", ItemBase::new); //() -> new ItemSeed("seedCoffeeBeans", ActuallyBlocks.COFFEE, COFFEE_BEANS, 0));
|
||||||
|
|
||||||
// TOOLS & ARMOR
|
// TOOLS & ARMOR
|
||||||
public static final RegistryObject<Item> HELM_QUARTZ = ITEMS.register("helm_quartz", () -> new ItemArmorAA(ArmorMaterials.QUARTZ, EquipmentSlotType.HEAD));
|
public static final RegistryObject<Item> HELM_QUARTZ = ITEMS.register("helm_quartz", () -> new ItemArmorAA(ArmorMaterials.QUARTZ, EquipmentSlotType.HEAD));
|
||||||
|
@ -173,7 +173,7 @@ public final class ActuallyItems {
|
||||||
|
|
||||||
public static final RegistryObject<Item> PICKAXE_QUARTZ = ITEMS.register("pickaxe_quartz", () -> new ItemPickaxeAA(ToolMaterials.BLACK_QUARTZ));
|
public static final RegistryObject<Item> PICKAXE_QUARTZ = ITEMS.register("pickaxe_quartz", () -> new ItemPickaxeAA(ToolMaterials.BLACK_QUARTZ));
|
||||||
public static final RegistryObject<Item> AXE_QUARTZ = ITEMS.register("axe_quartz", () -> new ItemAxeAA(ToolMaterials.BLACK_QUARTZ));
|
public static final RegistryObject<Item> AXE_QUARTZ = ITEMS.register("axe_quartz", () -> new ItemAxeAA(ToolMaterials.BLACK_QUARTZ));
|
||||||
public static final RegistryObject<Item> SHOVEL_QUARTZ = ITEMS.register("shovel_quartz", () -> new ItemShovelAA(ToolMaterials.BLACK_QUARTZ));
|
public static final RegistryObject<Item> SHOVEL_QUARTZ = ITEMS.register("shovel_quartz", ItemBase::new); //() -> new ItemShovelAA(ToolMaterials.BLACK_QUARTZ));
|
||||||
public static final RegistryObject<Item> SWORD_QUARTZ = ITEMS.register("sword_quartz", () -> new ItemSwordAA(ToolMaterials.BLACK_QUARTZ));
|
public static final RegistryObject<Item> SWORD_QUARTZ = ITEMS.register("sword_quartz", () -> new ItemSwordAA(ToolMaterials.BLACK_QUARTZ));
|
||||||
public static final RegistryObject<Item> HOE_QUARTZ = ITEMS.register("hoe_quartz", () -> new ItemHoeAA(ToolMaterials.BLACK_QUARTZ));
|
public static final RegistryObject<Item> HOE_QUARTZ = ITEMS.register("hoe_quartz", () -> new ItemHoeAA(ToolMaterials.BLACK_QUARTZ));
|
||||||
public static final RegistryObject<Item> WOODEN_PAXEL = ITEMS.register("wooden_paxel", () -> new AllInOneTool(ItemTier.WOOD));
|
public static final RegistryObject<Item> WOODEN_PAXEL = ITEMS.register("wooden_paxel", () -> new AllInOneTool(ItemTier.WOOD));
|
||||||
|
@ -186,7 +186,7 @@ public final class ActuallyItems {
|
||||||
|
|
||||||
public static final RegistryObject<Item> PICKAXE_CRYSTAL_RESTONIA = ITEMS.register("pickaxe_crystal_restonia", () -> new ItemPickaxeAA(ToolMaterials.RESTONIA));
|
public static final RegistryObject<Item> PICKAXE_CRYSTAL_RESTONIA = ITEMS.register("pickaxe_crystal_restonia", () -> new ItemPickaxeAA(ToolMaterials.RESTONIA));
|
||||||
public static final RegistryObject<Item> AXE_CRYSTAL_RESTONIA = ITEMS.register("axe_crystal_restonia", () -> new ItemAxeAA(ToolMaterials.RESTONIA));
|
public static final RegistryObject<Item> AXE_CRYSTAL_RESTONIA = ITEMS.register("axe_crystal_restonia", () -> new ItemAxeAA(ToolMaterials.RESTONIA));
|
||||||
public static final RegistryObject<Item> SHOVEL_CRYSTAL_RESTONIA = ITEMS.register("shovel_crystal_restonia", () -> new ItemShovelAA(ToolMaterials.RESTONIA));
|
public static final RegistryObject<Item> SHOVEL_CRYSTAL_RESTONIA = ITEMS.register("shovel_crystal_restonia", ItemBase::new); // () -> new ItemShovelAA(ToolMaterials.RESTONIA));
|
||||||
public static final RegistryObject<Item> SWORD_CRYSTAL_RESTONIA = ITEMS.register("sword_crystal_restonia", () -> new ItemSwordAA(ToolMaterials.RESTONIA));
|
public static final RegistryObject<Item> SWORD_CRYSTAL_RESTONIA = ITEMS.register("sword_crystal_restonia", () -> new ItemSwordAA(ToolMaterials.RESTONIA));
|
||||||
public static final RegistryObject<Item> HOE_CRYSTAL_RESTONIA = ITEMS.register("hoe_crystal_restonia", () -> new ItemHoeAA(ToolMaterials.RESTONIA));
|
public static final RegistryObject<Item> HOE_CRYSTAL_RESTONIA = ITEMS.register("hoe_crystal_restonia", () -> new ItemHoeAA(ToolMaterials.RESTONIA));
|
||||||
public static final RegistryObject<Item> HELM_CRYSTAL_RESTONIA = ITEMS.register("helm_crystal_restonia", () -> new ItemArmorAA(ArmorMaterials.RESTONIA, EquipmentSlotType.HEAD));
|
public static final RegistryObject<Item> HELM_CRYSTAL_RESTONIA = ITEMS.register("helm_crystal_restonia", () -> new ItemArmorAA(ArmorMaterials.RESTONIA, EquipmentSlotType.HEAD));
|
||||||
|
@ -197,7 +197,7 @@ public final class ActuallyItems {
|
||||||
|
|
||||||
public static final RegistryObject<Item> PICKAXE_CRYSTAL_PALIS = ITEMS.register("pickaxe_crystal_palis", () -> new ItemPickaxeAA(ToolMaterials.PALIS));
|
public static final RegistryObject<Item> PICKAXE_CRYSTAL_PALIS = ITEMS.register("pickaxe_crystal_palis", () -> new ItemPickaxeAA(ToolMaterials.PALIS));
|
||||||
public static final RegistryObject<Item> AXE_CRYSTAL_PALIS = ITEMS.register("axe_crystal_palis", () -> new ItemAxeAA(ToolMaterials.PALIS));
|
public static final RegistryObject<Item> AXE_CRYSTAL_PALIS = ITEMS.register("axe_crystal_palis", () -> new ItemAxeAA(ToolMaterials.PALIS));
|
||||||
public static final RegistryObject<Item> SHOVEL_CRYSTAL_PALIS = ITEMS.register("shovel_crystal_palis", () -> new ItemShovelAA(ToolMaterials.PALIS));
|
public static final RegistryObject<Item> SHOVEL_CRYSTAL_PALIS = ITEMS.register("shovel_crystal_palis", ItemBase::new); //() -> new ItemShovelAA(ToolMaterials.PALIS));
|
||||||
public static final RegistryObject<Item> SWORD_CRYSTAL_PALIS = ITEMS.register("sword_crystal_palis", () -> new ItemSwordAA(ToolMaterials.PALIS));
|
public static final RegistryObject<Item> SWORD_CRYSTAL_PALIS = ITEMS.register("sword_crystal_palis", () -> new ItemSwordAA(ToolMaterials.PALIS));
|
||||||
public static final RegistryObject<Item> HOE_CRYSTAL_PALIS = ITEMS.register("hoe_crystal_palis", () -> new ItemHoeAA(ToolMaterials.PALIS));
|
public static final RegistryObject<Item> HOE_CRYSTAL_PALIS = ITEMS.register("hoe_crystal_palis", () -> new ItemHoeAA(ToolMaterials.PALIS));
|
||||||
public static final RegistryObject<Item> HELM_CRYSTAL_PALIS = ITEMS.register("helm_crystal_palis", () -> new ItemArmorAA(ArmorMaterials.PALIS, EquipmentSlotType.HEAD));
|
public static final RegistryObject<Item> HELM_CRYSTAL_PALIS = ITEMS.register("helm_crystal_palis", () -> new ItemArmorAA(ArmorMaterials.PALIS, EquipmentSlotType.HEAD));
|
||||||
|
@ -208,7 +208,7 @@ public final class ActuallyItems {
|
||||||
|
|
||||||
public static final RegistryObject<Item> PICKAXE_CRYSTAL_DIAMATINE = ITEMS.register("pickaxe_crystal_diamatine", () -> new ItemPickaxeAA(ToolMaterials.DIAMATINE));
|
public static final RegistryObject<Item> PICKAXE_CRYSTAL_DIAMATINE = ITEMS.register("pickaxe_crystal_diamatine", () -> new ItemPickaxeAA(ToolMaterials.DIAMATINE));
|
||||||
public static final RegistryObject<Item> AXE_CRYSTAL_DIAMATINE = ITEMS.register("axe_crystal_diamatine", () -> new ItemAxeAA(ToolMaterials.DIAMATINE));
|
public static final RegistryObject<Item> AXE_CRYSTAL_DIAMATINE = ITEMS.register("axe_crystal_diamatine", () -> new ItemAxeAA(ToolMaterials.DIAMATINE));
|
||||||
public static final RegistryObject<Item> SHOVEL_CRYSTAL_DIAMATINE = ITEMS.register("shovel_crystal_diamatine", () -> new ItemShovelAA(ToolMaterials.DIAMATINE));
|
public static final RegistryObject<Item> SHOVEL_CRYSTAL_DIAMATINE = ITEMS.register("shovel_crystal_diamatine", ItemBase::new); //() -> new ItemShovelAA(ToolMaterials.DIAMATINE));
|
||||||
public static final RegistryObject<Item> SWORD_CRYSTAL_DIAMATINE = ITEMS.register("sword_crystal_diamatine", () -> new ItemSwordAA(ToolMaterials.DIAMATINE));
|
public static final RegistryObject<Item> SWORD_CRYSTAL_DIAMATINE = ITEMS.register("sword_crystal_diamatine", () -> new ItemSwordAA(ToolMaterials.DIAMATINE));
|
||||||
public static final RegistryObject<Item> HOE_CRYSTAL_DIAMATINE = ITEMS.register("hoe_crystal_diamatine", () -> new ItemHoeAA(ToolMaterials.DIAMATINE));
|
public static final RegistryObject<Item> HOE_CRYSTAL_DIAMATINE = ITEMS.register("hoe_crystal_diamatine", () -> new ItemHoeAA(ToolMaterials.DIAMATINE));
|
||||||
public static final RegistryObject<Item> HELM_CRYSTAL_DIAMATINE = ITEMS.register("helm_crystal_diamatine", () -> new ItemArmorAA(ArmorMaterials.DIAMATINE, EquipmentSlotType.HEAD));
|
public static final RegistryObject<Item> HELM_CRYSTAL_DIAMATINE = ITEMS.register("helm_crystal_diamatine", () -> new ItemArmorAA(ArmorMaterials.DIAMATINE, EquipmentSlotType.HEAD));
|
||||||
|
@ -219,7 +219,7 @@ public final class ActuallyItems {
|
||||||
|
|
||||||
public static final RegistryObject<Item> PICKAXE_CRYSTAL_VOID = ITEMS.register("pickaxe_crystal_void", () -> new ItemPickaxeAA(ToolMaterials.VOID));
|
public static final RegistryObject<Item> PICKAXE_CRYSTAL_VOID = ITEMS.register("pickaxe_crystal_void", () -> new ItemPickaxeAA(ToolMaterials.VOID));
|
||||||
public static final RegistryObject<Item> AXE_CRYSTAL_VOID = ITEMS.register("axe_crystal_void", () -> new ItemAxeAA(ToolMaterials.VOID));
|
public static final RegistryObject<Item> AXE_CRYSTAL_VOID = ITEMS.register("axe_crystal_void", () -> new ItemAxeAA(ToolMaterials.VOID));
|
||||||
public static final RegistryObject<Item> SHOVEL_CRYSTAL_VOID = ITEMS.register("shovel_crystal_void", () -> new ItemShovelAA(ToolMaterials.VOID));
|
public static final RegistryObject<Item> SHOVEL_CRYSTAL_VOID = ITEMS.register("shovel_crystal_void", ItemBase::new); // () -> new ItemShovelAA(ToolMaterials.VOID));
|
||||||
public static final RegistryObject<Item> SWORD_CRYSTAL_VOID = ITEMS.register("sword_crystal_void", () -> new ItemSwordAA(ToolMaterials.VOID));
|
public static final RegistryObject<Item> SWORD_CRYSTAL_VOID = ITEMS.register("sword_crystal_void", () -> new ItemSwordAA(ToolMaterials.VOID));
|
||||||
public static final RegistryObject<Item> HOE_CRYSTAL_VOID = ITEMS.register("hoe_crystal_void", () -> new ItemHoeAA(ToolMaterials.VOID));
|
public static final RegistryObject<Item> HOE_CRYSTAL_VOID = ITEMS.register("hoe_crystal_void", () -> new ItemHoeAA(ToolMaterials.VOID));
|
||||||
public static final RegistryObject<Item> HELM_CRYSTAL_VOID = ITEMS.register("helm_crystal_void", () -> new ItemArmorAA(ArmorMaterials.VOID, EquipmentSlotType.HEAD));
|
public static final RegistryObject<Item> HELM_CRYSTAL_VOID = ITEMS.register("helm_crystal_void", () -> new ItemArmorAA(ArmorMaterials.VOID, EquipmentSlotType.HEAD));
|
||||||
|
@ -230,7 +230,7 @@ public final class ActuallyItems {
|
||||||
|
|
||||||
public static final RegistryObject<Item> PICKAXE_CRYSTAL_EMERADIC = ITEMS.register("pickaxe_crystal_emeradic", () -> new ItemPickaxeAA(ToolMaterials.EMERADIC));
|
public static final RegistryObject<Item> PICKAXE_CRYSTAL_EMERADIC = ITEMS.register("pickaxe_crystal_emeradic", () -> new ItemPickaxeAA(ToolMaterials.EMERADIC));
|
||||||
public static final RegistryObject<Item> AXE_CRYSTAL_EMERADIC = ITEMS.register("axe_crystal_emeradic", () -> new ItemAxeAA(ToolMaterials.EMERADIC));
|
public static final RegistryObject<Item> AXE_CRYSTAL_EMERADIC = ITEMS.register("axe_crystal_emeradic", () -> new ItemAxeAA(ToolMaterials.EMERADIC));
|
||||||
public static final RegistryObject<Item> SHOVEL_CRYSTAL_EMERADIC = ITEMS.register("shovel_crystal_emeradic", () -> new ItemShovelAA(ToolMaterials.EMERADIC));
|
public static final RegistryObject<Item> SHOVEL_CRYSTAL_EMERADIC = ITEMS.register("shovel_crystal_emeradic", ItemBase::new); //() -> new ItemShovelAA(ToolMaterials.EMERADIC));
|
||||||
public static final RegistryObject<Item> SWORD_CRYSTAL_EMERADIC = ITEMS.register("sword_crystal_emeradic", () -> new ItemSwordAA(ToolMaterials.EMERADIC));
|
public static final RegistryObject<Item> SWORD_CRYSTAL_EMERADIC = ITEMS.register("sword_crystal_emeradic", () -> new ItemSwordAA(ToolMaterials.EMERADIC));
|
||||||
public static final RegistryObject<Item> HOE_CRYSTAL_EMERADIC = ITEMS.register("hoe_crystal_emeradic", () -> new ItemHoeAA(ToolMaterials.EMERADIC));
|
public static final RegistryObject<Item> HOE_CRYSTAL_EMERADIC = ITEMS.register("hoe_crystal_emeradic", () -> new ItemHoeAA(ToolMaterials.EMERADIC));
|
||||||
public static final RegistryObject<Item> HELM_CRYSTAL_EMERADIC = ITEMS.register("helm_crystal_emeradic", () -> new ItemArmorAA(ArmorMaterials.DIAMATINE, EquipmentSlotType.HEAD));
|
public static final RegistryObject<Item> HELM_CRYSTAL_EMERADIC = ITEMS.register("helm_crystal_emeradic", () -> new ItemArmorAA(ArmorMaterials.DIAMATINE, EquipmentSlotType.HEAD));
|
||||||
|
@ -241,7 +241,7 @@ public final class ActuallyItems {
|
||||||
|
|
||||||
public static final RegistryObject<Item> PICKAXE_CRYSTAL_ENORI = ITEMS.register("pickaxe_crystal_enori", () -> new ItemPickaxeAA(ToolMaterials.ENORI));
|
public static final RegistryObject<Item> PICKAXE_CRYSTAL_ENORI = ITEMS.register("pickaxe_crystal_enori", () -> new ItemPickaxeAA(ToolMaterials.ENORI));
|
||||||
public static final RegistryObject<Item> AXE_CRYSTAL_ENORI = ITEMS.register("axe_crystal_enori", () -> new ItemAxeAA(ToolMaterials.ENORI));
|
public static final RegistryObject<Item> AXE_CRYSTAL_ENORI = ITEMS.register("axe_crystal_enori", () -> new ItemAxeAA(ToolMaterials.ENORI));
|
||||||
public static final RegistryObject<Item> SHOVEL_CRYSTAL_ENORI = ITEMS.register("shovel_crystal_enori", () -> new ItemShovelAA(ToolMaterials.ENORI));
|
public static final RegistryObject<Item> SHOVEL_CRYSTAL_ENORI = ITEMS.register("shovel_crystal_enori", ItemBase::new); //() -> new ItemShovelAA(ToolMaterials.ENORI));
|
||||||
public static final RegistryObject<Item> SWORD_CRYSTAL_ENORI = ITEMS.register("sword_crystal_enori", () -> new ItemSwordAA(ToolMaterials.ENORI));
|
public static final RegistryObject<Item> SWORD_CRYSTAL_ENORI = ITEMS.register("sword_crystal_enori", () -> new ItemSwordAA(ToolMaterials.ENORI));
|
||||||
public static final RegistryObject<Item> HOE_CRYSTAL_ENORI = ITEMS.register("hoe_crystal_enori", () -> new ItemHoeAA(ToolMaterials.ENORI));
|
public static final RegistryObject<Item> HOE_CRYSTAL_ENORI = ITEMS.register("hoe_crystal_enori", () -> new ItemHoeAA(ToolMaterials.ENORI));
|
||||||
public static final RegistryObject<Item> HELM_CRYSTAL_ENORI = ITEMS.register("helm_crystal_enori", () -> new ItemArmorAA(ArmorMaterials.ENORI, EquipmentSlotType.HEAD));
|
public static final RegistryObject<Item> HELM_CRYSTAL_ENORI = ITEMS.register("helm_crystal_enori", () -> new ItemArmorAA(ArmorMaterials.ENORI, EquipmentSlotType.HEAD));
|
||||||
|
|
|
@ -15,39 +15,40 @@ import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.item.*;
|
||||||
import net.minecraft.item.IItemTier;
|
import net.minecraft.tags.ITag;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.util.ActionResultType;
|
||||||
import net.minecraft.item.Items;
|
|
||||||
import net.minecraft.util.Direction;
|
|
||||||
import net.minecraft.util.Hand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class ItemShovelAA extends ItemToolAA {
|
public class ItemShovelAA extends ItemToolAA {
|
||||||
|
|
||||||
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_LAYER, Blocks.SOUL_SAND, Blocks.GRASS_PATH);
|
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_BLOCK, Blocks.SOUL_SAND, Blocks.GRASS_PATH);
|
||||||
|
|
||||||
public ItemShovelAA(IItemTier material) {
|
public ItemShovelAA(float p_i48512_1_, float p_i48512_2_, IItemTier p_i48512_3_, Set<Block> p_i48512_4_, Properties p_i48512_5_, String name, ItemStack repairItem, ITag<Item> repairTag) {
|
||||||
super(1.5F, -3.0F, material, this.repairItem, unlocalizedName, this.rarity, EFFECTIVE_ON);
|
super(p_i48512_1_, p_i48512_2_, p_i48512_3_, p_i48512_4_, p_i48512_5_, name, repairItem, repairTag);
|
||||||
this.setHarvestLevel("shovel", material.getLevel());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public ItemShovelAA(IItemTier material) {
|
||||||
|
//// super(1.5F, -3.0F, material, this.repairItem, unlocalizedName, this.rarity, EFFECTIVE_ON);
|
||||||
|
//// this.setHarvestLevel("shovel", material.getLevel());
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCorrectToolForDrops(BlockState blockIn) {
|
public boolean isCorrectToolForDrops(BlockState blockIn) {
|
||||||
Block block = blockIn.getBlock();
|
Block block = blockIn.getBlock();
|
||||||
return block == Blocks.SNOW_LAYER || block == Blocks.SNOW;
|
return block == Blocks.SNOW_BLOCK || block == Blocks.SNOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public EnumActionResult onItemUse(PlayerEntity playerIn, World worldIn, BlockPos pos, Hand hand, Direction facing, float hitX, float hitY, float hitZ) {
|
public ActionResultType useOn(ItemUseContext useContext) {
|
||||||
return Items.IRON_SHOVEL.onItemUse(playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ);
|
return Items.IRON_SHOVEL.useOn(useContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
//@Override
|
||||||
public Set<String> getToolClasses(ItemStack stack) {
|
public Set<String> getToolClasses(ItemStack stack) {
|
||||||
return Collections.singleton("shovel");
|
return Collections.singleton("shovel");
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class LensColor extends Lens {
|
||||||
ItemStack returnStack = this.tryConvert(new ItemStack(block), hitState, hitBlock, tile);
|
ItemStack returnStack = this.tryConvert(new ItemStack(block), hitState, hitBlock, tile);
|
||||||
if (returnStack != null && returnStack.getItem() instanceof BlockItem) {
|
if (returnStack != null && returnStack.getItem() instanceof BlockItem) {
|
||||||
Block toPlace = Block.byItem(returnStack.getItem());
|
Block toPlace = Block.byItem(returnStack.getItem());
|
||||||
BlockState state2Place = toPlace.getStateForPlacement(tile.getWorldObject(), hitBlock, Direction.UP, 0, 0, 0, returnStack.getMetadata(), FakePlayerFactory.getMinecraft((ServerWorld) tile.getWorldObject()), Hand.MAIN_HAND);
|
BlockState state2Place = toPlace.getStateForPlacement(tile.getWorldObject(), hitBlock, Direction.UP, 0, 0, 0, FakePlayerFactory.getMinecraft((ServerWorld) tile.getWorldObject()), Hand.MAIN_HAND);
|
||||||
tile.getWorldObject().setBlock(hitBlock, state2Place, 2);
|
tile.getWorldObject().setBlock(hitBlock, state2Place, 2);
|
||||||
tile.extractEnergy(ENERGY_USE);
|
tile.extractEnergy(ENERGY_USE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,21 +15,15 @@ import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
|
||||||
import de.ellpeck.actuallyadditions.api.lens.Lens;
|
import de.ellpeck.actuallyadditions.api.lens.Lens;
|
||||||
import de.ellpeck.actuallyadditions.api.recipe.WeightedOre;
|
import de.ellpeck.actuallyadditions.api.recipe.WeightedOre;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
|
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues;
|
import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues;
|
||||||
import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
|
||||||
import net.minecraft.block.NetherrackBlock;
|
import net.minecraft.block.NetherrackBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Direction;
|
|
||||||
import net.minecraft.util.Hand;
|
|
||||||
import net.minecraft.util.WeightedRandom;
|
import net.minecraft.util.WeightedRandom;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
import net.minecraftforge.common.Tags;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -125,7 +119,7 @@ public class LensMining extends Lens {
|
||||||
|
|
||||||
List<WeightedOre> ores = null;
|
List<WeightedOre> ores = null;
|
||||||
Block hitBlock = hitState.getBlock();
|
Block hitBlock = hitState.getBlock();
|
||||||
if (hitBlock instanceof BlockStone) {
|
if (hitBlock.is(Tags.Blocks.STONE)) { //TODO maybe?
|
||||||
ores = ActuallyAdditionsAPI.STONE_ORES;
|
ores = ActuallyAdditionsAPI.STONE_ORES;
|
||||||
} else if (hitBlock instanceof NetherrackBlock) {
|
} else if (hitBlock instanceof NetherrackBlock) {
|
||||||
ores = ActuallyAdditionsAPI.NETHERRACK_ORES;
|
ores = ActuallyAdditionsAPI.NETHERRACK_ORES;
|
||||||
|
@ -139,7 +133,7 @@ public class LensMining extends Lens {
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
while (!found) {
|
while (!found) {
|
||||||
WeightedOre ore = WeightedRandom.getRandomItem(tile.getWorldObject().random, ores, totalWeight);
|
WeightedOre ore = WeightedRandom.getRandomItem(tile.getWorldObject().random, ores, totalWeight);
|
||||||
if (ore != null) {
|
/* if (ore != null) {
|
||||||
List<ItemStack> stacks = OreDictionary.getOres(ore.name, false);
|
List<ItemStack> stacks = OreDictionary.getOres(ore.name, false);
|
||||||
if (stacks != null && !stacks.isEmpty()) {
|
if (stacks != null && !stacks.isEmpty()) {
|
||||||
for (ItemStack aStack : stacks) {
|
for (ItemStack aStack : stacks) {
|
||||||
|
@ -154,19 +148,19 @@ public class LensMining extends Lens {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tile.getEnergy() >= adaptedUse) {
|
if (tile.getEnergy() >= adaptedUse) {
|
||||||
Block block = Block.byItem(stack.getItem());
|
Block block = Block.byItem(stack.getItem());
|
||||||
if (block != Blocks.AIR) {
|
/* if (block != Blocks.AIR) {
|
||||||
BlockState state = block.getStateForPlacement(tile.getWorldObject(), hitPos, Direction.UP, 0, 0, 0, stack.getMetadata(), FakePlayerFactory.getMinecraft((WorldServer) tile.getWorldObject()), Hand.MAIN_HAND);
|
BlockState state = block.getStateForPlacement(tile.getWorldObject(), hitPos, Direction.UP, 0, 0, 0, stack.getMetadata(), FakePlayerFactory.getMinecraft((WorldServer) tile.getWorldObject()), Hand.MAIN_HAND);
|
||||||
tile.getWorldObject().setBlock(hitPos, state, 2);
|
tile.getWorldObject().setBlock(hitPos, state, 2);
|
||||||
|
|
||||||
tile.getWorldObject().levelEvent(2001, hitPos, Block.getId(state));
|
tile.getWorldObject().levelEvent(2001, hitPos, Block.getId(state));
|
||||||
|
|
||||||
tile.extractEnergy(adaptedUse);
|
tile.extractEnergy(adaptedUse);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class CactusFarmerBehavior implements IFarmerBehavior {
|
||||||
BlockState upState = world.getBlockState(up);
|
BlockState upState = world.getBlockState(up);
|
||||||
if (upState.getBlock() == Blocks.CACTUS) {
|
if (upState.getBlock() == Blocks.CACTUS) {
|
||||||
NonNullList<ItemStack> drops = NonNullList.create();
|
NonNullList<ItemStack> drops = NonNullList.create();
|
||||||
upState.getBlock().getDrops(drops, world, up, upState, 0);
|
//upState.getBlock().getDrops(drops, world, up, upState, 0);
|
||||||
|
|
||||||
if (!drops.isEmpty()) {
|
if (!drops.isEmpty()) {
|
||||||
if (farmer.canAddToOutput(drops)) {
|
if (farmer.canAddToOutput(drops)) {
|
||||||
|
|
|
@ -97,7 +97,7 @@ public class DefaultFarmerBehavior implements IFarmerBehavior {
|
||||||
List<ItemStack> seeds = new ArrayList<>();
|
List<ItemStack> seeds = new ArrayList<>();
|
||||||
List<ItemStack> other = new ArrayList<>();
|
List<ItemStack> other = new ArrayList<>();
|
||||||
NonNullList<ItemStack> drops = NonNullList.create();
|
NonNullList<ItemStack> drops = NonNullList.create();
|
||||||
state.getBlock().getDrops(drops, world, pos, state, 0);
|
//state.getBlock().getDrops(drops, world, pos, state, 0);
|
||||||
for (ItemStack stack : drops) {
|
for (ItemStack stack : drops) {
|
||||||
if (this.getPlantableFromStack(stack) != null) {
|
if (this.getPlantableFromStack(stack) != null) {
|
||||||
seeds.add(stack);
|
seeds.add(stack);
|
||||||
|
@ -177,7 +177,7 @@ public class DefaultFarmerBehavior implements IFarmerBehavior {
|
||||||
if (!player.mayUseItemAt(pos.relative(Direction.UP), Direction.UP, itemstack)) {
|
if (!player.mayUseItemAt(pos.relative(Direction.UP), Direction.UP, itemstack)) {
|
||||||
return ActionResultType.FAIL;
|
return ActionResultType.FAIL;
|
||||||
} else {
|
} else {
|
||||||
int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(itemstack, player, world, pos);
|
/* int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(itemstack, player, world, pos);
|
||||||
if (hook != 0) {
|
if (hook != 0) {
|
||||||
return hook > 0
|
return hook > 0
|
||||||
? ActionResultType.SUCCESS
|
? ActionResultType.SUCCESS
|
||||||
|
@ -205,7 +205,7 @@ public class DefaultFarmerBehavior implements IFarmerBehavior {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return ActionResultType.PASS;
|
return ActionResultType.PASS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class MelonPumpkinFarmerBehavior implements IFarmerBehavior {
|
||||||
Block block = state.getBlock();
|
Block block = state.getBlock();
|
||||||
if (block == Blocks.PUMPKIN || block == Blocks.MELON) {
|
if (block == Blocks.PUMPKIN || block == Blocks.MELON) {
|
||||||
NonNullList<ItemStack> drops = NonNullList.create();
|
NonNullList<ItemStack> drops = NonNullList.create();
|
||||||
block.getDrops(drops, world, pos, state, 0);
|
//block.getDrops(drops, world, pos, state, 0);
|
||||||
if (!drops.isEmpty()) {
|
if (!drops.isEmpty()) {
|
||||||
if (farmer.canAddToOutput(drops)) {
|
if (farmer.canAddToOutput(drops)) {
|
||||||
world.levelEvent(2001, pos, Block.getId(state));
|
world.levelEvent(2001, pos, Block.getId(state));
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class NetherWartFarmerBehavior implements IFarmerBehavior {
|
||||||
if (state.getBlock() instanceof NetherWartBlock) {
|
if (state.getBlock() instanceof NetherWartBlock) {
|
||||||
if (state.getValue(BlockStateProperties.AGE_3) >= 3) {
|
if (state.getValue(BlockStateProperties.AGE_3) >= 3) {
|
||||||
NonNullList<ItemStack> drops = NonNullList.create();
|
NonNullList<ItemStack> drops = NonNullList.create();
|
||||||
state.getBlock().getDrops(drops, world, pos, state, 0);
|
//state.getBlock().getDrops(drops, world, pos, state, 0);
|
||||||
if (!drops.isEmpty()) {
|
if (!drops.isEmpty()) {
|
||||||
boolean toInput = farmer.canAddToSeeds(drops);
|
boolean toInput = farmer.canAddToSeeds(drops);
|
||||||
if (toInput || farmer.canAddToOutput(drops)) {
|
if (toInput || farmer.canAddToOutput(drops)) {
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class ReedFarmerBehavior implements IFarmerBehavior {
|
||||||
BlockState upState = world.getBlockState(up);
|
BlockState upState = world.getBlockState(up);
|
||||||
if (upState.getBlock() instanceof SugarCaneBlock) {
|
if (upState.getBlock() instanceof SugarCaneBlock) {
|
||||||
NonNullList<ItemStack> drops = NonNullList.create();
|
NonNullList<ItemStack> drops = NonNullList.create();
|
||||||
upState.getBlock().getDrops(drops, world, pos, state, 0);
|
//upState.getBlock().getDrops(drops, world, pos, state, 0);
|
||||||
|
|
||||||
if (!drops.isEmpty()) {
|
if (!drops.isEmpty()) {
|
||||||
if (farmer.canAddToOutput(drops)) {
|
if (farmer.canAddToOutput(drops)) {
|
||||||
|
|
|
@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
|
||||||
|
|
||||||
public class FilterSettings {
|
public class FilterSettings {
|
||||||
|
|
||||||
|
@ -86,46 +85,43 @@ public class FilterSettings {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oredict != 0) {
|
// if (oredict != 0) {
|
||||||
int[] firstIds = OreDictionary.getOreIDs(first);
|
// boolean firstEmpty = ArrayUtils.isEmpty(firstIds);
|
||||||
int[] secondIds = OreDictionary.getOreIDs(second);
|
// boolean secondEmpty = ArrayUtils.isEmpty(secondIds);
|
||||||
boolean firstEmpty = ArrayUtils.isEmpty(firstIds);
|
//
|
||||||
boolean secondEmpty = ArrayUtils.isEmpty(secondIds);
|
// //Both empty, meaning none has OreDict entries, so they are equal
|
||||||
|
// if (firstEmpty && secondEmpty) {
|
||||||
//Both empty, meaning none has OreDict entries, so they are equal
|
// return true;
|
||||||
if (firstEmpty && secondEmpty) {
|
// }
|
||||||
return true;
|
// //Only one empty, meaning they are not equal
|
||||||
}
|
// else if (firstEmpty || secondEmpty) {
|
||||||
//Only one empty, meaning they are not equal
|
// return false;
|
||||||
else if (firstEmpty || secondEmpty) {
|
// } else {
|
||||||
return false;
|
// for (int id : firstIds) {
|
||||||
} else {
|
// if (ArrayUtils.contains(secondIds, id)) {
|
||||||
for (int id : firstIds) {
|
// //Needs to match only one id, so return true on first match
|
||||||
if (ArrayUtils.contains(secondIds, id)) {
|
// if (oredict == 1) {
|
||||||
//Needs to match only one id, so return true on first match
|
// return true;
|
||||||
if (oredict == 1) {
|
// }
|
||||||
return true;
|
// }
|
||||||
}
|
// //Needs to match every id, so just return false when no match
|
||||||
}
|
// else if (oredict == 2) {
|
||||||
//Needs to match every id, so just return false when no match
|
// return false;
|
||||||
else if (oredict == 2) {
|
// }
|
||||||
return false;
|
//
|
||||||
}
|
// }
|
||||||
|
// //If oredict mode 1, this will fail because nothing matched
|
||||||
}
|
// //If oredict mode 2, this will mean nothing hasn't matched
|
||||||
//If oredict mode 1, this will fail because nothing matched
|
// return oredict == 2;
|
||||||
//If oredict mode 2, this will mean nothing hasn't matched
|
// }
|
||||||
return oredict == 2;
|
// }
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (firstItem != secondItem) {
|
if (firstItem != secondItem) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean metaFine = !meta || first.getItemDamage() == second.getItemDamage();
|
|
||||||
boolean nbtFine = !nbt || ItemStack.tagMatches(first, second);
|
boolean nbtFine = !nbt || ItemStack.tagMatches(first, second);
|
||||||
if (metaFine && nbtFine) {
|
if (nbtFine) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -139,11 +135,11 @@ public class FilterSettings {
|
||||||
compound.putBoolean("Mod", this.respectMod);
|
compound.putBoolean("Mod", this.respectMod);
|
||||||
compound.putInt("Oredict", this.respectOredict);
|
compound.putInt("Oredict", this.respectOredict);
|
||||||
TileEntityInventoryBase.saveSlots(this.filterInventory, compound);
|
TileEntityInventoryBase.saveSlots(this.filterInventory, compound);
|
||||||
tag.setTag(name, compound);
|
tag.put(name, compound);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readFromNBT(CompoundNBT tag, String name) {
|
public void readFromNBT(CompoundNBT tag, String name) {
|
||||||
CompoundNBT compound = tag.getCompoundTag(name);
|
CompoundNBT compound = tag.getCompound(name);
|
||||||
this.isWhitelist = compound.getBoolean("Whitelist");
|
this.isWhitelist = compound.getBoolean("Whitelist");
|
||||||
this.respectMeta = compound.getBoolean("Meta");
|
this.respectMeta = compound.getBoolean("Meta");
|
||||||
this.respectNBT = compound.getBoolean("NBT");
|
this.respectNBT = compound.getBoolean("NBT");
|
||||||
|
|
|
@ -15,7 +15,6 @@ import de.ellpeck.actuallyadditions.mod.crafting.CrushingRecipe;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerGrinder;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerGrinder;
|
||||||
import de.ellpeck.actuallyadditions.mod.misc.SoundHandler;
|
import de.ellpeck.actuallyadditions.mod.misc.SoundHandler;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
|
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
|
||||||
import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||||
|
@ -177,7 +176,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IAcceptor getAcceptor() {
|
public IAcceptor getAcceptor() {
|
||||||
return (slot, stack, automation) -> !automation || (slot == SLOT_INPUT_1 || slot == SLOT_INPUT_2) && CrusherRecipeRegistry.getRecipeFromInput(stack) != null;
|
return (slot, stack, automation) -> !automation || (slot == SLOT_INPUT_1 || slot == SLOT_INPUT_2); /*CrusherRecipeRegistry.getRecipeFromInput(stack) != null*/ //TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
/*
|
|
||||||
* This file ("TileEntityInputterAdvanced.java") is part of the Actually Additions mod for Minecraft.
|
|
||||||
* It is created and owned by Ellpeck and distributed
|
|
||||||
* under the Actually Additions License to be found at
|
|
||||||
* http://ellpeck.de/actaddlicense
|
|
||||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
||||||
*
|
|
||||||
* © 2015-2017 Ellpeck
|
|
||||||
*/
|
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
|
||||||
|
|
||||||
public class TileEntityInputterAdvanced extends TileEntityInputter {
|
|
||||||
|
|
||||||
public TileEntityInputterAdvanced() {
|
|
||||||
super(ActuallyTiles.INPUTTERADVANCED_TILE.get(), 1);
|
|
||||||
this.isAdvanced = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -30,8 +30,6 @@ import net.minecraftforge.common.util.LazyOptional;
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
|
||||||
|
|
||||||
public abstract class TileEntityPhantomface extends TileEntityInventoryBase implements IPhantomTile {
|
public abstract class TileEntityPhantomface extends TileEntityInventoryBase implements IPhantomTile {
|
||||||
public static final int RANGE = 16;
|
public static final int RANGE = 16;
|
||||||
public BlockPos boundPosition;
|
public BlockPos boundPosition;
|
||||||
|
@ -176,7 +174,7 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
|
||||||
this.boundPosition = pos;
|
this.boundPosition = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
//@Override
|
||||||
public int getGuiID() {
|
public int getGuiID() {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue