Jump to content

[1.14.4] how to make a gui progress bar?


Kenneth201998

Recommended Posts

As I've started on a number of occasions:

Nothing prevents you from performing the cooking operation on the client, provided you synchronize the test of the data when appropriate. 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

2 hours ago, Kenneth201998 said:

the arrow and flame

Instead of drawing a whole arrow/flame, draw (progress / total) of the arrow/flame. You can still use the same textured-rectangle-drawing method you always use. You can always look in some source classes to get a better idea of what you're doing, too.

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

Link to comment
Share on other sites

5 hours ago, Kenneth201998 said:

Im talking about the arrow and flame you see in the furnace gui... 

Wow, what a surprise.

So am I.

See this line here? Notice that this executes even when isRemote is true? That's because the client utilizes the same logic the server uses to update the smelting arrow.

https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/client/gui/SifterGuiContainer.java#L46

https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/entity/SifterTileEntity.java#L182

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

10 hours ago, Draco18s said:

Wow, what a surprise.

So am I.

See this line here? Notice that this executes even when isRemote is true? That's because the client utilizes the same logic the server uses to update the smelting arrow.

https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/client/gui/SifterGuiContainer.java#L46

https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/entity/SifterTileEntity.java#L182

where does the 40 come from in you blit function?

Link to comment
Share on other sites

Can you help me with this? I am not sure where you are getting your numbers in you blit function from but I can give you the GUI I created so you can help me get those numbers:

smelting_furnace_gui_1.png

There is a free program:

https://pixlr.com/editor/

It allows you to see the coordinates of each pixel by hovering over the image.

 

Edited by Kenneth201998
Link to comment
Share on other sites

2 hours ago, Kenneth201998 said:

where does the 40 come from in you blit function?

That happens to be the maximum time:

https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/entity/SifterTileEntity.java#L90

Timer gets set to 40 and it counts down (values like this one being more as "abort, wait for valid inputs")

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Ok so I have:

package com.kenneths_medieval_mod.objects.blocks.workstations.smelting_forge;

import org.lwjgl.opengl.GL11;

import com.kenneths_medieval_mod.KenmodMain;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;

public class SmeltingForgeGUI extends ContainerScreen<SmeltingForgeContainer> {
	
	SmeltingForgeTileEntity tile_entity;
	
	private static final ResourceLocation texture = new ResourceLocation("kenmod:textures/gui/smelting_forge_gui_1.png");
	
	public SmeltingForgeGUI(SmeltingForgeContainer screenContainer, PlayerInventory inv, ITextComponent titleIn) {
		super(screenContainer, inv, titleIn);
		this.xSize = 176;
		this.ySize = 166;
		this.tile_entity = (SmeltingForgeTileEntity)screenContainer.tile_entity;
	}
	@Override
	public void render(int mouseX, int mouseY, float partialTicks) {
		this.renderBackground();
		super.render(mouseX, mouseY, partialTicks);
		this.renderHoveredToolTip(mouseX, mouseY);
	}
	@Override
	protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
		GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
		Minecraft.getInstance().getTextureManager().bindTexture(texture);
		int k = (this.width - this.xSize) / 2;
		int l = (this.height - this.ySize) / 2;
		this.blit(k, l, 0, 0, this.xSize, this.ySize);
		
		if(tile_entity != null) {
			//int burn_time = Math.round(24 * (100 - tile_entity.getBurnTime()) / 100);
			int cook_progress = Math.round(24 / tile_entity.getCookProgress());
			int le = this.guiLeft;
			int to = this.guiTop;
			
			//this.blit(le + 17, to + 40, 176, 14, burn_time + 1, 16);
			this.blit(le + 67, to + 39, 176, 14, cook_progress + 1, 16);
		}
	}
	@Override
	public void tick() {
		super.tick();
	}
	@Override
	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
		this.font.drawString("Smelting Forge", 16, 5, -1);
	}
	@Override
	public void removed() {
		super.removed();
		Minecraft.getInstance().keyboardListener.enableRepeatEvents(false);
	}
	@Override
	public void init(Minecraft minecraft, int width, int height) {
		super.init(minecraft, width, height);
		minecraft.keyboardListener.enableRepeatEvents(true);
	}
}

And:

package com.kenneths_medieval_mod.objects.blocks.workstations.smelting_forge;

import com.kenneths_medieval_mod.objects.blocks.BlockList;

import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.ITickableTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fml.network.NetworkHooks;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;

public class SmeltingForgeTileEntity extends TileEntity implements ITickableTileEntity, INamedContainerProvider {
	
	protected ItemStackHandler slots = new ItemStackHandler();
	private final LazyOptional<IItemHandler> slots_holder = LazyOptional.of(() -> slots);
	private int burn_time;
	private int cook_progress;
	private int cook_goal = 200;
	
	public SmeltingForgeTileEntity() {
		super(BlockList.smelting_forge_tile_entity);
		slots = new ItemStackHandler();
		slots.setSize(4);
	}
	
	@Override
	public void tick() {
		//Fuel sent to the furnace has a max fuel life.
		if(burn_time < 1000 && slots.getStackInSlot(0) != ItemStack.EMPTY) {
			burn_time++;
			if(cook_progress < cook_goal) {
				cook_progress++;
			} else {
				cook_progress = 0;
			}
		} else {
			//When burn time reaches max fuel life get more fuel and reset the burn timer:
			burn_time = 0;
		}
	}
	
	public float getCookProgress () {
		return Math.round(cook_progress + 1 / cook_goal);
	}
	public int getBurnTime () {
		return burn_time;
	}
	
	@Override
	public void read(CompoundNBT tag) {
		super.read(tag);
		slots.deserializeNBT(tag.getCompound("kenmod:slots"));
		burn_time = tag.getInt("kenmod:burn_time");
		cook_progress = tag.getInt("kenmod:cook_progress");
	}
	@Override
	public CompoundNBT write(CompoundNBT tag) {
		super.write(tag);
		tag.put("kenmodlcb:slots", slots.serializeNBT());
		tag.putInt("kenmod:burn_time", burn_time);
		tag.putInt("kenmod:cook_progress", cook_progress);
		return tag;
	}
	@Override
	public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
		if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
			return slots_holder.cast();
		}
		return super.getCapability(cap, side);
	}
	@Override
	public Container createMenu(int id, PlayerInventory player_inventory, PlayerEntity player) {
		return new SmeltingForgeContainer(id, player_inventory, slots, this);
	}
	@Override
	public ITextComponent getDisplayName() {
		return new StringTextComponent("block.kenmodlcb.furnace_station");
	}
	
	public void openGUI (ServerPlayerEntity player) {
		if(!world.isRemote) {
			NetworkHooks.openGui(player, this, getPos());
		}
	}
}

But the arrow does not update. Whats wrong?

Link to comment
Share on other sites

You need to synchronize the data to the client. 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Just to note, for simple data like an integer progress value, you can take advantage of the vanilla Container#trackInt() method to automatically sync values from server to client while the container is open.  The vanilla furnace uses it, and McJty has a tutorial about it here: https://wiki.mcjty.eu/modding/index.php?title=Tut14_Ep5 ("Showing Energy in GUI").

 

But beware - despite the method's name, it will only sync up to 16 bits of data - see SWindowPropertyPacket.  Shouldn't be a problem in this case, however.

  • Thanks 1
Link to comment
Share on other sites

I wonder if there are some methods in the tile entity class regarding update packets.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

