Attempt to fix 1.16.3 branch's issues on the repository

Added the original 'wayoftime' folder back, so see if that fixed the multiple folder issue.
This commit is contained in:
WayofTime 2020-10-29 15:50:03 -04:00
parent 6b4145a67c
commit 9fa68e86ae
224 changed files with 24047 additions and 0 deletions

View file

@ -0,0 +1,107 @@
package wayoftime.bloodmagic.client.screens;
import java.util.ArrayList;
import java.util.List;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.tile.TileAlchemicalReactionChamber;
import wayoftime.bloodmagic.tile.contailer.ContainerAlchemicalReactionChamber;
import wayoftime.bloodmagic.util.handler.event.ClientHandler;
public class ScreenAlchemicalReactionChamber extends ScreenBase<ContainerAlchemicalReactionChamber>
{
private static final ResourceLocation background = new ResourceLocation(BloodMagic.MODID, "textures/gui/arc_gui.png");
public TileAlchemicalReactionChamber tileARC;
public ScreenAlchemicalReactionChamber(ContainerAlchemicalReactionChamber container, PlayerInventory playerInventory, ITextComponent title)
{
super(container, playerInventory, title);
tileARC = container.tileARC;
this.xSize = 176;
this.ySize = 205;
}
@Override
public ResourceLocation getBackground()
{
return background;
}
// public
// public ScreenSoulForge(InventoryPlayer playerInventory, IInventory tileSoulForge)
// {
// super(new ContainerSoulForge(playerInventory, tileSoulForge));
// this.tileSoulForge = tileSoulForge;
// this.xSize = 176;
// this.ySize = 205;
// }
//
@Override
public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks)
{
super.render(stack, mouseX, mouseY, partialTicks);
List<ITextComponent> tooltip = new ArrayList<>();
// FluidTank inputTank = new FluidTank(FluidAttributes.BUCKET_VOLUME * 2);
// inputTank.fill(new FluidStack(Fluids.WATER, 1000), FluidAction.EXECUTE);
ClientHandler.handleGuiTank(stack, tileARC.inputTank, this.guiLeft + 8, this.guiTop
+ 40, 16, 63, 194, 1, 16, 63, mouseX, mouseY, background.toString(), tooltip);
ClientHandler.handleGuiTank(stack, tileARC.outputTank, this.guiLeft + 152, this.guiTop
+ 15, 16, 63, 194, 1, 16, 63, mouseX, mouseY, background.toString(), tooltip);
if (!tooltip.isEmpty())
GuiUtils.drawHoveringText(stack, tooltip, mouseX, mouseY, width, height, -1, font);
}
//
@Override
protected void drawGuiContainerForegroundLayer(MatrixStack stack, int mouseX, int mouseY)
{
this.font.func_243248_b(stack, new TranslationTextComponent("tile.bloodmagic.arc.name"), 8, 5, 4210752);
this.font.func_243248_b(stack, new TranslationTextComponent("container.inventory"), 8, 111, 4210752);
}
//
@Override
protected void drawGuiContainerBackgroundLayer(MatrixStack stack, float partialTicks, int mouseX, int mouseY)
{
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
getMinecraft().getTextureManager().bindTexture(background);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.blit(stack, i, j, 0, 0, this.xSize, this.ySize);
// FluidTank inputTank = new FluidTank(FluidAttributes.BUCKET_VOLUME * 2);
// inputTank.fill(new FluidStack(Fluids.WATER, 1000), FluidAction.EXECUTE);
ClientHandler.handleGuiTank(stack, tileARC.inputTank, this.guiLeft + 8, this.guiTop
+ 40, 16, 63, 194, 1, 16, 63, mouseX, mouseY, background.toString(), null);
ClientHandler.handleGuiTank(stack, tileARC.outputTank, this.guiLeft + 152, this.guiTop
+ 15, 16, 63, 194, 1, 16, 63, mouseX, mouseY, background.toString(), null);
// int l = this.getCookProgressScaled(90);
// this.blit(stack, i + 115, j + 14 + 90 - l, 176, 90 - l, 18, l);
}
////
// public int getCookProgressScaled(int scale)
// {
// double progress = ((TileSoulForge) tileSoulForge).getProgressForGui();
//// if (tileSoulForge != null)
//// {
//// System.out.println("Tile is NOT null");
//// }
//// double progress = ((float) this.container.data.get(0)) / ((float) this.container.data.get(1));
//// System.out.println(this.container.data.get(0));
// return (int) (progress * scale);
// }
}

View file

