Jump to content

Recommended Posts

Posted

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.

Posted
2 hours ago, Draco18s said:

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. 

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

  • Like 1
Posted
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.

Posted (edited)
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.

Posted
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?

Posted (edited)

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
Posted
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.

Posted

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?

Posted

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.

Posted

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
Posted

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.

Posted

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());
		}
	}
}

 

Posted
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.

Posted
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.

Posted

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?

Posted

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?

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

    • i tested without the mod and now i get this    ---- Minecraft Crash Report ---- WARNING: coremods are present:   IELoadingPlugin (ImmersiveEngineering-core-0.12-98.jar)   AdvancedRocketryPlugin (AdvancedRocketry-1.12.2-2.0.0-17.jar)   SecurityCraftLoadingPlugin ([1.12.2] SecurityCraft v1.9.11.jar)   MekanismCoremod (Mekanism-1.12.2-9.8.3.390.jar)   SuperMartijn642's Core Lib Plugin (_supermartijn642corelib-1.1.17a-forge-mc1.12.jar)   AppleCore (AppleCore-mc1.12.2-3.4.0.jar)   MaterialTweakerPlugin (MaterialTweaker-1.1.1.jar)   CTMCorePlugin (CTM-MC1.12.2-1.0.2.31.jar)   MixinLoader (LootTweaker-0.4.1+MC1.12.2.jar) Contact their authors BEFORE contacting forge // Surprise! Haha. Well, this is awkward. Time: 11/29/24 5:39 PM Description: Initializing game java.lang.NoClassDefFoundError: com/supermartijn642/rechiseled/registration/data/RegistrationFusionModelProvider     at com.supermartijn642.rechiseled.api.registration.RechiseledRegistration.get(RechiseledRegistration.java:26)     at com.supermartijn642.rechiseled.Rechiseled.<clinit>(Rechiseled.java:37)     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Class.java:348)     at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:539)     at sun.reflect.GeneratedMethodAccessor9.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.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232)     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:467)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)     at net.minecraft.client.main.Main.main(SourceFile:123)     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 net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.ClassNotFoundException: com.supermartijn642.rechiseled.registration.data.RegistrationFusionModelProvider     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)     ... 40 more Caused by: java.lang.NoClassDefFoundError: com/supermartijn642/fusion/api/provider/FusionModelProvider     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:756)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182)     ... 42 more Caused by: java.lang.ClassNotFoundException: com.supermartijn642.fusion.api.provider.FusionModelProvider     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:101)     at java.lang.ClassLoader.loadClass(ClassLoader.java:418)     at java.lang.ClassLoader.loadClass(ClassLoader.java:351)     ... 46 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace:     at com.supermartijn642.rechiseled.api.registration.RechiseledRegistration.get(RechiseledRegistration.java:26)     at com.supermartijn642.rechiseled.Rechiseled.<clinit>(Rechiseled.java:37)     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Class.java:348)     at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:539)     at sun.reflect.GeneratedMethodAccessor9.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.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232)     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:467) -- Initialization -- Details: Stacktrace:     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)     at net.minecraft.client.main.Main.main(SourceFile:123)     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 net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Linux (amd64) version 6.6.54-05528-gdd4efe62d86b     Java Version: 1.8.0_432, Temurin     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Temurin     Memory: 261355088 bytes (249 MB) / 671088640 bytes (640 MB) up to 1073741824 bytes (1024 MB)     JVM Flags: 7 total; -Xmx1G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP 9.42 Powered by Forge 14.23.5.2859 59 mods loaded, 58 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.2859.jar                    | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LC    | forge                     | 14.23.5.2859                 | forge-1.12.2-14.23.5.2859.jar                    | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LC    | securitycraft             | v1.9.11                      | [1.12.2] SecurityCraft v1.9.11.jar               | None                                     |     | LC    | supermartijn642corelib    | 1.1.17a                      | _supermartijn642corelib-1.1.17a-forge-mc1.12.jar | None                                     |     | LC    | ic2                       | 2.8.170-ex112                | industrialcraft-2-2.8.170-ex112.jar              | de041f9f6187debbc77034a344134053277aa3b0 |     | LC    | immersiveengineering      | 0.12-98                      | ImmersiveEngineering-0.12-98.jar                 | None                                     |     | LC    | libvulpes                 | 0.4.2.-25                    | LibVulpes-1.12.2-0.4.2-25-universal.jar          | None                                     |     | LC    | advancedrocketry          | 1.12.2-2.0.0-17              | AdvancedRocketry-1.12.2-2.0.0-17.jar             | None                                     |     | LC    | crafttweaker              | 4.1.20                       | CraftTweaker2-1.12-4.1.20.699.jar                | None                                     |     | LC    | advancedtweakery          | 1.2                          | AdvancedTweakery-1.2.jar                         | None                                     |     | LC    | applecore                 | 3.4.0                        | AppleCore-mc1.12.2-3.4.0.jar                     | None                                     |     | LC    | base                      | 3.14.0                       | base-1.12.2-3.14.0.jar                           | None                                     |     | LC    | biometweaker              | 3.2.369                      | BiomeTweaker-1.12.2-3.2.369.jar                  | 631f326344f7f5fd7df7eb940760ebd52b7c9c17 |     | LC    | bookshelf                 | 2.3.590                      | Bookshelf-1.12.2-2.3.590.jar                     | d476d1b22b218a10d845928d1665d45fce301b27 |     | LC    | buildinggadgets           | 2.8.4                        | BuildingGadgets-2.8.4.jar                        | None                                     |     | LC    | ctm                       | MC1.12.2-1.0.2.31            | CTM-MC1.12.2-1.0.2.31.jar                        | None                                     |     | LC    | chisel                    | MC1.12.2-1.0.2.45            | Chisel-MC1.12.2-1.0.2.45.jar                     | None                                     |     | LC    | cyclopscore               | 1.6.7                        | CyclopsCore-1.12.2-1.6.7.jar                     | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | commoncapabilities        | 2.4.8                        | CommonCapabilities-1.12.2-2.4.8.jar              | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | simplecore                | 1.7.3.4                      | simplecore-1.12.2-1.7.3.4.jar                    | None                                     |     | LC    | fusion                    | 2.4.1.11                     | fusion-1.12.2-2.4.1.11.jar                       | None                                     |     | LC    | connectedglass            | 1.1.12                       | connectedglass-1.1.12-forge-mc1.12.jar           | None                                     |     | LC    | contenttweaker            | 1.12.2-4.10.0                | ContentTweaker-1.12.2-4.10.0.jar                 | None                                     |     | LC    | controlling               | 3.0.10                       | Controlling-3.0.12.4.jar                         | None                                     |     | LC    | cotro                     | @VERSION@                    | CoTRO-1.12.2-1.0.1.jar                           | None                                     |     | LC    | ctgui                     | 1.0.0                        | CraftTweaker2-1.12-4.1.20.699.jar                | None                                     |     | LC    | crafttweakerjei           | 2.0.3                        | CraftTweaker2-1.12-4.1.20.699.jar                | None                                     |     | LC    | crafttweakerutils         | 0.6                          | crafttweakerutils-0.6.jar                        | None                                     |     | LC    | ctintegration             | 1.7.2                        | ctintegration-1.7.2.jar                          | None                                     |     | LC    | darkutils                 | 1.8.230                      | DarkUtils-1.12.2-1.8.230.jar                     | d476d1b22b218a10d845928d1665d45fce301b27 |     | LC    | elevatorid                | 1.3.12                       | ElevatorMod-1.12.2-1.3.12.jar                    | None                                     |     | LC    | zerocore                  | 1.12.2-0.1.2.9               | zerocore-1.12.2-0.1.2.9.jar                      | None                                     |     | LC    | bigreactors               | 1.12.2-0.4.5.68              | ExtremeReactors-1.12.2-0.4.5.68.jar              | None                                     |     | LC    | havook                    | 1.0.0                        | havook.jar                                       | None                                     |     | LC    | hungertweaker             | 1.3.0                        | HungerTweaker-1.12.2-1.3.0.jar                   | None                                     |     | LC    | integrateddynamics        | 1.1.11                       | IntegratedDynamics-1.12.2-1.1.11.jar             | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | integratedcrafting        | 1.0.10                       | IntegratedCrafting-1.12.2-1.0.10.jar             | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | integrateddynamicscompat  | 1.0.0                        | IntegratedDynamics-1.12.2-1.1.11.jar             | None                                     |     | LC    | integratedterminals       | 1.0.14                       | IntegratedTerminals-1.12.2-1.0.14.jar            | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | integratedterminalscompat | 1.0.0                        | IntegratedTerminals-1.12.2-1.0.14.jar            | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | integratedtunnels         | 1.6.14                       | IntegratedTunnels-1.12.2-1.6.14.jar              | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | integratedtunnelscompat   | 1.0.0                        | IntegratedTunnels-1.12.2-1.6.14.jar              | None                                     |     | LC    | loottweaker               | 0.4.1                        | LootTweaker-0.4.1+MC1.12.2.jar                   | None                                     |     | LC    | materialtweaker           | 1.1.1                        | MaterialTweaker-1.1.1.jar                        | None                                     |     | LC    | mekanism                  | 1.12.2-9.8.3.390             | Mekanism-1.12.2-9.8.3.390.jar                    | None                                     |     | LC    | mekatweaker               | 1.2.0                        | mekatweaker-1.12-1.2.0.jar                       | None                                     |     | LC    | mtlib                     | 3.0.7                        | MTLib-3.0.7.jar                                  | None                                     |     | LC    | modtweaker                | 4.0.19                       | modtweaker-4.0.20.11.jar                         | None                                     |     | LC    | refinedstorage            | 2.3.2                        | morerefinedstorage-2.3.2.jar                     | None                                     |     | L     | rechiseled                | 1.1.6                        | rechiseled-1.1.6-forge-mc1.12.jar                | None                                     |     | L     | refinedstorageaddons      | 0.4.5                        | refinedstorageaddons-0.4.5.jar                   | None                                     |     | L     | supermartijn642configlib  | 1.1.6                        | supermartijn642configlib-1.1.8-forge-mc1.12.jar  | None                                     |     | L     | gircredstone              | ${version}                   | TC-Redstone-1.12.2-3.2.3.jar                     | None                                     |     | L     | worldedit                 | 6.1.10-SNAPSHOT              | WorldEdit-1.12.2.jar                             | None                                     |     | L     | worldeditcuife2           | 2.2.0-mf-1.12.2-14.23.5.2768 | WorldEdit-CUI-Forge-Edition-Mod-1.12.2.jar       | None                                     |     | L     | ic2_tweaker               | 0.2.1+build.4                | ic2-tweaker-0.2.1+build.4.jar                    | None                                     |     | UD    | advancedrocketrycore      | 1                            | minecraft.jar                                    | None                                     |     Loaded coremods (and transformers):  IELoadingPlugin (ImmersiveEngineering-core-0.12-98.jar)   blusunrize.immersiveengineering.common.asm.IEClassTransformer AdvancedRocketryPlugin (AdvancedRocketry-1.12.2-2.0.0-17.jar)   zmaster587.advancedRocketry.asm.ClassTransformer SecurityCraftLoadingPlugin ([1.12.2] SecurityCraft v1.9.11.jar)    MekanismCoremod (Mekanism-1.12.2-9.8.3.390.jar)   mekanism.coremod.KeybindingMigrationHelper SuperMartijn642's Core Lib Plugin (_supermartijn642corelib-1.1.17a-forge-mc1.12.jar)    AppleCore (AppleCore-mc1.12.2-3.4.0.jar)   squeek.applecore.asm.TransformerModuleHandler MaterialTweakerPlugin (MaterialTweaker-1.1.1.jar)    CTMCorePlugin (CTM-MC1.12.2-1.0.2.31.jar)   team.chisel.ctm.client.asm.CTMTransformer MixinLoader (LootTweaker-0.4.1+MC1.12.2.jar)        GL info: ' Vendor: 'Mesa/X.org' Version: '4.3 (Compatibility Profile) Mesa 22.3.6' Renderer: 'virgl (Mesa Intel(R) UHD Graphics 600 (GLK 2))'     Launched Version: 1.12.2-forge-14.23.5.2859     LWJGL: 2.9.4     OpenGL: virgl (Mesa Intel(R) UHD Graphics 600 (GLK 2)) GL version 4.3 (Compatibility Profile) Mesa 22.3.6, Mesa/X.org     GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported.     Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'fml,forge'     Type: Client (map_client.txt)     Resource Packs:      Current Language: English (US)     Profiler Position: N/A (disabled)     CPU: 2x Intel(R) Celeron(R) N4020 CPU @ 1.10GHz
    • Also check the worldsave / serverconfig folder If there is no such file, make a test without this mod  
    • Hi, I've been having trouble trying to use forge as it shows a black screen when I open the game, but I can still interact with it and hear the music.  I've done all of the step by steps and most common fixes like updating drivers, keeping up to date with Java, deleting and reinstalling minecraft, restarting my computer MANY times, even smaller things like splash.properties (I didn't have that file so I added it and set it to false thinking it would do something, definitely not) and making sure to prioritize my rtx 3070 in the settings but with no luck. Minecraft works as intended when I uninstall forge and I also don't have any mods currently, it just gives me this issue when I install forge. I also increased the ram usage, made sure my hardware isn't full or anything, and even changed the resolution in hopes it would fix things. I checked my antivirus and firewall but that isn't the issue either. Trust me, I've done everything I can think of. For some reason the black screen does flicker a little into the main menu, but obviously unplayable. I couldn't even make my way to the settings with how little it flickered. I'm not sure if it flickered randomly or if it was because I was messing around moving and clicking a bunch, I didn't really test it that much.  
  • Topics

×
×
  • Create New...

Important Information

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