huh... this is odd:

when I use:

public float getCookProgress () {
	float test0 = cook_progress;
	KenmodMain.debugString("test0: " + test0);
	float test1 = cook_goal;
	KenmodMain.debugString("test1: " + test1);
	float test2 = ((float)cook_progress + 1.0F) / (float)cook_goal;
	KenmodMain.debugString("Get cook progress: " + test2);
	return test2;
}

the arrow updates, but only when I save and quit, and rejoin the world.

18 minutes ago, Draco18s said:

I wonder if there are some methods in the tile entity class regarding update packets.

package com.kenneths_medieval_mod.objects.blocks.workstations.smelting_forge;

import com.kenneths_medieval_mod.KenmodMain;
import com.kenneths_medieval_mod.objects.blocks.BlockList;

import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SUpdateTileEntityPacket;
import net.minecraft.tileentity.ITickableTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fml.network.NetworkHooks;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;

public class SmeltingForgeTileEntity extends TileEntity implements ITickableTileEntity, INamedContainerProvider {
	
	protected ItemStackHandler slots = new ItemStackHandler();
	private final LazyOptional<IItemHandler> slots_holder = LazyOptional.of(() -> slots);
	private int burn_time;
	private int cook_progress;
	private int cook_goal = 200;
	
	public SmeltingForgeTileEntity() {
		super(BlockList.smelting_forge_tile_entity);
		slots = new ItemStackHandler();
		slots.setSize(4);
	}
	
	@Override
	public void tick() {
		//Fuel sent to the furnace has a max fuel life.
		if(burn_time < 1000 && slots.getStackInSlot(0) != ItemStack.EMPTY) {
			burn_time++;
			
			cook_progress++;
			KenmodMain.debugString("cp: " + cook_progress);
			if(cook_progress >= cook_goal) {
				cook_progress = 0;
			}
		} else {
			//When burn time reaches max fuel life get more fuel and reset the burn timer:
			burn_time = 0;
		}
		markDirty();
	}
	
	public float getCookProgress () {
		float test0 = cook_progress;
		KenmodMain.debugString("test0: " + test0);
		float test1 = cook_goal;
		KenmodMain.debugString("test1: " + test1);
		float test2 = ((float)cook_progress + 1.0F) / (float)cook_goal;
		KenmodMain.debugString("Get cook progress: " + test2);
		return test2;
	}
	public int getBurnTime () {
		return burn_time;
	}
	
	@Override
	public SUpdateTileEntityPacket getUpdatePacket() {
		return new SUpdateTileEntityPacket(this.pos, 0, this.getUpdateTag());
	}
	@Override
	public CompoundNBT getUpdateTag() {
		return this.write(new CompoundNBT());
	}
	@Override
	public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) {
		read(pkt.getNbtCompound());
	}
	
	@Override
	public void read(CompoundNBT tag) {
		super.read(tag);
		slots.deserializeNBT(tag.getCompound("kenmod:slots"));
		burn_time = tag.getInt("kenmod:burn_time");
		cook_progress = tag.getInt("kenmod:cook_progress");
	}
	@Override
	public CompoundNBT write(CompoundNBT tag) {
		super.write(tag);
		tag.put("kenmod:slots", slots.serializeNBT());
		tag.putInt("kenmod:burn_time", burn_time);
		tag.putInt("kenmod:cook_progress", cook_progress);
		return tag;
	}
	@Override
	public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
		if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
			return slots_holder.cast();
		}
		return super.getCapability(cap, side);
	}
	@Override
	public Container createMenu(int id, PlayerInventory player_inventory, PlayerEntity player) {
		return new SmeltingForgeContainer(id, player_inventory, slots, this);
	}
	@Override
	public ITextComponent getDisplayName() {
		return new StringTextComponent("block.kenmodlcb.furnace_station");
	}
	
	public void openGUI (ServerPlayerEntity player) {
		if(!world.isRemote) {
			NetworkHooks.openGui(player, this, getPos());
		}
	}
}

 

Link to comment
Share on other sites

43 minutes ago, Kenneth201998 said:

but only when I save and quit, and rejoin the world.

Because tile entity data is only "automatically" "synchronized" upon loading the world (quotes, because the way it works isn't really automatic and isn't really synchronizing, its just that certain vanilla calls regarding loading the TE from disk in single player has this net result).

 

44 minutes ago, Kenneth201998 said:

markDirty();

Don't do this every tick. Your burn time only really needs to be synchronized when the item slots change because your TE is already ticking the burn time on the client.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

13 hours ago, Kenneth201998 said:

This thing of getting the progress bar to update still eludes me. Know any example code? 

I will refer you to my previous comment in this thread.  Go and look up McJty's tutorial that I linked (although it's for syncing an energy value, the same principle of syncing an int value applies).  And also take a look at the vanilla furnace code, which uses that tracked int system.

Link to comment
Share on other sites

Ok. So I created my own capability known as Progress:

package com.kenneth.hard_survival_craft.objects.custom_capabilities;

public interface IProgress {
	void incrementProgress (int ammount);
	int getProgress ();
	void setProgress (int ammount);
}
package com.kenneth.hard_survival_craft.objects.custom_capabilities;

import net.minecraft.nbt.CompoundNBT;
import net.minecraftforge.common.util.INBTSerializable;

public class Progress implements IProgress, INBTSerializable<CompoundNBT> {
	
	protected int progress;
	
	public Progress(int progress) {
		this.progress = progress;
	}
	
	@Override
	public void incrementProgress(int ammount) {
		this.progress += ammount;
	}

	@Override
	public int getProgress() {
		return progress;
	}

	@Override
	public void setProgress(int ammount) {
		this.progress = ammount;
	}

	@Override
	public CompoundNBT serializeNBT() {
		CompoundNBT tag = new CompoundNBT();
		tag.putInt("progress", getProgress());
		return tag;
	}

	@Override
	public void deserializeNBT(CompoundNBT nbt) {
		setProgress(nbt.getInt("progress"));
	}
}
package com.kenneth.hard_survival_craft.objects.custom_capabilities;

import net.minecraft.nbt.INBT;
import net.minecraft.nbt.IntNBT;
import net.minecraft.util.Direction;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.common.capabilities.CapabilityManager;

public class CapabilityProgress {
	
	@CapabilityInject(IProgress.class)
	public static Capability<IProgress> PROGRESS = null;
	
	public static void register () {
		CapabilityManager.INSTANCE.register(IProgress.class, new Capability.IStorage<IProgress> () {
			@Override
			public INBT writeNBT(Capability<IProgress> capability, IProgress instance, Direction side) {
				return new IntNBT(instance.getProgress());
			}
			@Override
			public void readNBT(Capability<IProgress> capability, IProgress instance, Direction side, INBT nbt) {
				if(!(instance instanceof Progress)) {
					throw new IllegalArgumentException("Can not deserialize to an instance that isn't the default implementation");
				}
				((Progress)instance).progress = ((IntNBT)nbt).getInt();
			}
			
		}, () -> new Progress(0));
	}
	
}

Then I added it to my tile entity as so:

package com.kenneth.hard_survival_craft.objects.blocks.workstations.smelting_forge;

import com.kenneth.hard_survival_craft.KenmodMain;
import com.kenneth.hard_survival_craft.objects.blocks.BlockList;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.CapabilityProgress;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.IProgress;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.Progress;