@ -0,0 +1,68 @@
package wayoftime.bloodmagic.client.screens;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Container;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import wayoftime.bloodmagic.BloodMagic;
public abstract class ScreenBase<T extends Container> extends ContainerScreen<T>
{
private static final ResourceLocation background = new ResourceLocation(BloodMagic.MODID, "textures/gui/soulforge.png");
protected final T container;
public ScreenBase(T container, PlayerInventory playerInventory, ITextComponent title)
{
super(container, playerInventory, title);
this.container = container;
}
public ResourceLocation getBackground()
{
return background;
}
@Override
public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks)
{
this.renderBackground(stack);
super.render(stack, mouseX, mouseY, partialTicks);
this.renderHoveredTooltip(stack, mouseX, mouseY); // @mcp: func_230459_a_ = renderHoveredToolTip
// if (mouseX > (guiLeft + 7) && mouseX < (guiLeft + 7) + 18 && mouseY > (guiTop + 7)
// && mouseY < (guiTop + 7) + 73)
// this.renderTooltip(stack, LanguageMap.getInstance().func_244260_a(Arrays.asList(new TranslationTextComponent("screen.diregoo.energy", MagicHelpers.withSuffix(this.container.getEnergy()), MagicHelpers.withSuffix(this.container.getMaxPower())))), mouseX, mouseY);
}
@Override
public void init()
{
super.init();
}
@Override
protected void drawGuiContainerBackgroundLayer(MatrixStack stack, float partialTicks, int mouseX, int mouseY)
{
// RenderSystem.color4f(1, 1, 1, 1);
// getMinecraft().getTextureManager().bindTexture(getBackground());
// this.blit(stack, guiLeft, guiTop, 0, 0, xSize, ySize);
// int maxEnergy = this.container.getMaxPower(), height = 70;
// if (maxEnergy > 0)
// {
// int remaining = (this.container.getEnergy() * height) / maxEnergy;
// this.blit(stack, guiLeft + 8, guiTop + 78 - remaining, 176, 84 - remaining, 16, remaining + 1);
// }
}
//
protected static TranslationTextComponent getTrans(String key, Object... args)
{
return new TranslationTextComponent(BloodMagic.MODID + "." + key, args);
}
}

View file

@ -0,0 +1,85 @@
package wayoftime.bloodmagic.client.screens;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.tile.TileSoulForge;
import wayoftime.bloodmagic.tile.contailer.ContainerSoulForge;
public class ScreenSoulForge extends ScreenBase<ContainerSoulForge>
{
private static final ResourceLocation background = new ResourceLocation(BloodMagic.MODID, "textures/gui/soulforge.png");
public IInventory tileSoulForge;
public ScreenSoulForge(ContainerSoulForge container, PlayerInventory playerInventory, ITextComponent title)
{
super(container, playerInventory, title);
tileSoulForge = container.tileForge;
this.xSize = 176;
this.ySize = 205;
}
@Override
public ResourceLocation getBackground()
{
return background;
}
// public
// public ScreenSoulForge(InventoryPlayer playerInventory, IInventory tileSoulForge)
// {
// super(new ContainerSoulForge(playerInventory, tileSoulForge));
// this.tileSoulForge = tileSoulForge;
// this.xSize = 176;
// this.ySize = 205;
// }
//
// @Override
// public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks)
// {
// this.drawDefaultBackground();
// super.drawScreen(mouseX, mouseY, partialTicks);
// this.renderHoveredToolTip(mouseX, mouseY);
// }
//
@Override
protected void drawGuiContainerForegroundLayer(MatrixStack stack, int mouseX, int mouseY)
{
this.font.func_243248_b(stack, new TranslationTextComponent("tile.bloodmagic.soulforge.name"), 8, 5, 4210752);
this.font.func_243248_b(stack, new TranslationTextComponent("container.inventory"), 8, 111, 4210752);
}
//
@Override
protected void drawGuiContainerBackgroundLayer(MatrixStack stack, float partialTicks, int mouseX, int mouseY)
{
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
getMinecraft().getTextureManager().bindTexture(background);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.blit(stack, i, j, 0, 0, this.xSize, this.ySize);
int l = this.getCookProgressScaled(90);
this.blit(stack, i + 115, j + 14 + 90 - l, 176, 90 - l, 18, l);
}
//
public int getCookProgressScaled(int scale)
{
double progress = ((TileSoulForge) tileSoulForge).getProgressForGui();
// if (tileSoulForge != null)
// {
// System.out.println("Tile is NOT null");
// }
// double progress = ((float) this.container.data.get(0)) / ((float) this.container.data.get(1));
// System.out.println(this.container.data.get(0));
return (int) (progress * scale);
}
}