1147 - Initial auto mappings pass

This commit is contained in:
modmuss50 2019-05-26 12:37:59 +01:00
parent 48198dbcb3
commit 4e03ac893c
291 changed files with 3335 additions and 3504 deletions

View file

@ -24,20 +24,20 @@
package techreborn.client;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import techreborn.init.TRContent;
public class ClientEventHandler {
@SubscribeEvent
public static void renderPlayer(RenderPlayerEvent.Pre event) {
EntityPlayer player = event.getEntityPlayer();
Item chestslot = !player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty()
? player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() : null;
PlayerEntity player = event.getEntityPlayer();
Item chestslot = !player.getEquippedStack(EquipmentSlot.CHEST).isEmpty()
? player.getEquippedStack(EquipmentSlot.CHEST).getItem() : null;
if (chestslot != null && chestslot == TRContent.CLOAKING_DEVICE) {
event.setCanceled(true);
}

View file

@ -24,24 +24,23 @@
package techreborn.client;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.ContainerScreen;
import net.minecraft.container.Container;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.IInteractionObject;
import net.minecraft.world.World;
import net.minecraftforge.fml.ExtensionPoint;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.network.FMLPlayMessages;
import net.minecraftforge.fml.network.NetworkHooks;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.client.containerBuilder.IContainerProvider;
import techreborn.client.container.ContainerDestructoPack;
@ -89,7 +88,7 @@ public enum EGui implements IMachineGuiHandler {
DESTRUCTOPACK(false),
DIESEL_GENERATOR(true),
DIGITAL_CHEST(true),
DISTILLATION_TOWER(true),
EnvTypeILLATION_TOWER(true),
ELECTRIC_FURNACE(true),
EXTRACTOR(true),
FUSION_CONTROLLER(true),
@ -129,11 +128,11 @@ public enum EGui implements IMachineGuiHandler {
ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.GUIFACTORY, ()-> EGui::getClientGuiElement);
}
public static GuiContainer getClientGuiElement(FMLPlayMessages.OpenContainer msg) {
public static ContainerScreen getClientGuiElement(FMLPlayMessages.OpenContainer msg) {
EGui gui = byID(msg.getId());
EntityPlayer player = Minecraft.getInstance().player;
PlayerEntity player = MinecraftClient.getInstance().player;
BlockPos pos = msg.getAdditionalData().readBlockPos();
TileEntity tile = player.world.getTileEntity(pos);
BlockEntity tile = player.world.getBlockEntity(pos);
switch (gui) {
case AESU:
@ -216,8 +215,8 @@ public enum EGui implements IMachineGuiHandler {
return new GuiAutoCrafting(player, (TileAutoCraftingTable) tile);
case PLASMA_GENERATOR:
return new GuiPlasmaGenerator(player, (TilePlasmaGenerator) tile);
case DISTILLATION_TOWER:
return new GuiDistillationTower(player, (TileDistillationTower) tile);
case EnvTypeILLATION_TOWER:
return new GuiEnvTypeillationTower(player, (TileEnvTypeillationTower) tile);
case FLUID_REPLICATOR:
return new GuiFluidReplicator(player, (TileFluidReplicator) tile);
default:
@ -226,7 +225,7 @@ public enum EGui implements IMachineGuiHandler {
}
}
public static EGui byID(ResourceLocation resourceLocation){
public static EGui byID(Identifier resourceLocation){
return Arrays.stream(values())
.filter(eGui -> eGui.name().toLowerCase().equals(resourceLocation.getPath()))
.findFirst()
@ -234,13 +233,13 @@ public enum EGui implements IMachineGuiHandler {
}
@Override
public void open(EntityPlayer player, BlockPos pos, World world) {
if(!world.isRemote){
public void open(PlayerEntity player, BlockPos pos, World world) {
if(!world.isClient){
EGui gui = this;
NetworkHooks.openGui((EntityPlayerMP) player, new IInteractionObject() {
NetworkHooks.openGui((ServerPlayerEntity) player, new IInteractionObject() {
@Override
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) {
TileEntity tileEntity = playerIn.world.getTileEntity(pos);
public Container createContainer(PlayerInventory playerInventory, PlayerEntity playerIn) {
BlockEntity tileEntity = playerIn.world.getBlockEntity(pos);
if (tileEntity instanceof IContainerProvider) {
return ((IContainerProvider) tileEntity).createContainer(player);
}
@ -253,8 +252,8 @@ public enum EGui implements IMachineGuiHandler {
}
@Override
public ITextComponent getName() {
return new TextComponentString(getGuiID());
public Component getName() {
return new TextComponent(getGuiID());
}
@Override
@ -264,7 +263,7 @@ public enum EGui implements IMachineGuiHandler {
@Nullable
@Override
public ITextComponent getCustomName() {
public Component getCustomName() {
return null;
}
}, packetBuffer -> packetBuffer.writeBlockPos(pos));

View file

@ -24,11 +24,11 @@
package techreborn.client;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;
import reborncore.client.containerBuilder.IContainerProvider;
import techreborn.client.container.ContainerDestructoPack;
import techreborn.client.gui.*;
@ -58,11 +58,11 @@ import techreborn.tiles.storage.lesu.TileLapotronicSU;
public class GuiHandler implements IGuiHandler {
@Override
public Object getServerGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
public Object getServerGuiElement(final int ID, final PlayerEntity player, final World world, final int x,
final int y, final int z) {
final EGui gui = EGui.values()[ID];
final TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
final BlockEntity tile = world.getBlockEntity(new BlockPos(x, y, z));
if (gui.useContainerBuilder() && tile != null)
return ((IContainerProvider) tile).createContainer(player);
@ -77,10 +77,10 @@ public class GuiHandler implements IGuiHandler {
}
@Override
public Object getClientGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
public Object getClientGuiElement(final int ID, final PlayerEntity player, final World world, final int x,
final int y, final int z) {
final EGui gui = EGui.values()[ID];
final TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
final BlockEntity tile = world.getBlockEntity(new BlockPos(x, y, z));
switch (gui) {
case AESU:
@ -163,8 +163,8 @@ public class GuiHandler implements IGuiHandler {
return new GuiAutoCrafting(player, (TileAutoCraftingTable) tile);
case PLASMA_GENERATOR:
return new GuiPlasmaGenerator(player, (TilePlasmaGenerator) tile);
case DISTILLATION_TOWER:
return new GuiDistillationTower(player, (TileDistillationTower) tile);
case EnvTypeILLATION_TOWER:
return new GuiEnvTypeillationTower(player, (TileEnvTypeillationTower) tile);
case MANUAL:
return new GuiManual(player);
case FLUID_REPLICATOR:

View file

@ -24,8 +24,8 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.container.Slot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import reborncore.client.gui.slots.SlotFilteredVoid;
import reborncore.common.container.RebornContainer;
@ -34,10 +34,10 @@ import techreborn.init.TRContent;
public class ContainerDestructoPack extends RebornContainer {
private EntityPlayer player;
private PlayerEntity player;
private Inventory<?> inv;
public ContainerDestructoPack(EntityPlayer player) {
public ContainerDestructoPack(PlayerEntity player) {
super(null);
this.player = player;
inv = new Inventory<>(1, "destructopack", 64, null);
@ -45,7 +45,7 @@ public class ContainerDestructoPack extends RebornContainer {
}
@Override
public boolean canInteractWith(EntityPlayer arg0) {
public boolean canUse(PlayerEntity arg0) {
return true;
}

View file

@ -24,10 +24,10 @@
package techreborn.client.container.builder.slot;
import net.minecraft.init.Items;
import net.minecraft.block.entity.FurnaceBlockEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraftforge.items.IItemHandler;
import net.minecraft.item.Items;
import reborncore.client.gui.slots.BaseSlot;
public class FurnaceFuelSlot extends BaseSlot {
@ -37,15 +37,15 @@ public class FurnaceFuelSlot extends BaseSlot {
}
@Override
public boolean isItemValid(ItemStack stack)
public boolean canInsert(ItemStack stack)
{
return TileEntityFurnace.isItemFuel(stack) || isBucket(stack);
return FurnaceBlockEntity.isItemFuel(stack) || isBucket(stack);
}
@Override
public int getItemStackLimit(ItemStack stack)
public int getMaxStackAmount(ItemStack stack)
{
return isBucket(stack) ? 1 : super.getItemStackLimit(stack);
return isBucket(stack) ? 1 : super.getMaxStackAmount(stack);
}
public static boolean isBucket(ItemStack stack)

View file

@ -25,7 +25,7 @@
package techreborn.client.gui;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.builder.widget.GuiButtonExtended;
import reborncore.client.gui.builder.widget.GuiButtonUpDown;
@ -38,14 +38,14 @@ public class GuiAESU extends GuiBase {
TileAdjustableSU tile;
public GuiAESU(final EntityPlayer player, final TileAdjustableSU aesu) {
public GuiAESU(final PlayerEntity player, final TileAdjustableSU aesu) {
super(player, aesu, aesu.createContainer(player));
this.tile = aesu;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
this.drawSlot(62, 45, layer);
@ -56,8 +56,8 @@ public class GuiAESU extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
if(GuiBase.slotConfigType == SlotConfigType.NONE){

View file

@ -24,56 +24,56 @@
package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.ContainerScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Identifier;
import techreborn.tiles.machine.iron.TileIronAlloyFurnace;
public class GuiAlloyFurnace extends GuiContainer {
public class GuiAlloyFurnace extends ContainerScreen {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
private static final Identifier texture = new Identifier("techreborn",
"textures/gui/alloy_furnace.png");
TileIronAlloyFurnace alloyfurnace;
public GuiAlloyFurnace(final EntityPlayer player, final TileIronAlloyFurnace alloyFurnace) {
public GuiAlloyFurnace(final PlayerEntity player, final TileIronAlloyFurnace alloyFurnace) {
super(alloyFurnace.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.containerWidth = 176;
this.containerHeight = 167;
this.alloyfurnace = alloyFurnace;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) {
protected void drawBackground(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) {
this.drawDefaultBackground();
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(GuiAlloyFurnace.texture);
final int k = (this.width - this.xSize) / 2;
final int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
final int k = (this.width - this.containerWidth) / 2;
final int l = (this.height - this.containerHeight) / 2;
this.blit(k, l, 0, 0, this.containerWidth, this.containerHeight);
if (this.alloyfurnace.isBurning()) {
int i1 = this.alloyfurnace.getBurnTimeRemainingScaled(13);
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1);
this.blit(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1);
i1 = this.alloyfurnace.getCookProgressScaled(24);
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
this.blit(k + 79, l + 34, 176, 14, i1 + 1, 16);
}
}
@Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.format("tile.techreborn.iron_alloy_furnace.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6,
protected void drawForeground(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translate("tile.techreborn.iron_alloy_furnace.name");
this.font.draw(name, this.containerWidth / 2 - this.font.getStringWidth(name) / 2, 6,
4210752);
this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.font.draw(I18n.translate("container.inventory", new Object[0]), 8,
this.containerHeight - 96 + 2, 4210752);
}
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
super.render(mouseX, mouseY, partialTicks);
this.renderHoveredToolTip(mouseX, mouseY);
this.drawMouseoverTooltip(mouseX, mouseY);
}
}

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileAlloySmelter;
@ -33,15 +33,15 @@ public class GuiAlloySmelter extends GuiBase {
TileAlloySmelter tile;
public GuiAlloySmelter(final EntityPlayer player, final TileAlloySmelter tile) {
public GuiAlloySmelter(final PlayerEntity player, final TileAlloySmelter tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(8, 72, layer);
@ -54,8 +54,8 @@ public class GuiAlloySmelter extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileAssemblingMachine;
@ -33,14 +33,14 @@ public class GuiAssemblingMachine extends GuiBase {
TileAssemblingMachine tile;
public GuiAssemblingMachine(final EntityPlayer player, final TileAssemblingMachine tile) {
public GuiAssemblingMachine(final PlayerEntity player, final TileAssemblingMachine tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float partialTicks, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY);
protected void drawBackground(final float partialTicks, final int mouseX, final int mouseY) {
super.drawBackground(partialTicks, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
// Battery slot
@ -56,8 +56,8 @@ public class GuiAssemblingMachine extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,12 +24,13 @@
package techreborn.client.gui;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.render.GuiLighting;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
import net.minecraft.recipe.Recipe;
import net.minecraft.util.Identifier;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import reborncore.common.network.NetworkManager;
@ -43,11 +44,11 @@ import static net.minecraft.item.ItemStack.EMPTY;
*/
public class GuiAutoCrafting extends GuiBase {
static final ResourceLocation RECIPE_BOOK_TEXTURE = new ResourceLocation("textures/gui/recipe_book.png");
static final Identifier RECIPE_BOOK_TEXTURE = new Identifier("textures/gui/recipe_book.png");
boolean showGui = true;
TileAutoCraftingTable tileAutoCraftingTable;
public GuiAutoCrafting(EntityPlayer player, TileAutoCraftingTable tile) {
public GuiAutoCrafting(PlayerEntity player, TileAutoCraftingTable tile) {
super(player, tile, tile.createContainer(player));
this.tileAutoCraftingTable = tile;
}
@ -56,8 +57,8 @@ public class GuiAutoCrafting extends GuiBase {
if (stack != EMPTY) {
GlStateManager.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
RenderHelper.enableGUIStandardItemLighting();
itemRender.renderItemAndEffectIntoGUI(stack, x, y);
GuiLighting.enableForItems();
itemRenderer.renderGuiItem(stack, x, y);
GlStateManager.disableLighting();
GlStateManager.pushMatrix();
GlStateManager.disableDepthTest();
@ -71,11 +72,11 @@ public class GuiAutoCrafting extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
IRecipe recipe = tileAutoCraftingTable.getIRecipe();
protected void drawForeground(int mouseX, int mouseY) {
super.drawForeground(mouseX, mouseY);
Recipe recipe = tileAutoCraftingTable.getIRecipe();
if (recipe != null) {
renderItemStack(recipe.getRecipeOutput(), 95, 42);
renderItemStack(recipe.getOutput(), 95, 42);
}
final Layer layer = Layer.FOREGROUND;
@ -84,8 +85,8 @@ public class GuiAutoCrafting extends GuiBase {
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, int mouseX, int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, int mouseX, int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
@ -94,7 +95,7 @@ public class GuiAutoCrafting extends GuiBase {
}
drawOutputSlot(145, 42, layer);
drawOutputSlot(95, 42, layer);
drawString("Inventory", 8, 82, 4210752, layer);
draw("Inventory", 8, 82, 4210752, layer);
builder.drawLockButton(this, 145, 4, mouseX, mouseY, layer, tileAutoCraftingTable.locked);
}

View file

@ -25,7 +25,7 @@
package techreborn.client.gui;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.storage.TileLowVoltageSU;
@ -34,14 +34,14 @@ public class GuiBatbox extends GuiBase {
TileLowVoltageSU tile;
public GuiBatbox(final EntityPlayer player, final TileLowVoltageSU tile) {
public GuiBatbox(final PlayerEntity player, final TileLowVoltageSU tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
drawSlot(62, 45, layer);
@ -49,8 +49,8 @@ public class GuiBatbox extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
if(GuiBase.slotConfigType == SlotConfigType.NONE){

View file

@ -24,11 +24,11 @@
package techreborn.client.gui;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import reborncore.ClientProxy;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.builder.widget.GuiButtonExtended;
@ -44,7 +44,7 @@ public class GuiBlastFurnace extends GuiBase {
public TileIndustrialBlastFurnace tile;
boolean hasMultiBlock;
public GuiBlastFurnace(final EntityPlayer player, final TileIndustrialBlastFurnace tile) {
public GuiBlastFurnace(final PlayerEntity player, final TileIndustrialBlastFurnace tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@ -57,8 +57,8 @@ public class GuiBlastFurnace extends GuiBase {
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
this.hasMultiBlock = this.tile.getCachedHeat() != 0;
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
@ -77,8 +77,8 @@ public class GuiBlastFurnace extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
this.hasMultiBlock = tile.getCachedHeat() != 0;
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
@ -101,7 +101,7 @@ public class GuiBlastFurnace extends GuiBase {
{
// This code here makes a basic multiblock and then sets to the selected one.
final Multiblock multiblock = new Multiblock();
IBlockState standardCasing = TRContent.MachineBlocks.BASIC.getCasing().getDefaultState();
BlockState standardCasing = TRContent.MachineBlocks.BASIC.getCasing().getDefaultState();
this.addComponent(0, 0, 0, standardCasing, multiblock);
this.addComponent(1, 0, 0, standardCasing, multiblock);
@ -145,9 +145,9 @@ public class GuiBlastFurnace extends GuiBase {
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
tile.getPos().getX() - EnumFacing.byIndex(tile.getFacingInt()).getXOffset() * 2,
tile.getPos().getX() - Direction.byId(tile.getFacingInt()).getOffsetX() * 2,
tile.getPos().getY() - 1,
tile.getPos().getZ() - EnumFacing.byIndex(tile.getFacingInt()).getZOffset() * 2);
tile.getPos().getZ() - Direction.byId(tile.getFacingInt()).getOffsetZ() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);
@ -155,7 +155,7 @@ public class GuiBlastFurnace extends GuiBase {
}
}
public void addComponent(final int x, final int y, final int z, final IBlockState blockState, final Multiblock multiblock) {
public void addComponent(final int x, final int y, final int z, final BlockState blockState, final Multiblock multiblock) {
multiblock.addComponent(new BlockPos(x, y, z), blockState);
}

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.TileIndustrialCentrifuge;
@ -33,14 +33,14 @@ public class GuiCentrifuge extends GuiBase {
TileIndustrialCentrifuge tile;
public GuiCentrifuge(final EntityPlayer player, final TileIndustrialCentrifuge tile) {
public GuiCentrifuge(final PlayerEntity player, final TileIndustrialCentrifuge tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
drawSlot(8, 72, layer);
@ -57,8 +57,8 @@ public class GuiCentrifuge extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 61, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import techreborn.tiles.TileChargeOMat;
@ -32,14 +32,14 @@ public class GuiChargeBench extends GuiBase {
TileChargeOMat tile;
public GuiChargeBench(final EntityPlayer player, final TileChargeOMat tile) {
public GuiChargeBench(final PlayerEntity player, final TileChargeOMat tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
drawSlot(62, 25, layer);
@ -51,8 +51,8 @@ public class GuiChargeBench extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
builder.drawMultiEnergyBar(this, 81, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileChemicalReactor;
@ -33,14 +33,14 @@ public class GuiChemicalReactor extends GuiBase {
TileChemicalReactor tile;
public GuiChemicalReactor(final EntityPlayer player, final TileChemicalReactor tile) {
public GuiChemicalReactor(final PlayerEntity player, final TileChemicalReactor tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(8, 72, layer);
@ -53,8 +53,8 @@ public class GuiChemicalReactor extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,42 +24,42 @@
package techreborn.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.ContainerScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Identifier;
import reborncore.client.gui.builder.widget.GuiButtonSimple;
import techreborn.tiles.machine.tier3.TileChunkLoader;
public class GuiChunkLoader extends GuiContainer {
public class GuiChunkLoader extends ContainerScreen {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
private static final Identifier texture = new Identifier("techreborn",
"textures/gui/industrial_chunkloader.png");
TileChunkLoader chunkloader;
private GuiButton plusOneButton;
private GuiButton plusTenButton;
private GuiButton minusOneButton;
private GuiButton minusTenButton;
private ButtonWidget plusOneButton;
private ButtonWidget plusTenButton;
private ButtonWidget minusOneButton;
private ButtonWidget minusTenButton;
public GuiChunkLoader(final EntityPlayer player, final TileChunkLoader chunkLoader) {
public GuiChunkLoader(final PlayerEntity player, final TileChunkLoader chunkLoader) {
super(chunkLoader.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.containerWidth = 176;
this.containerHeight = 167;
this.chunkloader = chunkLoader;
}
@Override
public void initGui() {
super.initGui();
this.guiLeft = this.width / 2 - this.xSize / 2;
this.guiTop = this.height / 2 - this.ySize / 2;
this.plusOneButton = new GuiButtonSimple(0, this.guiLeft + 5, this.guiTop + 37, 40, 20, "+1");
this.plusTenButton = new GuiButtonSimple(0, this.guiLeft + 45, this.guiTop + 37, 40, 20, "+10");
this.left = this.width / 2 - this.containerWidth / 2;
this.top = this.height / 2 - this.containerHeight / 2;
this.plusOneButton = new GuiButtonSimple(0, this.left + 5, this.top + 37, 40, 20, "+1");
this.plusTenButton = new GuiButtonSimple(0, this.left + 45, this.top + 37, 40, 20, "+10");
this.minusOneButton = new GuiButtonSimple(0, this.guiLeft + 90, this.guiTop + 37, 40, 20, "-1");
this.minusTenButton = new GuiButtonSimple(0, this.guiLeft + 130, this.guiTop + 37, 40, 20, "-10");
this.minusOneButton = new GuiButtonSimple(0, this.left + 90, this.top + 37, 40, 20, "-1");
this.minusTenButton = new GuiButtonSimple(0, this.left + 130, this.top + 37, 40, 20, "-10");
this.buttons.add(this.plusOneButton);
this.buttons.add(this.plusTenButton);
@ -68,28 +68,28 @@ public class GuiChunkLoader extends GuiContainer {
}
@Override
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) {
protected void drawBackground(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) {
this.drawDefaultBackground();
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(GuiChunkLoader.texture);
final int k = (this.width - this.xSize) / 2;
final int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
final int k = (this.width - this.containerWidth) / 2;
final int l = (this.height - this.containerHeight) / 2;
this.blit(k, l, 0, 0, this.containerWidth, this.containerHeight);
}
@Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.format("tile.techreborn:chunk_loader.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6,
protected void drawForeground(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translate("tile.techreborn:chunk_loader.name");
this.font.draw(name, this.containerWidth / 2 - this.font.getStringWidth(name) / 2, 6,
4210752);
this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.font.draw(I18n.translate("container.inventory", new Object[0]), 8,
this.containerHeight - 96 + 2, 4210752);
}
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
super.render(mouseX, mouseY, partialTicks);
this.renderHoveredToolTip(mouseX, mouseY);
this.drawMouseoverTooltip(mouseX, mouseY);
}
}

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileCompressor;
@ -33,14 +33,14 @@ public class GuiCompressor extends GuiBase {
TileCompressor tile;
public GuiCompressor(final EntityPlayer player, final TileCompressor tile) {
public GuiCompressor(final PlayerEntity player, final TileCompressor tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(8, 72, layer);
@ -52,8 +52,8 @@ public class GuiCompressor extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
this.builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,43 +24,43 @@
package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.ContainerScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.container.Container;
import net.minecraft.util.Identifier;
public class GuiDestructoPack extends GuiContainer {
public class GuiDestructoPack extends ContainerScreen {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
private static final Identifier texture = new Identifier("techreborn",
"textures/gui/destructopack.png");
public GuiDestructoPack(Container container) {
super(container);
this.xSize = 176;
this.ySize = 166;
this.containerWidth = 176;
this.containerHeight = 166;
}
@Override
protected void drawGuiContainerBackgroundLayer(float arg0, int arg1, int arg2) {
protected void drawBackground(float arg0, int arg1, int arg2) {
this.drawDefaultBackground();
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 176, 166);
blit(left, top, 0, 0, 176, 166);
}
@Override
protected void drawGuiContainerForegroundLayer(int arg0, int arg1) {
String name = I18n.format("item.techreborn.part.destructoPack.name");
fontRenderer.drawString(name, xSize / 2 - fontRenderer.getStringWidth(name) / 2, 5, 4210752);
this.fontRenderer.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2,
protected void drawForeground(int arg0, int arg1) {
String name = I18n.translate("item.techreborn.part.destructoPack.name");
font.draw(name, containerWidth / 2 - font.getStringWidth(name) / 2, 5, 4210752);
this.font.draw(I18n.translate("container.inventory"), 8, this.containerHeight - 96 + 2,
4210752);
super.drawGuiContainerForegroundLayer(arg0, arg1);
super.drawForeground(arg0, arg1);
}
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
super.render(mouseX, mouseY, partialTicks);
this.renderHoveredToolTip(mouseX, mouseY);
this.drawMouseoverTooltip(mouseX, mouseY);
}
}

View file

@ -24,26 +24,26 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraft.entity.player.PlayerEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.generator.advanced.TileDieselGenerator;
@OnlyIn(Dist.CLIENT)
@Environment(EnvType.CLIENT)
public class GuiDieselGenerator extends GuiBase {
TileDieselGenerator tile;
public GuiDieselGenerator(final EntityPlayer player, final TileDieselGenerator tile) {
public GuiDieselGenerator(final PlayerEntity player, final TileDieselGenerator tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(25, 35, layer);
drawSlot(25, 55, layer);
@ -52,8 +52,8 @@ public class GuiDieselGenerator extends GuiBase {
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import techreborn.tiles.TileDigitalChest;
@ -32,14 +32,14 @@ public class GuiDigitalChest extends GuiBase {
TileDigitalChest tile;
public GuiDigitalChest(final EntityPlayer player, final TileDigitalChest tile) {
public GuiDigitalChest(final PlayerEntity player, final TileDigitalChest tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
drawSlot(80, 24, layer);
@ -47,18 +47,18 @@ public class GuiDigitalChest extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
if (!tile.storedItem.isEmpty() && tile.inventory.getStackInSlot(1) != null) {
if (!tile.storedItem.isEmpty() && tile.inventory.getInvStack(1) != null) {
builder.drawBigBlueBar(this, 31, 43,
tile.storedItem.getCount() + tile.inventory.getStackInSlot(1).getCount(),
tile.maxCapacity, mouseX - guiLeft, mouseY - guiTop, "Stored", layer);
tile.storedItem.getAmount() + tile.inventory.getInvStack(1).getAmount(),
tile.maxCapacity, mouseX - left, mouseY - top, "Stored", layer);
}
if (tile.storedItem.isEmpty() && tile.inventory.getStackInSlot(1) != null) {
builder.drawBigBlueBar(this, 31, 43, tile.inventory.getStackInSlot(1).getCount(),
tile.maxCapacity, mouseX - guiLeft, mouseY - guiTop, "Stored", layer);
if (tile.storedItem.isEmpty() && tile.inventory.getInvStack(1) != null) {
builder.drawBigBlueBar(this, 31, 43, tile.inventory.getInvStack(1).getAmount(),
tile.maxCapacity, mouseX - left, mouseY - top, "Stored", layer);
}
}
}

View file

@ -24,11 +24,11 @@
package techreborn.client.gui;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import reborncore.ClientProxy;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.builder.widget.GuiButtonExtended;
@ -37,13 +37,13 @@ import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet;
import techreborn.init.TRContent;
import techreborn.tiles.machine.multiblock.TileDistillationTower;
import techreborn.tiles.machine.multiblock.TileEnvTypeillationTower;
public class GuiDistillationTower extends GuiBase {
public class GuiEnvTypeillationTower extends GuiBase {
public TileDistillationTower tile;
public TileEnvTypeillationTower tile;
public GuiDistillationTower(final EntityPlayer player, final TileDistillationTower tile) {
public GuiEnvTypeillationTower(final PlayerEntity player, final TileEnvTypeillationTower tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@ -55,8 +55,8 @@ public class GuiDistillationTower extends GuiBase {
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
final GuiBase.Layer layer = Layer.BACKGROUND;
@ -72,8 +72,8 @@ public class GuiDistillationTower extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 55, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
@ -95,8 +95,8 @@ public class GuiDistillationTower extends GuiBase {
{
// This code here makes a basic multiblock and then sets to the selected one.
final Multiblock multiblock = new Multiblock();
IBlockState advancedCasing = TRContent.MachineBlocks.ADVANCED.getCasing().getDefaultState();
IBlockState standardCasing = TRContent.MachineBlocks.BASIC.getCasing().getDefaultState();
BlockState advancedCasing = TRContent.MachineBlocks.ADVANCED.getCasing().getDefaultState();
BlockState standardCasing = TRContent.MachineBlocks.BASIC.getCasing().getDefaultState();
addComponent(0, 0, 0, standardCasing, multiblock);
addComponent(1, 0, 0, standardCasing, multiblock);
@ -140,9 +140,9 @@ public class GuiDistillationTower extends GuiBase {
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
tile.getPos().getX() - EnumFacing.byIndex(tile.getFacingInt()).getXOffset() * 2,
tile.getPos().getX() - Direction.byId(tile.getFacingInt()).getOffsetX() * 2,
tile.getPos().getY() - 1,
tile.getPos().getZ() - EnumFacing.byIndex(tile.getFacingInt()).getZOffset() * 2);
tile.getPos().getZ() - Direction.byId(tile.getFacingInt()).getOffsetZ() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);
@ -150,7 +150,7 @@ public class GuiDistillationTower extends GuiBase {
}
}
public void addComponent(final int x, final int y, final int z, final IBlockState blockState, final Multiblock multiblock) {
public void addComponent(final int x, final int y, final int z, final BlockState blockState, final Multiblock multiblock) {
multiblock.addComponent(new BlockPos(x, y, z), blockState);
}

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileElectricFurnace;
@ -33,14 +33,14 @@ public class GuiElectricFurnace extends GuiBase {
TileElectricFurnace tile;
public GuiElectricFurnace(final EntityPlayer player, final TileElectricFurnace tile) {
public GuiElectricFurnace(final PlayerEntity player, final TileElectricFurnace tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY);
protected void drawBackground(float partialTicks, int mouseX, int mouseY) {
super.drawBackground(partialTicks, mouseX, mouseY);
Layer layer = Layer.BACKGROUND;
drawSlot(8, 72, layer);
@ -52,8 +52,8 @@ public class GuiElectricFurnace extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(int mouseX, int mouseY) {
super.drawForeground(mouseX, mouseY);
Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.gaugeProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileExtractor;
@ -33,14 +33,14 @@ public class GuiExtractor extends GuiBase {
TileExtractor tile;
public GuiExtractor(final EntityPlayer player, final TileExtractor tile) {
public GuiExtractor(final PlayerEntity player, final TileExtractor tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(8, 72, layer);
@ -52,8 +52,8 @@ public class GuiExtractor extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,10 +24,10 @@
package techreborn.client.gui;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import reborncore.ClientProxy;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.builder.widget.GuiButtonExtended;
@ -46,12 +46,12 @@ public class GuiFluidReplicator extends GuiBase {
TileFluidReplicator tile;
public GuiFluidReplicator(final EntityPlayer player, final TileFluidReplicator tile) {
public GuiFluidReplicator(final PlayerEntity player, final TileFluidReplicator tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
public void addComponent(final int x, final int y, final int z, final IBlockState blockState, final Multiblock multiblock) {
public void addComponent(final int x, final int y, final int z, final BlockState blockState, final Multiblock multiblock) {
multiblock.addComponent(new BlockPos(x, y, z), blockState);
}
@ -63,8 +63,8 @@ public class GuiFluidReplicator extends GuiBase {
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
// Battery slot
drawSlot(8, 72, layer);
@ -82,8 +82,8 @@ public class GuiFluidReplicator extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawTank(this, 99, 25, mouseX, mouseY, tile.tank.getFluid(), tile.tank.getCapacity(), tile.tank.isEmpty(), layer);
@ -105,7 +105,7 @@ public class GuiFluidReplicator extends GuiBase {
{
// This code here makes a basic multiblock and then sets to the selected one.
final Multiblock multiblock = new Multiblock();
final IBlockState reinforcedCasing = TRContent.MachineBlocks.ADVANCED.getCasing().getDefaultState();
final BlockState reinforcedCasing = TRContent.MachineBlocks.ADVANCED.getCasing().getDefaultState();
addComponent(1, 0, 0, reinforcedCasing, multiblock);
addComponent(0, 0, 1, reinforcedCasing, multiblock);
@ -121,9 +121,9 @@ public class GuiFluidReplicator extends GuiBase {
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
this.tile.getPos().getX()
- EnumFacing.byIndex(this.tile.getFacingInt()).getXOffset() * 2,
- Direction.byId(this.tile.getFacingInt()).getOffsetX() * 2,
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
- EnumFacing.byIndex(this.tile.getFacingInt()).getZOffset() * 2);
- Direction.byId(this.tile.getFacingInt()).getOffsetZ() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);

View file

@ -24,8 +24,8 @@
package techreborn.client.gui;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import org.apache.commons.lang3.tuple.Pair;
import reborncore.ClientProxy;
@ -50,14 +50,14 @@ import java.util.Optional;
public class GuiFusionReactor extends GuiBase {
TileFusionControlComputer tile;
public GuiFusionReactor(final EntityPlayer player, final TileFusionControlComputer tile) {
public GuiFusionReactor(final PlayerEntity player, final TileFusionControlComputer tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float partialTicks, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY);
protected void drawBackground(final float partialTicks, final int mouseX, final int mouseY) {
super.drawBackground(partialTicks, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(34, 47, layer);
@ -72,8 +72,8 @@ public class GuiFusionReactor extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
@ -100,8 +100,8 @@ public class GuiFusionReactor extends GuiBase {
}
}
builder.drawUpDownButtons(this, 121, 79, layer);
drawString("Size: " + tile.size, 83, 81, 0xFFFFFF, layer);
drawString("" + tile.getPowerMultiplier() + "x", 10, 81, 0xFFFFFF, layer);
draw("Size: " + tile.size, 83, 81, 0xFFFFFF, layer);
draw("" + tile.getPowerMultiplier() + "x", 10, 81, 0xFFFFFF, layer);
buttons.add(new GuiButtonUpDown(300, 121, 79, this, GuiBase.Layer.FOREGROUND));
buttons.add(new GuiButtonUpDown(301, 121 + 12, 79, this, GuiBase.Layer.FOREGROUND));
@ -140,7 +140,7 @@ public class GuiFusionReactor extends GuiBase {
private void updateMultiBlockRender(){
final Multiblock multiblock = new Multiblock();
IBlockState coil = TRContent.Machine.FUSION_COIL.block.getDefaultState();
BlockState coil = TRContent.Machine.FUSION_COIL.block.getDefaultState();
List<BlockPos> coils = Torus.generate(new BlockPos(0, 0, 0), tile.size);
coils.forEach(pos -> addComponent(pos.getX(), pos.getY(), pos.getZ(), coil, multiblock));
@ -152,7 +152,7 @@ public class GuiFusionReactor extends GuiBase {
tile.getPos().getZ());
}
public void addComponent(final int x, final int y, final int z, final IBlockState blockState, final Multiblock multiblock) {
public void addComponent(final int x, final int y, final int z, final BlockState blockState, final Multiblock multiblock) {
multiblock.addComponent(new BlockPos(x, y, z), blockState);
}

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.generator.advanced.TileGasTurbine;
@ -33,14 +33,14 @@ public class GuiGasTurbine extends GuiBase {
TileGasTurbine tile;
public GuiGasTurbine(final EntityPlayer player, final TileGasTurbine tile) {
public GuiGasTurbine(final PlayerEntity player, final TileGasTurbine tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(25, 35, layer);
drawSlot(25, 55, layer);
@ -49,8 +49,8 @@ public class GuiGasTurbine extends GuiBase {
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import techreborn.tiles.generator.basic.TileSolidFuelGenerator;
@ -32,14 +32,14 @@ public class GuiGenerator extends GuiBase {
TileSolidFuelGenerator tile;
public GuiGenerator(final EntityPlayer player, final TileSolidFuelGenerator tile) {
public GuiGenerator(final PlayerEntity player, final TileSolidFuelGenerator tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
drawSlot(8, 72, layer);
@ -50,8 +50,8 @@ public class GuiGenerator extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
builder.drawBurnBar(this, tile.getScaledBurnTime(100), 100, 81, 38, mouseX, mouseY, layer);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileGrinder;
@ -33,14 +33,14 @@ public class GuiGrinder extends GuiBase {
TileGrinder tile;
public GuiGrinder(final EntityPlayer player, final TileGrinder tile) {
public GuiGrinder(final PlayerEntity player, final TileGrinder tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(8, 72, layer);
@ -52,8 +52,8 @@ public class GuiGrinder extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -25,7 +25,7 @@
package techreborn.client.gui;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.storage.idsu.TileInterdimensionalSU;
@ -34,14 +34,14 @@ public class GuiIDSU extends GuiBase {
TileInterdimensionalSU idsu;
public GuiIDSU(EntityPlayer player, TileInterdimensionalSU tileIDSU) {
public GuiIDSU(PlayerEntity player, TileInterdimensionalSU tileIDSU) {
super(player, tileIDSU, tileIDSU.createContainer(player));
idsu = tileIDSU;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
drawSlot(62, 45, layer);
@ -50,8 +50,8 @@ public class GuiIDSU extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
GlStateManager.pushMatrix();

View file

@ -24,9 +24,9 @@
package techreborn.client.gui;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import reborncore.ClientProxy;
import reborncore.client.gui.builder.GuiBase;
@ -42,7 +42,7 @@ public class GuiImplosionCompressor extends GuiBase {
TileImplosionCompressor tile;
public GuiImplosionCompressor(final EntityPlayer player, final TileImplosionCompressor tile) {
public GuiImplosionCompressor(final PlayerEntity player, final TileImplosionCompressor tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@ -54,8 +54,8 @@ public class GuiImplosionCompressor extends GuiBase {
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
final GuiBase.Layer layer = Layer.BACKGROUND;
@ -75,8 +75,8 @@ public class GuiImplosionCompressor extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
@ -118,7 +118,7 @@ public class GuiImplosionCompressor extends GuiBase {
}
}
public void addComponent(final int x, final int y, final int z, final IBlockState blockState, final Multiblock multiblock) {
public void addComponent(final int x, final int y, final int z, final BlockState blockState, final Multiblock multiblock) {
multiblock.addComponent(new BlockPos(x, y, z), blockState);
}
}

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileIndustrialElectrolyzer;
@ -33,14 +33,14 @@ public class GuiIndustrialElectrolyzer extends GuiBase {
TileIndustrialElectrolyzer tile;
public GuiIndustrialElectrolyzer(final EntityPlayer player, final TileIndustrialElectrolyzer tile) {
public GuiIndustrialElectrolyzer(final PlayerEntity player, final TileIndustrialElectrolyzer tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
//Battery slot
@ -54,8 +54,8 @@ public class GuiIndustrialElectrolyzer extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 84, 52, mouseX, mouseY, GuiBuilder.ProgressDirection.UP, layer);

View file

@ -24,11 +24,11 @@
package techreborn.client.gui;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.EnumFacing;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import reborncore.ClientProxy;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.builder.widget.GuiButtonExtended;
@ -43,7 +43,7 @@ public class GuiIndustrialGrinder extends GuiBase {
TileIndustrialGrinder tile;
public GuiIndustrialGrinder(final EntityPlayer player, final TileIndustrialGrinder tile) {
public GuiIndustrialGrinder(final PlayerEntity player, final TileIndustrialGrinder tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@ -55,8 +55,8 @@ public class GuiIndustrialGrinder extends GuiBase {
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
// Battery slot
@ -80,8 +80,8 @@ public class GuiIndustrialGrinder extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
@ -102,8 +102,8 @@ public class GuiIndustrialGrinder extends GuiBase {
{
// This code here makes a basic multiblock and then sets to the selected one.
final Multiblock multiblock = new Multiblock();
IBlockState standardCasing = TRContent.MachineBlocks.BASIC.getCasing().getDefaultState();
IBlockState reinforcedCasing = TRContent.MachineBlocks.ADVANCED.getCasing().getDefaultState();
BlockState standardCasing = TRContent.MachineBlocks.BASIC.getCasing().getDefaultState();
BlockState reinforcedCasing = TRContent.MachineBlocks.ADVANCED.getCasing().getDefaultState();
addComponent(0, -1, 0, standardCasing, multiblock);
addComponent(1, -1, 0, standardCasing, multiblock);
@ -141,9 +141,9 @@ public class GuiIndustrialGrinder extends GuiBase {
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
this.tile.getPos().getX()
- EnumFacing.byIndex(this.tile.getFacingInt()).getXOffset() * 2,
- Direction.byId(this.tile.getFacingInt()).getOffsetX() * 2,
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
- EnumFacing.byIndex(this.tile.getFacingInt()).getZOffset() * 2);
- Direction.byId(this.tile.getFacingInt()).getOffsetZ() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);
@ -151,7 +151,7 @@ public class GuiIndustrialGrinder extends GuiBase {
}
}
public void addComponent(final int x, final int y, final int z, final IBlockState blockState, final Multiblock multiblock) {
public void addComponent(final int x, final int y, final int z, final BlockState blockState, final Multiblock multiblock) {
multiblock.addComponent(new BlockPos(x, y, z), blockState);
}

View file

@ -24,11 +24,11 @@
package techreborn.client.gui;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.EnumFacing;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import reborncore.ClientProxy;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.builder.widget.GuiButtonExtended;
@ -43,7 +43,7 @@ public class GuiIndustrialSawmill extends GuiBase {
TileIndustrialSawmill tile;
public GuiIndustrialSawmill(final EntityPlayer player, final TileIndustrialSawmill tile) {
public GuiIndustrialSawmill(final PlayerEntity player, final TileIndustrialSawmill tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@ -55,8 +55,8 @@ public class GuiIndustrialSawmill extends GuiBase {
}
@Override
protected void drawGuiContainerBackgroundLayer(final float partialTicks, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY);
protected void drawBackground(final float partialTicks, final int mouseX, final int mouseY) {
super.drawBackground(partialTicks, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
// Battery slot
@ -79,8 +79,8 @@ public class GuiIndustrialSawmill extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
@ -101,8 +101,8 @@ public class GuiIndustrialSawmill extends GuiBase {
{
// This code here makes a basic multiblock and then sets to the selected one.
final Multiblock multiblock = new Multiblock();
IBlockState standardCasing = TRContent.MachineBlocks.BASIC.getCasing().getDefaultState();
IBlockState reinforcedCasing = TRContent.MachineBlocks.ADVANCED.getCasing().getDefaultState();
BlockState standardCasing = TRContent.MachineBlocks.BASIC.getCasing().getDefaultState();
BlockState reinforcedCasing = TRContent.MachineBlocks.ADVANCED.getCasing().getDefaultState();
addComponent(0, -1, 0, standardCasing, multiblock);
addComponent(1, -1, 0, standardCasing, multiblock);
@ -140,9 +140,9 @@ public class GuiIndustrialSawmill extends GuiBase {
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
this.tile.getPos().getX()
- EnumFacing.byIndex(this.tile.getFacingInt()).getYOffset() * 2,
- Direction.byId(this.tile.getFacingInt()).getOffsetY() * 2,
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
- EnumFacing.byIndex(this.tile.getFacingInt()).getYOffset() * 2);
- Direction.byId(this.tile.getFacingInt()).getOffsetY() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);
@ -150,7 +150,7 @@ public class GuiIndustrialSawmill extends GuiBase {
}
}
public void addComponent(final int x, final int y, final int z, final IBlockState blockState, final Multiblock multiblock) {
public void addComponent(final int x, final int y, final int z, final BlockState blockState, final Multiblock multiblock) {
multiblock.addComponent(new BlockPos(x, y, z), blockState);
}
}

View file

@ -25,64 +25,64 @@
package techreborn.client.gui;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Identifier;
import reborncore.client.gui.builder.GuiBase;
import techreborn.init.TRContent;
import techreborn.tiles.machine.iron.TileIronFurnace;
public class GuiIronFurnace extends GuiBase {
public static final ResourceLocation texture = new ResourceLocation("minecraft",
public static final Identifier texture = new Identifier("minecraft",
"textures/gui/container/furnace.png");
TileIronFurnace furnace;
public GuiIronFurnace(final EntityPlayer player, final TileIronFurnace furnace) {
public GuiIronFurnace(final PlayerEntity player, final TileIronFurnace furnace) {
super(player, furnace, furnace.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.containerWidth = 176;
this.containerHeight = 167;
this.furnace = furnace;
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
protected void drawBackground(float partialTicks, int mouseX, int mouseY) {
drawDefaultBackground();
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
builder.drawSlotTab(this, guiLeft - 24, guiTop + 6, new ItemStack(TRContent.WRENCH));
builder.drawSlotTab(this, left - 24, top + 6, new ItemStack(TRContent.WRENCH));
mc.getTextureManager().bindTexture(GuiIronFurnace.texture);
final int k = (this.width - xSize) / 2;
final int l = (this.height - ySize) / 2;
drawTexturedModalRect(k, l, 0, 0, xSize, ySize);
final int k = (this.width - containerWidth) / 2;
final int l = (this.height - containerHeight) / 2;
blit(k, l, 0, 0, containerWidth, containerHeight);
int j = 0;
j = furnace.gaugeProgressScaled(24);
if (j > 0) {
drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
blit(k + 78, l + 35, 176, 14, j + 1, 16);
}
j = furnace.gaugeFuelScaled(12);
if (j > 0) {
drawTexturedModalRect(k + 57, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
blit(k + 57, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
final String name = I18n.format("tile.techreborn.iron_furnace.name");
fontRenderer.drawString(name, xSize / 2 - fontRenderer.getStringWidth(name) / 2, 6, 4210752);
fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8, ySize - 96 + 2, 4210752);
protected void drawForeground(int mouseX, int mouseY) {
final String name = I18n.translate("tile.techreborn.iron_furnace.name");
font.draw(name, containerWidth / 2 - font.getStringWidth(name) / 2, 6, 4210752);
font.draw(I18n.translate("container.inventory", new Object[0]), 8, containerHeight - 96 + 2, 4210752);
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
super.drawForeground(mouseX, mouseY);
}
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
super.render(mouseX, mouseY, partialTicks);
renderHoveredToolTip(mouseX, mouseY);
drawMouseoverTooltip(mouseX, mouseY);
}
}

View file

@ -25,7 +25,7 @@
package techreborn.client.gui;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.storage.lesu.TileLapotronicSU;
@ -34,14 +34,14 @@ public class GuiLESU extends GuiBase {
TileLapotronicSU tile;
public GuiLESU(final EntityPlayer player, final TileLapotronicSU tile) {
public GuiLESU(final PlayerEntity player, final TileLapotronicSU tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
drawSlot(62, 45, layer);
@ -50,8 +50,8 @@ public class GuiLESU extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
GlStateManager.pushMatrix();

View file

@ -25,7 +25,7 @@
package techreborn.client.gui;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.storage.TileMediumVoltageSU;
@ -34,14 +34,14 @@ public class GuiMFE extends GuiBase {
TileMediumVoltageSU mfe;
public GuiMFE(final EntityPlayer player, final TileMediumVoltageSU mfe) {
public GuiMFE(final PlayerEntity player, final TileMediumVoltageSU mfe) {
super(player, mfe, mfe.createContainer(player));
this.mfe = mfe;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
drawSlot(62, 45, layer);
@ -50,8 +50,8 @@ public class GuiMFE extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
if(GuiBase.slotConfigType == SlotConfigType.NONE){

View file

@ -24,8 +24,9 @@
package techreborn.client.gui;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.storage.TileHighVoltageSU;
@ -34,14 +35,14 @@ public class GuiMFSU extends GuiBase {
TileHighVoltageSU mfsu;
public GuiMFSU(final EntityPlayer player, final TileHighVoltageSU mfsu) {
public GuiMFSU(final PlayerEntity player, final TileHighVoltageSU mfsu) {
super(player, mfsu, mfsu.createContainer(player));
this.mfsu = mfsu;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
drawSlot(62, 45, layer);
@ -50,8 +51,8 @@ public class GuiMFSU extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
GlStateManager.pushMatrix();

View file

@ -24,11 +24,6 @@
package techreborn.client.gui;
import net.minecraft.client.gui.GuiConfirmOpenLink;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import reborncore.client.gui.builder.widget.GuiButtonExtended;
import reborncore.common.network.NetworkManager;
@ -36,21 +31,26 @@ import techreborn.items.ItemManual;
import techreborn.packets.ServerboundPackets;
import java.awt.*;
import net.minecraft.client.gui.Screen;
import net.minecraft.client.gui.ingame.ConfirmChatLinkScreen;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Identifier;
public class GuiManual extends GuiScreen {
public class GuiManual extends Screen {
ItemManual manual;
EntityPlayer player;
PlayerEntity player;
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/manual.png");
private static final Identifier texture = new Identifier("techreborn", "textures/gui/manual.png");
int guiWidth = 207;
int guiHeight = 195;
private static final String text1 = I18n.format("techreborn.manual.wiki");
private static final String text2 = I18n.format("techreborn.manual.discord");
private static final String text3 = I18n.format("techreborn.manual.refund");
private static final String text1 = I18n.translate("techreborn.manual.wiki");
private static final String text2 = I18n.translate("techreborn.manual.discord");
private static final String text3 = I18n.translate("techreborn.manual.refund");
public GuiManual(EntityPlayer player) {
public GuiManual(PlayerEntity player) {
this.player = player;
}
@ -62,10 +62,10 @@ public class GuiManual extends GuiScreen {
@Override
public void initGui() {
int y = height / 4;
buttons.add(new GuiButtonExtended(1, (width / 2 - 30), y + 10, 60, 20, I18n.format("techreborn.manual.wikibtn")));
buttons.add(new GuiButtonExtended(2, (width / 2 - 30), y + 60, 60, 20, I18n.format("techreborn.manual.discordbtn")));
buttons.add(new GuiButtonExtended(1, (width / 2 - 30), y + 10, 60, 20, I18n.translate("techreborn.manual.wikibtn")));
buttons.add(new GuiButtonExtended(2, (width / 2 - 30), y + 60, 60, 20, I18n.translate("techreborn.manual.discordbtn")));
if(ItemManual.allowRefund){
buttons.add(new GuiButtonExtended(3, (width / 2 - 30), y + 110, 60, 20, I18n.format("techreborn.manual.refundbtn")));
buttons.add(new GuiButtonExtended(3, (width / 2 - 30), y + 110, 60, 20, I18n.translate("techreborn.manual.refundbtn")));
}
}
@ -75,12 +75,12 @@ public class GuiManual extends GuiScreen {
mc.getTextureManager().bindTexture(GuiManual.texture);
int centerX = (width / 2) - guiWidth / 2;
int centerY = (height / 2) - guiHeight / 2;
drawTexturedModalRect(centerX, centerY, 0, 0, guiWidth, guiHeight);
blit(centerX, centerY, 0, 0, guiWidth, guiHeight);
int y = height / 4;
fontRenderer.drawString(text1, ((width / 2) - fontRenderer.getStringWidth(text1) / 2), height / 2 - (guiHeight / 4), 4210752);
fontRenderer.drawString(text2, ((width / 2) - fontRenderer.getStringWidth(text2) / 2), height / 2 + 5, 4210752);
font.draw(text1, ((width / 2) - font.getStringWidth(text1) / 2), height / 2 - (guiHeight / 4), 4210752);
font.draw(text2, ((width / 2) - font.getStringWidth(text2) / 2), height / 2 + 5, 4210752);
if(ItemManual.allowRefund){
fontRenderer.drawString(text3, ((width / 2) - fontRenderer.getStringWidth(text3) / 2), y + 100, 4210752);
font.draw(text3, ((width / 2) - font.getStringWidth(text3) / 2), y + 100, 4210752);
}
super.render(mouseX, mouseY, partialTicks);
}
@ -88,10 +88,10 @@ public class GuiManual extends GuiScreen {
public void onClick(GuiButtonExtended button, Double mouseX, Double mouseY){
switch (button.id) {
case 1:
mc.displayGuiScreen(new GuiConfirmOpenLink(this, "http://wiki.techreborn.ovh", 1, false));
mc.displayGuiScreen(new ConfirmChatLinkScreen(this, "http://wiki.techreborn.ovh", 1, false));
break;
case 2:
this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, "https://discord.gg/teamreborn", 2, false));
this.mc.displayGuiScreen(new ConfirmChatLinkScreen(this, "https://discord.gg/teamreborn", 2, false));
break;
case 3:
mc.displayGuiScreen(null);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier3.TileMatterFabricator;
@ -33,14 +33,14 @@ public class GuiMatterFabricator extends GuiBase {
TileMatterFabricator tile;
public GuiMatterFabricator(final EntityPlayer player, final TileMatterFabricator tile) {
public GuiMatterFabricator(final PlayerEntity player, final TileMatterFabricator tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
drawSlot(8, 72, layer);
@ -56,8 +56,8 @@ public class GuiMatterFabricator extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 83, 41, mouseX, mouseY, GuiBuilder.ProgressDirection.DOWN, layer);

View file

@ -24,9 +24,9 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraft.entity.player.PlayerEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.generator.TilePlasmaGenerator;
@ -35,7 +35,7 @@ import techreborn.tiles.generator.TilePlasmaGenerator;
* @author drcrazy
*
*/
@OnlyIn(Dist.CLIENT)
@Environment(EnvType.CLIENT)
public class GuiPlasmaGenerator extends GuiBase {
/**
@ -45,14 +45,14 @@ public class GuiPlasmaGenerator extends GuiBase {
*/
TilePlasmaGenerator tile;
public GuiPlasmaGenerator(final EntityPlayer player, final TilePlasmaGenerator tile) {
public GuiPlasmaGenerator(final PlayerEntity player, final TilePlasmaGenerator tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(25, 35, layer);
drawSlot(25, 55, layer);
@ -61,8 +61,8 @@ public class GuiPlasmaGenerator extends GuiBase {
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import techreborn.tiles.machine.tier3.TileQuantumChest;
@ -32,14 +32,14 @@ public class GuiQuantumChest extends GuiBase {
TileQuantumChest quantumChest;
public GuiQuantumChest(final EntityPlayer player, final TileQuantumChest quantumChest) {
public GuiQuantumChest(final PlayerEntity player, final TileQuantumChest quantumChest) {
super(player, quantumChest, quantumChest.createContainer(player));
this.quantumChest = quantumChest;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final Layer layer = Layer.BACKGROUND;
drawSlot(80, 24, layer);
@ -47,15 +47,15 @@ public class GuiQuantumChest extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
if (!this.quantumChest.storedItem.isEmpty() && !this.quantumChest.inventory.getStackInSlot(1).isEmpty()) {
this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.storedItem.getCount() + this.quantumChest.inventory.getStackInSlot(1).getCount(), this.quantumChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
if (!this.quantumChest.storedItem.isEmpty() && !this.quantumChest.inventory.getInvStack(1).isEmpty()) {
this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.storedItem.getAmount() + this.quantumChest.inventory.getInvStack(1).getAmount(), this.quantumChest.maxCapacity, mouseX - this.left, mouseY - this.top, "Stored", layer);
}
if (this.quantumChest.storedItem.isEmpty() && !this.quantumChest.inventory.getStackInSlot(1).isEmpty()) {
this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.inventory.getStackInSlot(1).getCount(), this.quantumChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
if (this.quantumChest.storedItem.isEmpty() && !this.quantumChest.inventory.getInvStack(1).isEmpty()) {
this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.inventory.getInvStack(1).getAmount(), this.quantumChest.maxCapacity, mouseX - this.left, mouseY - this.top, "Stored", layer);
}
}
}

View file

@ -24,8 +24,8 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fluids.FluidStack;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import techreborn.tiles.machine.tier3.TileQuantumTank;
@ -33,14 +33,14 @@ public class GuiQuantumTank extends GuiBase {
TileQuantumTank quantumTank;
public GuiQuantumTank(final EntityPlayer player, final TileQuantumTank quantumTank) {
public GuiQuantumTank(final PlayerEntity player, final TileQuantumTank quantumTank) {
super(player, quantumTank, quantumTank.createContainer(player));
this.quantumTank = quantumTank;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(80, 17, layer);
@ -49,16 +49,16 @@ public class GuiQuantumTank extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
FluidStack fluid = quantumTank.tank.getFluid();
if(fluid != null){
fontRenderer.drawString( "Fluid Type:", 10, 20, 4210752);
fontRenderer.drawString(fluid.getLocalizedName() + "", 10, 30, 4210752);
font.draw( "Fluid Type:", 10, 20, 4210752);
font.draw(fluid.getLocalizedName() + "", 10, 30, 4210752);
fontRenderer.drawString("Fluid Amount:", 10, 50, 4210752);
fontRenderer.drawString(quantumTank.tank.getFluidAmount() + "mb", 10, 60, 4210752);
font.draw("Fluid Amount:", 10, 50, 4210752);
font.draw(quantumTank.tank.getFluidAmount() + "mb", 10, 60, 4210752);
}
}
@ -66,6 +66,6 @@ public class GuiQuantumTank extends GuiBase {
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
super.render(mouseX, mouseY, partialTicks);
renderHoveredToolTip(mouseX, mouseY);
drawMouseoverTooltip(mouseX, mouseY);
}
}

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileRecycler;
@ -33,14 +33,14 @@ public class GuiRecycler extends GuiBase {
TileRecycler tile;
public GuiRecycler(final EntityPlayer player, final TileRecycler tile) {
public GuiRecycler(final PlayerEntity player, final TileRecycler tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(8, 72, layer);
@ -50,8 +50,8 @@ public class GuiRecycler extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.gaugeProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import reborncore.common.network.NetworkManager;
@ -35,14 +35,14 @@ public class GuiRollingMachine extends GuiBase {
TileRollingMachine rollingMachine;
public GuiRollingMachine(final EntityPlayer player, final TileRollingMachine tileRollingmachine) {
public GuiRollingMachine(final PlayerEntity player, final TileRollingMachine tileRollingmachine) {
super(player, tileRollingmachine, tileRollingmachine.createContainer(player));
this.rollingMachine = tileRollingmachine;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
int gridYPos = 22;
@ -64,8 +64,8 @@ public class GuiRollingMachine extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, rollingMachine.getProgressScaled(100), 100, 92, 43, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileScrapboxinator;
@ -33,14 +33,14 @@ public class GuiScrapboxinator extends GuiBase {
TileScrapboxinator tile;
public GuiScrapboxinator(final EntityPlayer player, final TileScrapboxinator tile) {
public GuiScrapboxinator(final PlayerEntity player, final TileScrapboxinator tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY);
protected void drawBackground(float partialTicks, int mouseX, int mouseY) {
super.drawBackground(partialTicks, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
// Battery slot
@ -54,8 +54,8 @@ public class GuiScrapboxinator extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.generator.advanced.TileSemiFluidGenerator;
@ -33,14 +33,14 @@ public class GuiSemifluidGenerator extends GuiBase {
TileSemiFluidGenerator tile;
public GuiSemifluidGenerator(final EntityPlayer player, final TileSemiFluidGenerator tile) {
public GuiSemifluidGenerator(final PlayerEntity player, final TileSemiFluidGenerator tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(25, 35, layer);
drawSlot(25, 55, layer);
@ -49,8 +49,8 @@ public class GuiSemifluidGenerator extends GuiBase {
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,7 +24,7 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.generator.advanced.TileThermalGenerator;
@ -33,14 +33,14 @@ public class GuiThermalGenerator extends GuiBase {
TileThermalGenerator tile;
public GuiThermalGenerator(final EntityPlayer player, final TileThermalGenerator tile) {
public GuiThermalGenerator(final PlayerEntity player, final TileThermalGenerator tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
drawSlot(25, 35, layer);
drawSlot(25, 55, layer);
@ -49,8 +49,8 @@ public class GuiThermalGenerator extends GuiBase {
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);

View file

@ -24,8 +24,8 @@
package techreborn.client.gui;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import reborncore.ClientProxy;
import reborncore.client.gui.builder.GuiBase;
@ -41,7 +41,7 @@ public class GuiVacuumFreezer extends GuiBase {
TileVacuumFreezer tile;
public GuiVacuumFreezer(final EntityPlayer player, final TileVacuumFreezer tile) {
public GuiVacuumFreezer(final PlayerEntity player, final TileVacuumFreezer tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@ -53,8 +53,8 @@ public class GuiVacuumFreezer extends GuiBase {
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
// Battery slot
@ -72,8 +72,8 @@ public class GuiVacuumFreezer extends GuiBase {
}
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
@ -93,8 +93,8 @@ public class GuiVacuumFreezer extends GuiBase {
{
// This code here makes a basic multiblock and then sets to the selected one.
final Multiblock multiblock = new Multiblock();
IBlockState advancedCasing = TRContent.MachineBlocks.ADVANCED.getCasing().getDefaultState();
IBlockState industrialCasing = TRContent.MachineBlocks.INDUSTRIAL.getCasing().getDefaultState();
BlockState advancedCasing = TRContent.MachineBlocks.ADVANCED.getCasing().getDefaultState();
BlockState industrialCasing = TRContent.MachineBlocks.INDUSTRIAL.getCasing().getDefaultState();
addComponent(0, -1, 0, advancedCasing, multiblock);
addComponent(1, -1, 0, advancedCasing, multiblock);
@ -136,7 +136,7 @@ public class GuiVacuumFreezer extends GuiBase {
}
}
public void addComponent(final int x, final int y, final int z, final IBlockState blockState, final Multiblock multiblock) {
public void addComponent(final int x, final int y, final int z, final BlockState blockState, final Multiblock multiblock) {
multiblock.addComponent(new BlockPos(x, y, z), blockState);
}
}

View file

@ -24,7 +24,7 @@
package techreborn.client.keybindings;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.client.options.KeyBinding;
import org.lwjgl.glfw.GLFW;
public class KeyBindings {

View file

@ -24,10 +24,10 @@
package techreborn.client.particle;
import net.minecraft.client.particle.ParticleSmokeLarge;
import net.minecraft.client.particle.FireSmokeLargeParticle;
import net.minecraft.world.World;
public class ParticleSmoke extends ParticleSmokeLarge {
public class ParticleSmoke extends FireSmokeLargeParticle {
public ParticleSmoke(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1201_8_, double p_i1201_10_, double p_i1201_12_) {
super(worldIn, xCoordIn, yCoordIn, zCoordIn, p_i1201_8_, p_i1201_10_, p_i1201_12_);

View file

@ -26,34 +26,35 @@ package techreborn.client.render;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import net.minecraft.client.render.VertexFormat;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.client.render.model.UnbakedModel;
import net.minecraft.client.render.model.json.ModelItemPropertyOverrideList;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.renderer.model.*;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.resources.IResourceManager;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.model.*;
import net.minecraftforge.common.model.IModelState;
import net.minecraftforge.common.model.TRSRTransformation;
import net.minecraftforge.fluids.Fluid;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.util.ModelIdentifier;
import net.minecraft.resource.ResourceManager;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Direction;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import java.awt.*;
import java.util.List;
import java.util.*;
import java.util.function.Function;
//TODO 1.13 very broken, look at ModelDynBucket for help porting this fully
@OnlyIn(Dist.CLIENT)
public class ModelDynamicCell implements IUnbakedModel {
@Environment(EnvType.CLIENT)
public class ModelDynamicCell implements UnbakedModel {
public static final ModelDynamicCell MODEL = new ModelDynamicCell(
new ResourceLocation("techreborn:items/cell_cover"),
new ResourceLocation("techreborn:items/cell_empty")
new Identifier("techreborn:items/cell_cover"),
new Identifier("techreborn:items/cell_empty")
);
public static final ModelResourceLocation MODEL_LOCATION = new ModelResourceLocation(new ResourceLocation("techreborn", "dynamic_cell"), "default");
public static final ModelIdentifier MODEL_LOCATION = new ModelIdentifier(new Identifier("techreborn", "dynamic_cell"), "default");
private static final float NORTH_Z_FLUID = 7.6f / 16f;
private static final float SOUTH_Z_FLUID = 8.4f / 16f;
@ -64,46 +65,46 @@ public class ModelDynamicCell implements IUnbakedModel {
ModelLoaderRegistry.registerLoader(new DynamicCellLoader());
}
private final ResourceLocation baseTexture;
private final ResourceLocation emptyTexture;
private final Identifier baseTexture;
private final Identifier emptyTexture;
private final Fluid fluid;
public ModelDynamicCell(ResourceLocation baseTexture, ResourceLocation emptyTexture) {
public ModelDynamicCell(Identifier baseTexture, Identifier emptyTexture) {
this(baseTexture, emptyTexture, null);
}
public ModelDynamicCell(ResourceLocation baseTexture, ResourceLocation emptyTexture, Fluid fluid) {
public ModelDynamicCell(Identifier baseTexture, Identifier emptyTexture, Fluid fluid) {
this.baseTexture = baseTexture;
this.emptyTexture = emptyTexture;
this.fluid = fluid;
}
@Override
public Collection<ResourceLocation> getDependencies() {
public Collection<Identifier> getModelDependencies() {
return ImmutableList.of();
}
@Override
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors) {
public Collection<Identifier> getTextureDependencies(Function<Identifier, UnbakedModel> modelGetter, Set<String> missingTextureErrors) {
return ImmutableList.of(baseTexture, emptyTexture);
}
@Override
public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> modelGetter, Function<ResourceLocation, TextureAtlasSprite> spriteGetter, IModelState state, boolean uvlock, VertexFormat format) {
public BakedModel bake(Function<Identifier, UnbakedModel> modelGetter, Function<Identifier, Sprite> spriteGetter, IModelState state, boolean uvlock, VertexFormat format) {
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap = PerspectiveMapWrapper.getTransforms(state);
ImmutableMap<ModelTransformation.Type, TRSRTransformation> transformMap = PerspectiveMapWrapper.getTransforms(state);
TRSRTransformation transform = state.apply(Optional.empty()).orElse(TRSRTransformation.identity());
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
builder.addAll(new ItemLayerModel(ImmutableList.of(baseTexture)).bake(modelGetter, spriteGetter, state, uvlock, format).getQuads(null, null, new Random()));
ResourceLocation sprite = fluid != null ? fluid.getStill() : emptyTexture;
Identifier sprite = fluid != null ? fluid.getStill() : emptyTexture;
int color = fluid != null ? fluid.getColor() : Color.WHITE.getRGB();
TextureAtlasSprite fluidSprite = spriteGetter.apply(sprite);
Sprite fluidSprite = spriteGetter.apply(sprite);
if (fluid != null) {
if (fluidSprite != null) {
builder.add(ItemTextureQuadConverter.genQuad(format, transform, 5, 2, 11, 14, NORTH_Z_FLUID, fluidSprite, EnumFacing.NORTH, color, -1));
builder.add(ItemTextureQuadConverter.genQuad(format, transform, 5, 2, 11, 14, SOUTH_Z_FLUID, fluidSprite, EnumFacing.SOUTH, color, -1));
builder.add(ItemTextureQuadConverter.genQuad(format, transform, 5, 2, 11, 14, NORTH_Z_FLUID, fluidSprite, Direction.NORTH, color, -1));
builder.add(ItemTextureQuadConverter.genQuad(format, transform, 5, 2, 11, 14, SOUTH_Z_FLUID, fluidSprite, Direction.SOUTH, color, -1));
}
}
@ -119,17 +120,17 @@ public class ModelDynamicCell implements IUnbakedModel {
public static class DynamicCellLoader implements ICustomModelLoader {
@Override
public boolean accepts(ResourceLocation modelLocation) {
public boolean accepts(Identifier modelLocation) {
return modelLocation.getNamespace().equals("techreborn") && modelLocation.getPath().contains("dynamic_cell");
}
@Override
public IUnbakedModel loadModel(ResourceLocation modelLocation) {
public UnbakedModel loadModel(Identifier modelLocation) {
return MODEL;
}
@Override
public void onResourceManagerReload(IResourceManager resourceManager) {}
public void onResourceManagerReload(ResourceManager resourceManager) {}
}
@ -137,15 +138,15 @@ public class ModelDynamicCell implements IUnbakedModel {
private final List<BakedQuad> quads;
private final ModelDynamicCell parent;
private final TextureAtlasSprite particle;
private final Sprite particle;
private final VertexFormat format;
private final ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap;
private final ImmutableMap<ModelTransformation.Type, TRSRTransformation> transformMap;
public BakedDynamicCell(ImmutableList<BakedQuad> quads,
ModelDynamicCell parent,
TextureAtlasSprite particle,
Sprite particle,
VertexFormat format,
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap) {
ImmutableMap<ModelTransformation.Type, TRSRTransformation> transformMap) {
super(quads, particle, transformMap, null /* TODO fix this */);
this.transformMap = transformMap;
this.quads = quads;
@ -170,17 +171,17 @@ public class ModelDynamicCell implements IUnbakedModel {
}
@Override
public TextureAtlasSprite getParticleTexture() {
public Sprite getParticleTexture() {
return particle;
}
@Override
public ItemCameraTransforms getItemCameraTransforms() {
public ModelTransformation getItemCameraTransforms() {
return ModelHelper.DEFAULT_ITEM_TRANSFORMS;
}
@Override
public ItemOverrideList getOverrides() {
public ModelItemPropertyOverrideList getOverrides() {
return OVERRIDES;
}
@ -188,9 +189,9 @@ public class ModelDynamicCell implements IUnbakedModel {
public static final OverrideHandler OVERRIDES = new OverrideHandler();
public static class OverrideHandler extends ItemOverrideList {
public static class OverrideHandler extends ModelItemPropertyOverrideList {
private final HashMap<String, IBakedModel> modelCache = new HashMap<>();
private final HashMap<String, BakedModel> modelCache = new HashMap<>();
// private final Function<ResourceLocation, TextureAtlasSprite> textureGetter = location ->
// Minecraft.getInstance().getTextureMapBlocks().getAtlasSprite(location.toString());

View file

@ -25,13 +25,13 @@
package techreborn.client.render;
import com.google.common.base.Charsets;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ModelBlock;
import net.minecraft.resources.IResource;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.model.json.JsonUnbakedModel;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.resource.Resource;
import net.minecraft.util.Identifier;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import techreborn.TechReborn;
import java.io.BufferedReader;
@ -42,16 +42,16 @@ import java.io.Reader;
/*
* Credits to JsonDestroyer
*/
@OnlyIn(Dist.CLIENT)
@Environment(EnvType.CLIENT)
public class ModelHelper {
public static final ItemCameraTransforms DEFAULT_ITEM_TRANSFORMS = loadTransformFromJson(new ResourceLocation("minecraft:models/item/generated"));
public static final ItemCameraTransforms HANDHELD_ITEM_TRANSFORMS = loadTransformFromJson(new ResourceLocation("minecraft:models/item/handheld"));
public static final ModelTransformation DEFAULT_ITEM_TRANSFORMS = loadTransformFromJson(new Identifier("minecraft:models/item/generated"));
public static final ModelTransformation HANDHELD_ITEM_TRANSFORMS = loadTransformFromJson(new Identifier("minecraft:models/item/handheld"));
public static ItemCameraTransforms loadTransformFromJson(ResourceLocation location) {
public static ModelTransformation loadTransformFromJson(Identifier location) {
try {
return ModelBlock.deserialize(getReaderForResource(location)).getAllTransforms();
return JsonUnbakedModel.deserialize(getReaderForResource(location)).getTransformations();
} catch (IOException exception) {
TechReborn.LOGGER.warn("Can't load resource " + location);
exception.printStackTrace();
@ -59,9 +59,9 @@ public class ModelHelper {
}
}
public static Reader getReaderForResource(ResourceLocation location) throws IOException {
ResourceLocation file = new ResourceLocation(location.getNamespace(), location.getPath() + ".json");
IResource iresource = Minecraft.getInstance().getResourceManager().getResource(file);
public static Reader getReaderForResource(Identifier location) throws IOException {
Identifier file = new Identifier(location.getNamespace(), location.getPath() + ".json");
Resource iresource = MinecraftClient.getInstance().getResourceManager().getResource(file);
return new BufferedReader(new InputStreamReader(iresource.getInputStream(), Charsets.UTF_8));
}

View file

@ -24,13 +24,14 @@
package techreborn.client.render.entitys;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.block.BlockRenderManager;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.render.entity.EntityRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.ResourceLocation;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
import techreborn.blocks.BlockNuke;
import techreborn.entities.EntityNukePrimed;
@ -39,20 +40,20 @@ import techreborn.init.TRContent;
/**
* Created by Mark on 13/03/2016.
*/
public class RenderNukePrimed extends Render<EntityNukePrimed> {
public class RenderNukePrimed extends EntityRenderer<EntityNukePrimed> {
public RenderNukePrimed(RenderManager renderManager) {
public RenderNukePrimed(EntityRenderDispatcher renderManager) {
super(renderManager);
this.shadowSize = 0.5F;
this.field_4673 = 0.5F;
}
@Override
public void doRender(EntityNukePrimed entity, double x, double y, double z, float entityYaw, float partialTicks) {
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
BlockRenderManager blockrendererdispatcher = MinecraftClient.getInstance().getBlockRenderManager();
GlStateManager.pushMatrix();
GlStateManager.translatef((float) x, (float) y + 0.5F, (float) z);
if ((float) entity.getFuse() - partialTicks + 1.0F < 10.0F) {
float f = 1.0F - ((float) entity.getFuse() - partialTicks + 1.0F) / 10.0F;
if ((float) entity.getFuseTimer() - partialTicks + 1.0F < 10.0F) {
float f = 1.0F - ((float) entity.getFuseTimer() - partialTicks + 1.0F) / 10.0F;
f = MathHelper.clamp(f, 0.0F, 1.0F);
f = f * f;
f = f * f;
@ -61,17 +62,17 @@ public class RenderNukePrimed extends Render<EntityNukePrimed> {
}
this.bindEntityTexture(entity);
GlStateManager.translatef(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(TRContent.NUKE.getDefaultState(),
entity.getBrightness());
blockrendererdispatcher.renderDynamic(TRContent.NUKE.getDefaultState(),
entity.getBrightnessAtEyes());
GlStateManager.translatef(0.0F, 0.0F, 1.0F);
if (entity.getFuse() / 5 % 2 == 0) {
if (entity.getFuseTimer() / 5 % 2 == 0) {
GlStateManager.disableLighting();
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 772);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1F);
GlStateManager.polygonOffset(-3.0F, -3.0F);
GlStateManager.enablePolygonOffset();
blockrendererdispatcher.renderBlockBrightness(
blockrendererdispatcher.renderDynamic(
TRContent.NUKE.getDefaultState().with(BlockNuke.OVERLAY, true), 1.0F);
GlStateManager.polygonOffset(0.0F, 0.0F);
GlStateManager.disablePolygonOffset();
@ -80,11 +81,11 @@ public class RenderNukePrimed extends Render<EntityNukePrimed> {
GlStateManager.enableLighting();
}
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
super.render(entity, x, y, z, entityYaw, partialTicks);
}
@Override
protected ResourceLocation getEntityTexture(EntityNukePrimed entity) {
return TextureMap.LOCATION_BLOCKS_TEXTURE;
protected Identifier getEntityTexture(EntityNukePrimed entity) {
return SpriteAtlasTexture.BLOCK_ATLAS_TEX;
}
}