import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SUpdateTileEntityPacket;
import net.minecraft.tileentity.ITickableTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.INBTSerializable;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fml.network.NetworkHooks;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;

public class SmeltingForgeTileEntity extends TileEntity implements ITickableTileEntity, INamedContainerProvider {
	
	protected ItemStackHandler slots = new ItemStackHandler();
	private LazyOptional<IItemHandler> slots_holder = LazyOptional.of(() -> slots);
	private LazyOptional<IProgress> progress = LazyOptional.of(this::createProgress);
	
	private int burn_time;
	private int cook_progress;
	private int cook_goal = 200;
	
	public SmeltingForgeTileEntity() {
		super(BlockList.smelting_forge_tile_entity);
		slots = new ItemStackHandler();
		slots.setSize(4);
	}

	@Override
	public void tick() {
		//Fuel sent to the furnace has a max fuel life.
		if(burn_time < 1000 && slots.getStackInSlot(0) != ItemStack.EMPTY) {
			burn_time++;
			
			cook_progress++;
			getCookProgress();
			if(cook_progress >= cook_goal) {
				cook_progress = 0;
			}
		} else {
			//When burn time reaches max fuel life get more fuel and reset the burn timer:
			burn_time = 0;
		}
		markDirty();
	}
	
	public int getCookProgress() {
		int prog = this.getCapability(CapabilityProgress.PROGRESS).map(IProgress::getProgress).orElse(0) + 1;
		KenmodMain.debugString("Progress: " + prog);
		return prog;
	}
	public int getCookGoal () {
		KenmodMain.debugString("Cook Goal: " + cook_goal);
		return cook_goal;
	}
	
	private IProgress createProgress () {
		return new Progress(0);
	}
	
	@Override
	public SUpdateTileEntityPacket getUpdatePacket() {
		return new SUpdateTileEntityPacket(this.pos, 0, this.getUpdateTag());
	}
	@Override
	public CompoundNBT getUpdateTag() {
		return this.write(new CompoundNBT());
	}
	@Override
	public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) {
		read(pkt.getNbtCompound());
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public void read(CompoundNBT tag) {
		slots.deserializeNBT(tag.getCompound("slots"));
		CompoundNBT progressTag = tag.getCompound("progress");
		progress.ifPresent(h -> ((INBTSerializable<CompoundNBT>)h).deserializeNBT(progressTag));
		super.read(tag);
	}
	@SuppressWarnings("unchecked")
	@Override
	public CompoundNBT write(CompoundNBT tag) {
		tag.put("slots", slots.serializeNBT());
		progress.ifPresent(h -> {
			CompoundNBT compound = ((INBTSerializable<CompoundNBT>)h).serializeNBT();
			tag.put("progress", compound);
		});
		return super.write(tag);
	}
	@Override
	public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
		if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
			return slots_holder.cast();
		}
		if(cap == CapabilityProgress.PROGRESS) {
			return progress.cast();
		}
		return super.getCapability(cap, side);
	}
	@Override
	public Container createMenu(int id, PlayerInventory player_inventory, PlayerEntity player) {
		return new SmeltingForgeContainer(id, player_inventory, slots, this);
	}
	@Override
	public ITextComponent getDisplayName() {
		return new StringTextComponent("block.kenmodlcb.furnace_station");
	}
	
	public void openGUI (ServerPlayerEntity player) {
		if(!world.isRemote) {
			NetworkHooks.openGui(player, this, getPos());
		}
	}
}

And to the container:

package com.kenneth.hard_survival_craft.objects.blocks.workstations.smelting_forge;

import com.kenneth.hard_survival_craft.objects.blocks.BlockList;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.CapabilityProgress;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.IProgress;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.Progress;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.IntReferenceHolder;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;
import net.minecraftforge.items.SlotItemHandler;

public class SmeltingForgeContainer extends Container {
	
	SmeltingForgeTileEntity tile_entity;
	
	@OnlyIn(Dist.CLIENT)
	public SmeltingForgeContainer (int id, PlayerInventory player_inventory, PacketBuffer extra_data) {
		this(id, player_inventory, new ItemStackHandler(4), (SmeltingForgeTileEntity)Minecraft.getInstance().world.getTileEntity(extra_data.readBlockPos()));
	}
	public SmeltingForgeContainer(int id, PlayerInventory player_inventory, IItemHandler smelting_forge_inventory, SmeltingForgeTileEntity te) {
		super(BlockList.smelting_forge_container, id);
		this.addSlot(new SlotItemHandler(smelting_forge_inventory, 0, 17, 21));
		this.addSlot(new SlotItemHandler(smelting_forge_inventory, 1, 44, 21));
		this.addSlot(new SlotItemHandler(smelting_forge_inventory, 2, 17, 57));
		this.addSlot(new SlotItemHandler(smelting_forge_inventory, 3, 98, 39) {
			@Override
			public boolean isItemValid(ItemStack stack) {
				return false;
			}
		});
		int si;
		int sj;
		for (si = 0; si < 3; ++si) {
			for (sj = 0; sj < 9; ++sj) {
				this.addSlot(new Slot(player_inventory, sj + (si + 1) * 9, 0 + 8 + sj * 18, 0 + 84 + si * 18));
			}
		}
		for (si = 0; si < 9; ++si) {
			this.addSlot(new Slot(player_inventory, si, 0 + 8 + si * 18, 0 + 142));
		}
		this.tile_entity = te;
		trackInt(new IntReferenceHolder() {
			@Override
			public void set(int value) {
				tile_entity.getCapability(CapabilityProgress.PROGRESS).ifPresent(h -> ((Progress)h).setProgress(value));
			}
			@Override
			public int get() {
				return getProgress();
			}
		});
	}
	@Override
	public ItemStack transferStackInSlot(PlayerEntity playerIn, int index) {
		ItemStack itemstack = ItemStack.EMPTY;
		Slot slot = (Slot) this.inventorySlots.get(index);
		if (slot != null && slot.getHasStack()) {
			ItemStack itemstack1 = slot.getStack();
			itemstack = itemstack1.copy();
			if (index < 4) {
				if (!this.mergeItemStack(itemstack1, 4, this.inventorySlots.size(), true)) {
					return ItemStack.EMPTY;
				}
				slot.onSlotChange(itemstack1, itemstack);
			} else if (!this.mergeItemStack(itemstack1, 0, 4, false)) {
				if (index < 4 + 27) {
					if (!this.mergeItemStack(itemstack1, 4 + 27, this.inventorySlots.size(), true)) {
						return ItemStack.EMPTY;
					}
				} else {
					if (!this.mergeItemStack(itemstack1, 4, 4 + 27, false)) {
						return ItemStack.EMPTY;
					}
				}
				return ItemStack.EMPTY;
			}
			if (itemstack1.getCount() == 0) {
				slot.putStack(ItemStack.EMPTY);
			} else {
				slot.onSlotChanged();
			}
			if (itemstack1.getCount() == itemstack.getCount()) {
				return ItemStack.EMPTY;
			}
			slot.onTake(playerIn, itemstack1);
		}
		return itemstack;
	}
	@Override
	protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean reverseDirection) {
		boolean flag = false;
		int i = startIndex;
		if (reverseDirection) {
			i = endIndex - 1;
		}
		if (stack.isStackable()) {
			while (!stack.isEmpty()) {
				if (reverseDirection) {
					if (i < startIndex) {
						break;
					}
				} else if (i >= endIndex) {
					break;
				}
				Slot slot = this.inventorySlots.get(i);
				ItemStack itemstack = slot.getStack();
				if (slot.isItemValid(itemstack) && !itemstack.isEmpty() && areItemsAndTagsEqual(stack, itemstack)) {
					int j = itemstack.getCount() + stack.getCount();
					int maxSize = Math.min(slot.getSlotStackLimit(), stack.getMaxStackSize());
					if (j <= maxSize) {
						stack.setCount(0);
						itemstack.setCount(j);
						slot.putStack(itemstack);
						flag = true;
					} else if (itemstack.getCount() < maxSize) {
						stack.shrink(maxSize - itemstack.getCount());
						itemstack.setCount(maxSize);
						slot.putStack(itemstack);
						flag = true;
					}
				}
				if (reverseDirection) {
					--i;
				} else {
					++i;
				}
			}
		}
		if (!stack.isEmpty()) {
			if (reverseDirection) {
				i = endIndex - 1;
			} else {
				i = startIndex;
			}
			while (true) {
				if (reverseDirection) {
					if (i < startIndex) {
						break;
					}
				} else if (i >= endIndex) {
					break;
				}
				Slot slot1 = this.inventorySlots.get(i);
				ItemStack itemstack1 = slot1.getStack();
				if (itemstack1.isEmpty() && slot1.isItemValid(stack)) {
					if (stack.getCount() > slot1.getSlotStackLimit()) {
						slot1.putStack(stack.split(slot1.getSlotStackLimit()));
					} else {
						slot1.putStack(stack.split(stack.getCount()));
					}
					slot1.onSlotChanged();
					flag = true;
					break;
				}
				if (reverseDirection) {
					--i;
				} else {
					++i;
				}
			}
		}
		return flag;
	}
	public int getProgress () {
		return tile_entity.getCapability(CapabilityProgress.PROGRESS).map(IProgress::getProgress).orElse(0);
	}
	public int getGoal () {
		return tile_entity.getCookGoal();
	}
	@Override
	public void onContainerClosed(PlayerEntity playerIn) {
		super.onContainerClosed(playerIn);
	}
	@Override
	public boolean canInteractWith(PlayerEntity playerIn) {
		return true;
	}
}

And the gui screen:

package com.kenneth.hard_survival_craft.objects.blocks.workstations.smelting_forge;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;

public class SmeltingForgeGUI extends ContainerScreen<SmeltingForgeContainer> {
	
	private static final ResourceLocation texture = new ResourceLocation("kenmod:textures/gui/smelting_forge_gui.png");
	
	public SmeltingForgeGUI(SmeltingForgeContainer screenContainer, PlayerInventory inv, ITextComponent titleIn) {
		super(screenContainer, inv, titleIn);
		this.xSize = 176;
		this.ySize = 166;
	}
	
	@Override
	public void render(int mouseX, int mouseY, float partialTicks) {
		this.renderBackground();
		super.render(mouseX, mouseY, partialTicks);
		this.renderHoveredToolTip(mouseX, mouseY);
	}
	@Override
	protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
		GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
		Minecraft.getInstance().getTextureManager().bindTexture(texture);
		int k = (this.width - this.xSize) / 2;
		int l = (this.height - this.ySize) / 2;
		this.blit(k, l, 0, 0, this.xSize, this.ySize);
		
		int cook_progress = Math.round(24 * getCookProgressScaled());
		int le = this.guiLeft;
		int to = this.guiTop;
		this.blit(le + 67, to + 39, 176, 14, cook_progress + 1, 16);
	}
	private float getCookProgressScaled () {
		int prog = container.getProgress();
		int goal = container.getGoal();
		return (float)prog / (float) goal;
	}
	@Override
	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
		this.font.drawString("Smelting Forge", 16, 5, -1);
	}
	@Override
	public void tick() {
		super.tick();
	}
	@Override
	public void removed() {
		super.removed();
		Minecraft.getInstance().keyboardListener.enableRepeatEvents(false);
	}
	@Override
	public void init(Minecraft minecraft, int width, int height) {
		super.init(minecraft, width, height);
		minecraft.keyboardListener.enableRepeatEvents(true);
	}
}

However it sill does not update the progress bar. And when the line: 

KenmodMain.debugString("Progress: " + prog);

is called in my tile entity it still returns 1.

 

Still need help with this. Can someone at least tell me if I am getting close?

Link to comment
Share on other sites

Ok I have ran into one more problem:

package com.kenneth.hard_survival_craft.objects.blocks.workstations.smelting_forge;

import com.kenneth.hard_survival_craft.objects.blocks.BlockList;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.CapabilityProgress;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.CapabilityProgressGoal;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.CapabilityBurnTime;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.IProgress;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.IProgressGoal;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.IBurnTime;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.Progress;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.ProgressGoal;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.BurnTime;

import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SUpdateTileEntityPacket;
import net.minecraft.tileentity.ITickableTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.INBTSerializable;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fml.network.NetworkHooks;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;

public class SmeltingForgeTileEntity extends TileEntity implements ITickableTileEntity, INamedContainerProvider {
	
	protected ItemStackHandler slots = new ItemStackHandler();
	private LazyOptional<IItemHandler> slots_holder = LazyOptional.of(() -> slots);
	private LazyOptional<IProgress> progress = LazyOptional.of(this::createProgress);
	private LazyOptional<IProgressGoal> progress_goal = LazyOptional.of(this::createGoal);
	private LazyOptional<IBurnTime> burn_time = LazyOptional.of(this::createBurnTime);
	
	public SmeltingForgeTileEntity() {
		super(BlockList.smelting_forge_tile_entity);
		slots = new ItemStackHandler();
		slots.setSize(4);
	}

	@Override
	public void tick() {
		
		if(getProgressGoal() != 300) {
			setGoal(300);
		}
		
		if(itemsValid() && (getBurnTime() > 0 || hasFuel())) {
			incrementProgress(1);
			if(getProgress() >= getProgressGoal()) {
				smelt();
				setProgress(0);
			}
		} else if (getProgress() > 0){
			decrementProgress(1);
		}
		
		
		//Decrement burn time:
		if(getBurnTime() > 0) {
			decrementBurn(1);
		} else if (hasFuel() && itemsValid()) {
			//If burn time reaches zero and there is still fuel and there is items left to smelt then reset the burn time:
			setBurn(400);
			slots.getStackInSlot(2).shrink(1);
		}
		
		if(isBurning() && world.getBlockState(pos).get(SmeltingForge.LIT) == false) {
			world.setBlockState(pos, world.getBlockState(pos).with(SmeltingForge.LIT, true).with(SmeltingForge.FACING, world.getBlockState(pos).get(SmeltingForge.FACING)));
		} else if (!isBurning() && world.getBlockState(pos).get(SmeltingForge.LIT) == true){
			world.setBlockState(pos, world.getBlockState(pos).with(SmeltingForge.LIT, false).with(SmeltingForge.FACING, world.getBlockState(pos).get(SmeltingForge.FACING)));
		}
		
		markDirty();
	}
	
	public boolean isBurning () {
		return getBurnTime() > 0 || (hasFuel() && itemsValid());
	}
	
	//Check if there is fuel left in slot 2:
	private boolean hasFuel () {
		if(slots.getStackInSlot(2).getItem() == Items.COAL || slots.getStackInSlot(2).getItem() == Items.CHARCOAL) {
			return true;
		}
		return false;
	}
	
	//Check if the inventory has proper items for smelting:
	private boolean itemsValid () {
		if(slots.getStackInSlot(0).getItem() == Items.IRON_INGOT && ((slots.getStackInSlot(3).getItem() == Items.GOLD_INGOT && slots.getStackInSlot(3).getCount() < slots.getStackInSlot(3).getMaxStackSize()) || slots.getStackInSlot(3) == ItemStack.EMPTY) && (slots.getStackInSlot(1).getItem() == Items.COAL || slots.getStackInSlot(1).getItem() == Items.CHARCOAL)) {
			return true;
		}
		return false;
	}
	//Smelt something:
	private void smelt () {
		if(slots.getStackInSlot(3) == ItemStack.EMPTY) {
			slots.setStackInSlot(3, new ItemStack(Items.GOLD_INGOT, 1));
		} else {
			slots.getStackInSlot(3).setCount(slots.getStackInSlot(3).getCount() + 1);
		}
		slots.getStackInSlot(0).shrink(1);
		slots.getStackInSlot(1).shrink(1);
	}
	
	public int getProgress() {
		int prog = this.getCapability(CapabilityProgress.PROGRESS).map(IProgress::getProgress).orElse(0);
		return prog;
	}
	public int getProgressGoal () {
		int goal = this.getCapability(CapabilityProgressGoal.PROGRESS_GOAL).map(IProgressGoal::getGoal).orElse(0) + 1;
		return goal;
	}
	public int getBurnTime () {
		int burn = this.getCapability(CapabilityBurnTime.BURN_TIME).map(IBurnTime::getBurnTime).orElse(0);
		return burn;
	}
	private void incrementProgress (int amount) {
		progress.ifPresent(p -> ((Progress)p).incrementProgress(amount));
	}
	private void decrementProgress (int amount) {
		progress.ifPresent(p -> ((Progress)p).decrementProgress(amount));
	}
	private void setProgress (int amount) {
		progress.ifPresent(p -> ((Progress)p).setProgress(amount));
	}
	private void setGoal (int amount) {
		progress_goal.ifPresent(g -> ((ProgressGoal)g).setGoal(amount));
	}
	private void decrementBurn (int amount) {
		burn_time.ifPresent(b -> ((BurnTime)b).decrementBurnTime(amount));
	}
	private void setBurn (int amount) {
		burn_time.ifPresent(b -> ((BurnTime)b).setBurnTime(amount));
	}
	
	private IProgress createProgress () {
		return new Progress(0);
	}
	private IProgressGoal createGoal () {
		return new ProgressGoal(0);
	}
	private IBurnTime createBurnTime () {
		return new BurnTime(0);
	}
	
	@Override
	public SUpdateTileEntityPacket getUpdatePacket() {
		return new SUpdateTileEntityPacket(this.pos, 0, this.getUpdateTag());
	}
	@Override
	public CompoundNBT getUpdateTag() {
		return this.write(new CompoundNBT());
	}
	@Override
	public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) {
		read(pkt.getNbtCompound());
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public void read(CompoundNBT tag) {
		slots.deserializeNBT(tag.getCompound("slots"));
		CompoundNBT progressTag = tag.getCompound("progress");
		CompoundNBT progessGoalTag = tag.getCompound("progress_goal");
		CompoundNBT burnTimeTag = tag.getCompound("burn_time");
		progress.ifPresent(h -> ((INBTSerializable<CompoundNBT>)h).deserializeNBT(progressTag));
		progress_goal.ifPresent(i -> ((INBTSerializable<CompoundNBT>)i).deserializeNBT(progessGoalTag));
		burn_time.ifPresent(j -> ((INBTSerializable<CompoundNBT>)j).deserializeNBT(burnTimeTag));
		super.read(tag);
	}
	@SuppressWarnings("unchecked")
	@Override
	public CompoundNBT write(CompoundNBT tag) {
		tag.put("slots", slots.serializeNBT());
		progress.ifPresent(h -> {
			CompoundNBT compound = ((INBTSerializable<CompoundNBT>)h).serializeNBT();
			tag.put("progress", compound);
		});
		progress_goal.ifPresent(i -> {
			CompoundNBT compound = ((INBTSerializable<CompoundNBT>)i).serializeNBT();
			tag.put("progress_goal", compound);
		});
		burn_time.ifPresent(j -> {
			CompoundNBT compound = ((INBTSerializable<CompoundNBT>)j).serializeNBT();
			tag.put("burn_time", compound);
		});
		return super.write(tag);
	}
	@Override
	public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
		if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
			return slots_holder.cast();
		}
		if(cap == CapabilityProgress.PROGRESS) {
			return progress.cast();
		}
		if(cap == CapabilityProgressGoal.PROGRESS_GOAL) {
			return progress_goal.cast();
		}
		if(cap == CapabilityBurnTime.BURN_TIME) {
			return burn_time.cast();
		}
		return super.getCapability(cap, side);
	}
	@Override
	public Container createMenu(int id, PlayerInventory player_inventory, PlayerEntity player) {
		return new SmeltingForgeContainer(id, player_inventory, slots, this);
	}
	@Override
	public ITextComponent getDisplayName() {
		return new StringTextComponent("block.kenmodlcb.furnace_station");
	}
	
	public void openGUI (ServerPlayerEntity player) {
		if(!world.isRemote) {
			NetworkHooks.openGui(player, this, getPos());
		}
	}
	
	@Override
	public void remove() {
		super.remove();
		slots_holder.invalidate();
		progress.invalidate();
		progress_goal.invalidate();
		burn_time.invalidate();
	}
	
	public void onDestroyed () {
		
		for(int i = 0; i < 4; i++) {
			if(slots.getStackInSlot(i) != ItemStack.EMPTY) {
				InventoryHelper.spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), slots.getStackInSlot(i));
			}
		}
	}
}

 

package com.kenneth.hard_survival_craft.objects.blocks.workstations.smelting_forge;

//import com.kenneth.hard_survival_craft.KenmodMain;
import com.kenneth.hard_survival_craft.objects.blocks.BlockList;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.BurnTime;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.CapabilityBurnTime;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.CapabilityProgress;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.CapabilityProgressGoal;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.IProgress;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.Progress;
import com.kenneth.hard_survival_craft.objects.custom_capabilities.block_capabilites.ProgressGoal;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.IntReferenceHolder;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;
import net.minecraftforge.items.SlotItemHandler;

public class SmeltingForgeContainer extends Container {
	
	SmeltingForgeTileEntity tile_entity;
	
	@OnlyIn(Dist.CLIENT)
	public SmeltingForgeContainer (int id, PlayerInventory player_inventory, PacketBuffer extra_data) {
		this(id, player_inventory, new ItemStackHandler(4), (SmeltingForgeTileEntity)Minecraft.getInstance().world.getTileEntity(extra_data.readBlockPos()));
	}
	public SmeltingForgeContainer(int id, PlayerInventory player_inventory, IItemHandler smelting_forge_inventory, SmeltingForgeTileEntity te) {
		super(BlockList.smelting_forge_container, id);
		this.addSlot(new SlotItemHandler(smelting_forge_inventory, 0, 17, 21));
		this.addSlot(new SlotItemHandler(smelting_forge_inventory, 1, 44, 21));
		this.addSlot(new SlotItemHandler(smelting_forge_inventory, 2, 17, 57));
		this.addSlot(new SlotItemHandler(smelting_forge_inventory, 3, 98, 39) {
			@Override
			public boolean isItemValid(ItemStack stack) {
				return false;
			}
		});
		int si;
		int sj;
		for (si = 0; si < 3; ++si) {
			for (sj = 0; sj < 9; ++sj) {
				this.addSlot(new Slot(player_inventory, sj + (si + 1) * 9, 0 + 8 + sj * 18, 0 + 84 + si * 18));
			}
		}
		for (si = 0; si < 9; ++si) {
			this.addSlot(new Slot(player_inventory, si, 0 + 8 + si * 18, 0 + 142));
		}
		this.tile_entity = te;
		trackInt(new IntReferenceHolder() {
			@Override
			public void set(int value) {
				tile_entity.getCapability(CapabilityProgress.PROGRESS).ifPresent(h -> ((Progress)h).setProgress(value));
			}
			@Override
			public int get() {
				return getProgress();
			}
		});
		trackInt(new IntReferenceHolder() {
			@Override
			public void set(int value) {
				tile_entity.getCapability(CapabilityProgressGoal.PROGRESS_GOAL).ifPresent(h -> ((ProgressGoal)h).setGoal(value));
			}
			@Override
			public int get() {
				return getGoal();
			}
		});
		trackInt(new IntReferenceHolder() {
			@Override
			public void set(int value) {
				tile_entity.getCapability(CapabilityBurnTime.BURN_TIME).ifPresent(j -> ((BurnTime)j).setBurnTime(value));
			}
			@Override
			public int get() {
				return getBurnTime();
			}
		});
	}
	@Override
	public ItemStack transferStackInSlot(PlayerEntity playerIn, int index) {
		ItemStack itemstack = ItemStack.EMPTY;
		Slot slot = (Slot) this.inventorySlots.get(index);
		if (slot != null && slot.getHasStack()) {
			ItemStack itemstack1 = slot.getStack();
			itemstack = itemstack1.copy();
			if (index < 4) {
				if (!this.mergeItemStack(itemstack1, 4, this.inventorySlots.size(), true)) {
					return ItemStack.EMPTY;
				}
				slot.onSlotChange(itemstack1, itemstack);
			} else if (!this.mergeItemStack(itemstack1, 0, 4, false)) {
				if (index < 4 + 27) {
					if (!this.mergeItemStack(itemstack1, 4 + 27, this.inventorySlots.size(), true)) {
						return ItemStack.EMPTY;
					}
				} else {
					if (!this.mergeItemStack(itemstack1, 4, 4 + 27, false)) {
						return ItemStack.EMPTY;
					}
				}
				return ItemStack.EMPTY;
			}
			if (itemstack1.getCount() == 0) {
				slot.putStack(ItemStack.EMPTY);
			} else {
				slot.onSlotChanged();
			}
			if (itemstack1.getCount() == itemstack.getCount()) {
				return ItemStack.EMPTY;
			}
			slot.onTake(playerIn, itemstack1);
		}
		return itemstack;
	}
	@Override
	protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean reverseDirection) {
		boolean flag = false;
		int i = startIndex;
		if (reverseDirection) {
			i = endIndex - 1;
		}
		if (stack.isStackable()) {
			while (!stack.isEmpty()) {
				if (reverseDirection) {
					if (i < startIndex) {
						break;
					}
				} else if (i >= endIndex) {
					break;
				}
				Slot slot = this.inventorySlots.get(i);
				ItemStack itemstack = slot.getStack();
				if (slot.isItemValid(itemstack) && !itemstack.isEmpty() && areItemsAndTagsEqual(stack, itemstack)) {
					int j = itemstack.getCount() + stack.getCount();
					int maxSize = Math.min(slot.getSlotStackLimit(), stack.getMaxStackSize());
					if (j <= maxSize) {
						stack.setCount(0);
						itemstack.setCount(j);
						slot.putStack(itemstack);
						flag = true;
					} else if (itemstack.getCount() < maxSize) {
						stack.shrink(maxSize - itemstack.getCount());
						itemstack.setCount(maxSize);
						slot.putStack(itemstack);
						flag = true;
					}
				}
				if (reverseDirection) {
					--i;
				} else {
					++i;
				}
			}
		}
		if (!stack.isEmpty()) {
			if (reverseDirection) {
				i = endIndex - 1;
			} else {
				i = startIndex;
			}
			while (true) {
				if (reverseDirection) {
					if (i < startIndex) {
						break;
					}
				} else if (i >= endIndex) {
					break;
				}
				Slot slot1 = this.inventorySlots.get(i);
				ItemStack itemstack1 = slot1.getStack();
				if (itemstack1.isEmpty() && slot1.isItemValid(stack)) {
					if (stack.getCount() > slot1.getSlotStackLimit()) {
						slot1.putStack(stack.split(slot1.getSlotStackLimit()));
					} else {
						slot1.putStack(stack.split(stack.getCount()));
					}
					slot1.onSlotChanged();
					flag = true;
					break;
				}
				if (reverseDirection) {
					--i;
				} else {
					++i;
				}
			}
		}
		return flag;
	}
	public int getProgress () {
		//KenmodMain.debugString("test 0: " + tile_entity.getProgress());
		return tile_entity.getCapability(CapabilityProgress.PROGRESS).map(IProgress::getProgress).orElse(0);
	}
	public int getGoal () {
		//KenmodMain.debugString("test 1: " + tile_entity.getProgressGoal());
		return tile_entity.getProgressGoal();
	}
	public int getBurnTime () {
		//KenmodMain.debugString("test 2: " + tile_entity.getBurnTime());
		return tile_entity.getBurnTime();
	}
	@Override
	public void onContainerClosed(PlayerEntity playerIn) {
		super.onContainerClosed(playerIn);
	}
	@Override
	public boolean canInteractWith(PlayerEntity playerIn) {
		return true;
	}
}

 

package com.kenneth.hard_survival_craft.objects.blocks.workstations.smelting_forge;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;

public class SmeltingForgeGUI extends ContainerScreen<SmeltingForgeContainer> {
	
	private static final ResourceLocation texture = new ResourceLocation("kenmod:textures/gui/smelting_forge_gui.png");
	
	public SmeltingForgeGUI(SmeltingForgeContainer screenContainer, PlayerInventory inv, ITextComponent titleIn) {
		super(screenContainer, inv, titleIn);
		this.xSize = 176;
		this.ySize = 166;
	}
	
	@Override
	public void render(int mouseX, int mouseY, float partialTicks) {
		this.renderBackground();
		super.render(mouseX, mouseY, partialTicks);
		this.renderHoveredToolTip(mouseX, mouseY);
	}
	@Override
	protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
		GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
		Minecraft.getInstance().getTextureManager().bindTexture(texture);
		int k = (this.width - this.xSize) / 2;
		int l = (this.height - this.ySize) / 2;
		this.blit(k, l, 0, 0, this.xSize, this.ySize);
		
		int cook_progress = Math.round(24 * getCookProgressScaled());
		int le = this.guiLeft;
		int to = this.guiTop;
		this.blit(le + 67, to + 39, 176, 14, cook_progress + 1, 16);
		
		int burn_time = Math.round(13 - (13.0F * getBurnTimeScaled()));
		this.blit(le + 17, to + 39 + 13 - burn_time, 176, 12 - burn_time, 14, burn_time);
	}
	private float getBurnTimeScaled() {
		int burn = container.getBurnTime();
		int burn_goal = 400;
		if(burn_goal == 0) {
			return 0;
		} else {
			return 1.0F - ((float)burn / (float)burn_goal);
		}
	}
	private float getCookProgressScaled () {
		int prog = container.getProgress();
		int goal = container.getGoal();
		return (float)prog / (float) goal;
	}
	@Override
	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
		this.font.drawString("Smelting Forge", 16, 5, -1);
	}
	@Override
	public void tick() {
		super.tick();
	}
	@Override
	public void removed() {
		super.removed();
		Minecraft.getInstance().keyboardListener.enableRepeatEvents(false);
	}
	@Override
	public void init(Minecraft minecraft, int width, int height) {
		super.init(minecraft, width, height);
		minecraft.keyboardListener.enableRepeatEvents(true);
	}
}

 

When looking at the progress arrow it will go forwards for a little bit, then jerk back a little, then continue going forward. What is causing this strangeness?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello. I've been having a problem when launching minecraft forge. It just doesn't open the game, and leaves me with this "(exit code 1)" error. I'm using LauncherFenix and both regular and optifine versions of minecraft launch just fine. I can assure that my drivers are updated so that can't be it, and i've tried using Java 17, 18 and 21 to no avail. I'll leave the log here, although it's in spanish: https://jmp.sh/s/FPqGBSi30fzKJDt2M1gc My specs are this: Ryzen 3 4100 || Radeon R9 280x || 16gb ram || Windows 10 I'd appreciate any help, thank you in advance.
    • Hey, Me and my friends decided to start up a Server with "a few" mods, the last few days everything went well we used all the items we wanted. Now our Game crashes the moment we touch a Lava Bucket inside our Inventory. It just instantly closes and gives me an "Alc Cleanup"  Crash screen (Using GDLauncher). I honestly dont have a clue how to resolve this error. If anyone could help id really appreciate it, I speak German and Englisch so you can choose whatever you speak more fluently. Thanks in Advance. Plus I dont know how to link my Crash Report help for that would be nice too whoops
    • I hosted a minecraft server and I modded it, and there is always an error on the console which closes the server. If someone knows how to repair it, it would be amazing. Thank you. I paste the crash report down here: ---- Minecraft Crash Report ---- WARNING: coremods are present:   llibrary (llibrary-core-1.0.11-1.12.2.jar)   WolfArmorCore (WolfArmorAndStorage-1.12.2-3.8.0-universal-signed.jar)   AstralCore (astralsorcery-1.12.2-1.10.27.jar)   CreativePatchingLoader (CreativeCore_v1.10.71_mc1.12.2.jar)   SecurityCraftLoadingPlugin ([1.12.2] SecurityCraft v1.9.8.jar)   ForgelinPlugin (Forgelin-1.8.4.jar)   midnight (themidnight-0.3.5.jar)   FutureMC (Future-MC-0.2.19.jar)   SpartanWeaponry-MixinLoader (SpartanWeaponry-1.12.2-1.5.3.jar)   Backpacked (backpacked-1.4.3-1.12.2.jar)   LoadingPlugin (Reskillable-1.12.2-1.13.0.jar)   LoadingPlugin (Bloodmoon-MC1.12.2-1.5.3.jar) Contact their authors BEFORE contacting forge // There are four lights! Time: 3/28/24 12:17 PM Description: Exception in server tick loop net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/multiplayer/WorldClient     at net.minecraftforge.fml.common.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:89)     at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:612)     at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)     at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)     at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:595)     at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:98)     at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:333)     at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:125)     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:486)     at java.lang.Thread.run(Thread.java:750) Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/multiplayer/WorldClient     at java.lang.Class.getDeclaredMethods0(Native Method)     at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)     at java.lang.Class.privateGetPublicMethods(Class.java:2902)     at java.lang.Class.getMethods(Class.java:1615)     at net.minecraftforge.fml.common.eventhandler.EventBus.register(EventBus.java:82)     at net.minecraftforge.fml.common.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:82)     ... 31 more Caused by: java.lang.ClassNotFoundException: net.minecraft.client.multiplayer.WorldClient     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)     at java.lang.ClassLoader.loadClass(ClassLoader.java:418)     at java.lang.ClassLoader.loadClass(ClassLoader.java:351)     ... 37 more Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@4e558728 from coremod FMLCorePlugin     at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:260)     at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279)     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176)     ... 39 more Caused by: java.lang.RuntimeException: Attempted to load class bsb for invalid side SERVER     at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:62)     at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:256)     ... 41 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Linux (amd64) version 5.10.0-28-cloud-amd64     Java Version: 1.8.0_382, Temurin     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Temurin     Memory: 948745536 bytes (904 MB) / 1564999680 bytes (1492 MB) up to 7635730432 bytes (7282 MB)     JVM Flags: 2 total; -Xmx8192M -Xms256M     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP 9.42 Powered by Forge 14.23.5.2860 63 mods loaded, 63 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     | State | ID                 | Version                 | Source                                                | Signature                                |     |:----- |:------------------ |:----------------------- |:----------------------------------------------------- |:---------------------------------------- |     | LC    | minecraft          | 1.12.2                  | minecraft.jar                                         | None                                     |     | LC    | mcp                | 9.42                    | minecraft.jar                                         | None                                     |     | LC    | FML                | 8.0.99.99               | forge-1.12.2-14.23.5.2860.jar                         | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LC    | forge              | 14.23.5.2860            | forge-1.12.2-14.23.5.2860.jar                         | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LC    | creativecoredummy  | 1.0.0                   | minecraft.jar                                         | None                                     |     | LC    | backpacked         | 1.4.2                   | backpacked-1.4.3-1.12.2.jar                           | None                                     |     | LC    | itemblacklist      | 1.4.3                   | ItemBlacklist-1.4.3.jar                               | None                                     |     | LC    | securitycraft      | v1.9.8                  | [1.12.2] SecurityCraft v1.9.8.jar                     | None                                     |     | LC    | aiimprovements     | 0.0.1.3                 | AIImprovements-1.12-0.0.1b3.jar                       | None                                     |     | LC    | jei                | 4.16.1.301              | jei_1.12.2-4.16.1.301.jar                             | None                                     |     | LC    | appleskin          | 1.0.14                  | AppleSkin-mc1.12-1.0.14.jar                           | None                                     |     | LC    | baubles            | 1.5.2                   | Baubles-1.12-1.5.2.jar                                | None                                     |     | LC    | astralsorcery      | 1.10.27                 | astralsorcery-1.12.2-1.10.27.jar                      | a0f0b759d895c15ceb3e3bcb5f3c2db7c582edf0 |     | LC    | attributefix       | 1.0.12                  | AttributeFix-Forge-1.12.2-1.0.12.jar                  | None                                     |     | LC    | atum               | 2.0.20                  | Atum-1.12.2-2.0.20.jar                                | None                                     |     | LC    | bloodmoon          | 1.5.3                   | Bloodmoon-MC1.12.2-1.5.3.jar                          | d72e0dd57935b3e9476212aea0c0df352dd76291 |     | LC    | forgelin           | 1.8.4                   | Forgelin-1.8.4.jar                                    | None                                     |     | LC    | bountiful          | 2.2.2                   | Bountiful-2.2.2.jar                                   | None                                     |     | LC    | camera             | 1.0.10                  | camera-1.0.10.jar                                     | None                                     |     | LC    | chisel             | MC1.12.2-1.0.2.45       | Chisel-MC1.12.2-1.0.2.45.jar                          | None                                     |     | LC    | collective         | 3.0                     | collective-1.12.2-3.0.jar                             | None                                     |     | LC    | reskillable        | 1.12.2-1.13.0           | Reskillable-1.12.2-1.13.0.jar                         | None                                     |     | LC    | compatskills       | 1.12.2-1.17.0           | CompatSkills-1.12.2-1.17.0.jar                        | None                                     |     | LC    | creativecore       | 1.10.0                  | CreativeCore_v1.10.71_mc1.12.2.jar                    | None                                     |     | LC    | customnpcs         | 1.12                    | CustomNPCs_1.12.2-(05Jul20).jar                       | None                                     |     | LC    | darknesslib        | 1.1.2                   | DarknessLib-1.12.2-1.1.2.jar                          | 220f10d3a93b3ff5fbaa7434cc629d863d6751b9 |     | LC    | dungeonsmod        | @VERSION@               | DungeonsMod-1.12.2-1.0.8.jar                          | None                                     |     | LC    | enhancedvisuals    | 1.3.0                   | EnhancedVisuals_v1.4.4_mc1.12.2.jar                   | None                                     |     | LC    | extrautils2        | 1.0                     | extrautils2-1.12-1.9.9.jar                            | None                                     |     | LC    | futuremc           | 0.2.6                   | Future-MC-0.2.19.jar                                  | None                                     |     | LC    | geckolib3          | 3.0.30                  | geckolib-forge-1.12.2-3.0.31.jar                      | None                                     |     | LC    | gottschcore        | 1.15.1                  | GottschCore-mc1.12.2-f14.23.5.2859-v1.15.1.jar        | None                                     |     | LC    | hardcorerevival    | 1.2.0                   | HardcoreRevival_1.12.2-1.2.0.jar                      | None                                     |     | LC    | waila              | 1.8.26                  | Hwyla-1.8.26-B41_1.12.2.jar                           | None                                     |     | LE    | imsm               | 1.12                    | Instant Massive Structures Mod 1.12.2.jar             | None                                     |     | L     | journeymap         | 1.12.2-5.7.1p2          | journeymap-1.12.2-5.7.1p2.jar                         | None                                     |     | L     | mobsunscreen       | @version@               | mobsunscreen-1.12.2-3.1.5.jar                         | None                                     |     | L     | morpheus           | 1.12.2-3.5.106          | Morpheus-1.12.2-3.5.106.jar                           | None                                     |     | L     | llibrary           | 1.7.20                  | llibrary-1.7.20-1.12.2.jar                            | None                                     |     | L     | mowziesmobs        | 1.5.8                   | mowziesmobs-1.5.8.jar                                 | None                                     |     | L     | nocubessrparmory   | 3.0.0                   | NoCubes_SRP_Combat_Addon_3.0.0.jar                    | None                                     |     | L     | nocubessrpnests    | 3.0.0                   | NoCubes_SRP_Nests_Addon_3.0.0.jar                     | None                                     |     | L     | nocubessrpsurvival | 3.0.0                   | NoCubes_SRP_Survival_Addon_3.0.0.jar                  | None                                     |     | L     | nocubesrptweaks    | V4.1                    | nocubesrptweaks-V4.1.jar                              | None                                     |     | L     | patchouli          | 1.0-23.6                | Patchouli-1.0-23.6.jar                                | None                                     |     | L     | artifacts          | 1.1.2                   | RLArtifacts-1.1.2.jar                                 | None                                     |     | L     | rsgauges           | 1.2.8                   | rsgauges-1.12.2-1.2.8.jar                             | None                                     |     | L     | rustic             | 1.1.7                   | rustic-1.1.7.jar                                      | None                                     |     | L     | silentlib          | 3.0.13                  | SilentLib-1.12.2-3.0.14+168.jar                       | None                                     |     | L     | scalinghealth      | 1.3.37                  | ScalingHealth-1.12.2-1.3.42+147.jar                   | None                                     |     | L     | lteleporters       | 1.12.2-3.0.2            | simpleteleporters-1.12.2-3.0.2.jar                    | None                                     |     | L     | spartanshields     | 1.5.5                   | SpartanShields-1.12.2-1.5.5.jar                       | None                                     |     | L     | spartanweaponry    | 1.5.3                   | SpartanWeaponry-1.12.2-1.5.3.jar                      | None                                     |     | L     | srparasites        | 1.9.18                  | SRParasites-1.12.2v1.9.18.jar                         | None                                     |     | L     | treasure2          | 2.2.0                   | Treasure2-mc1.12.2-f14.23.5.2859-v2.2.1.jar           | None                                     |     | L     | treeharvester      | 4.0                     | treeharvester_1.12.2-4.0.jar                          | None                                     |     | L     | twilightforest     | 3.11.1021               | twilightforest-1.12.2-3.11.1021-universal.jar         | None                                     |     | L     | variedcommodities  | 1.12.2                  | VariedCommodities_1.12.2-(31Mar23).jar                | None                                     |     | L     | voicechat          | 1.12.2-2.4.32           | voicechat-forge-1.12.2-2.4.32.jar                     | None                                     |     | L     | wolfarmor          | 3.8.0                   | WolfArmorAndStorage-1.12.2-3.8.0-universal-signed.jar | None                                     |     | L     | worldborder        | 2.3                     | worldborder_1.12.2-2.3.jar                            | None                                     |     | L     | midnight           | 0.3.5                   | themidnight-0.3.5.jar                                 | None                                     |     | L     | structurize        | 1.12.2-0.10.277-RELEASE | structurize-1.12.2-0.10.277-RELEASE.jar               | None                                     |     Loaded coremods (and transformers):  llibrary (llibrary-core-1.0.11-1.12.2.jar)   net.ilexiconn.llibrary.server.core.plugin.LLibraryTransformer   net.ilexiconn.llibrary.server.core.patcher.LLibraryRuntimePatcher WolfArmorCore (WolfArmorAndStorage-1.12.2-3.8.0-universal-signed.jar)    AstralCore (astralsorcery-1.12.2-1.10.27.jar)    CreativePatchingLoader (CreativeCore_v1.10.71_mc1.12.2.jar)    SecurityCraftLoadingPlugin ([1.12.2] SecurityCraft v1.9.8.jar)    ForgelinPlugin (Forgelin-1.8.4.jar)    midnight (themidnight-0.3.5.jar)   com.mushroom.midnight.core.transformer.MidnightClassTransformer FutureMC (Future-MC-0.2.19.jar)   thedarkcolour.futuremc.asm.CoreTransformer SpartanWeaponry-MixinLoader (SpartanWeaponry-1.12.2-1.5.3.jar)    Backpacked (backpacked-1.4.3-1.12.2.jar)   com.mrcrayfish.backpacked.asm.BackpackedTransformer LoadingPlugin (Reskillable-1.12.2-1.13.0.jar)   codersafterdark.reskillable.base.asm.ClassTransformer LoadingPlugin (Bloodmoon-MC1.12.2-1.5.3.jar)   lumien.bloodmoon.asm.ClassTransformer     Profiler Position: N/A (disabled)     Is Modded: Definitely; Server brand changed to 'fml,forge'     Type: Dedicated Server (map_server.txt)
    • When i add mods like falling leaves, visuality and kappas shaders, even if i restart Minecraft they dont show up in the mods menu and they dont work
    • Delete the forge-client.toml file in your config folder  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.