Jump to content

Recommended Posts

Posted

Hello everybody!

 

I have a problem with figuring out how to use Gui classes to modify specific variables of a custom entity. I searched for tutorials or code examples (even looked in vanilla) about GUI, but they all seem to be about Inventory, Containers and TileEntitties. What about entities?

 

Here I have a custom entity that on processInteract should open a Gui to change its state:

 

/* Package and imports */

public class CameraEntity extends EntityLiving
{
/* Here are the variables I want to modify */

public float speed = 0.4F;
public float accelerationRate = 0.02F;
public float accelerationMax = 1.5f;
public boolean canFly = true;

protected float acceleration = 0.0F;

/* Constructor and other method that modify entity's state */

/**
 * Processes player's right clicking on the entity
 * 
 * If the player holds camera configuration item, then GUI with camera
 * configuration properties should pop up, otherwise start riding
 */
@Override
public boolean processInteract(EntityPlayer player, EnumHand p_184645_2_, ItemStack stack)
{
	if (!worldObj.isRemote)
	{
		ItemStack item = player.getHeldItemMainhand();

		if (item != null && item.getItem() instanceof CameraConfigItem)
		{
			player.openGui(MyMod.instance, 0, worldObj, (int) posX, (int) posY, (int) posZ);

			return true;
		}

		if (!isBeingRidden())
		{
			return player.startRiding(this);
		}
	}

	return false;
}

/* Riding logic (moveEntityWithHeading, canBeSteered, getControllingPassenger) */
}

 

Basically I want to modify first four public variables (I know that they won't be saved). There's my GUI code:

 

/* Package and imports */

public class GuiCamera extends GuiScreen
{
/* static validator */

protected GuiTextField speed;
protected GuiTextField accelerationRate;
protected GuiTextField accelerationMax;
protected GuiButton canFly;
protected GuiButton done;

public GuiCamera()
{
	/* How can I pass entity here? */
}

@Override
public void initGui()
{
	int x = width/2 - 150;

	speed = new GuiTextField(0, fontRendererObj, x, 50, 300, 20);
	// speed.setText(Double.toString(camera.speed));
	speed.setValidator(validator);

	accelerationRate = new GuiTextField(1, fontRendererObj, x, 90, 300, 20);
	// accelerationRate.setText(Double.toString(camera.accelerationRate));
	accelerationRate.setValidator(validator);

	accelerationMax = new GuiTextField(2, fontRendererObj, x, 130, 300, 20);
	// accelerationMax.setText(Double.toString(camera.accelerationMax));
	accelerationMax.setValidator(validator);

	buttonList.clear();
	buttonList.add(canFly = new GuiButton(3, x, 180, 160, 20, "Can fly"));
	buttonList.add(done = new GuiButton(4, x + 180, 160, 140, 20, "Done"));

	// canFly.displayString = camera.canFly ? "Can fly" : "Can't fly";
}

@Override
protected void actionPerformed(GuiButton button) throws IOException
{
	switch (button.id)
	{
		case 3:
			updateFlyButton();
		break;

		case 4:
			mc.displayGuiScreen(null);
		break;
	}
}

private void updateFlyButton()
{
	if (canFly.displayString == "Can fly")
	{
		canFly.displayString = "Can't fly";
	}
	else 
	{
		canFly.displayString = "Can fly";
	}
}

/* Mouse clicked, key typed and draw screen methods are here */
}

 

There's few issues I'm having here:

 

1. I can't pass entity to the GuiCamera, I tried using world.getEntitiesWithinAABB, but it throws and error saying "Error executing task"

2. I need Container in order to open the GUI, but I don't know how to pass entity in it and I don't know how to use this class to communicate between client and server or how to use it to change state of the entity

 

So now is the question: how can I use IGuiHandler to modify state of the custom entity?

 

Thank you for your attention :)

 

P.S.: I don't ask for ready to use code, I ask for guidance. Thanks.

 

P.S.S.: when I'm pressing "Done" button in GUI, for some reason game starts to glitch a little bit, for example when I use /give command given item/block doesn't appear in the inventory, but after a while it does appear. It looks like game goes out of sync. Is there any other code I should execute before closing the GUI with mc.displayGuiScreen(null);?

Blockbuster – simple machinimas and cinematics for Minecraft
Posted

Hello everybody!

 

I have a problem with figuring out how to use Gui classes to modify specific variables of a custom entity. I searched for tutorials or code examples (even looked in vanilla) about GUI, but they all seem to be about Inventory, Containers and TileEntitties. What about entities?

 

Here I have a custom entity that on processInteract should open a Gui to change its state:

 

/* Package and imports */

public class CameraEntity extends EntityLiving
{
/* Here are the variables I want to modify */

public float speed = 0.4F;
public float accelerationRate = 0.02F;
public float accelerationMax = 1.5f;
public boolean canFly = true;

protected float acceleration = 0.0F;

/* Constructor and other method that modify entity's state */

/**
 * Processes player's right clicking on the entity
 * 
 * If the player holds camera configuration item, then GUI with camera
 * configuration properties should pop up, otherwise start riding
 */
@Override
public boolean processInteract(EntityPlayer player, EnumHand p_184645_2_, ItemStack stack)
{
	if (!worldObj.isRemote)
	{
		ItemStack item = player.getHeldItemMainhand();

		if (item != null && item.getItem() instanceof CameraConfigItem)
		{
			player.openGui(MyMod.instance, 0, worldObj, (int) posX, (int) posY, (int) posZ);

			return true;
		}

		if (!isBeingRidden())
		{
			return player.startRiding(this);
		}
	}

	return false;
}

/* Riding logic (moveEntityWithHeading, canBeSteered, getControllingPassenger) */
}

 

Basically I want to modify first four public variables (I know that they won't be saved). There's my GUI code:

 

/* Package and imports */

public class GuiCamera extends GuiScreen
{
/* static validator */

protected GuiTextField speed;
protected GuiTextField accelerationRate;
protected GuiTextField accelerationMax;
protected GuiButton canFly;
protected GuiButton done;

public GuiCamera()
{
	/* How can I pass entity here? */
}

@Override
public void initGui()
{
	int x = width/2 - 150;

	speed = new GuiTextField(0, fontRendererObj, x, 50, 300, 20);
	// speed.setText(Double.toString(camera.speed));
	speed.setValidator(validator);

	accelerationRate = new GuiTextField(1, fontRendererObj, x, 90, 300, 20);
	// accelerationRate.setText(Double.toString(camera.accelerationRate));
	accelerationRate.setValidator(validator);

	accelerationMax = new GuiTextField(2, fontRendererObj, x, 130, 300, 20);
	// accelerationMax.setText(Double.toString(camera.accelerationMax));
	accelerationMax.setValidator(validator);

	buttonList.clear();
	buttonList.add(canFly = new GuiButton(3, x, 180, 160, 20, "Can fly"));
	buttonList.add(done = new GuiButton(4, x + 180, 160, 140, 20, "Done"));

	// canFly.displayString = camera.canFly ? "Can fly" : "Can't fly";
}

@Override
protected void actionPerformed(GuiButton button) throws IOException
{
	switch (button.id)
	{
		case 3:
			updateFlyButton();
		break;

		case 4:
			mc.displayGuiScreen(null);
		break;
	}
}

private void updateFlyButton()
{
	if (canFly.displayString == "Can fly")
	{
		canFly.displayString = "Can't fly";
	}
	else 
	{
		canFly.displayString = "Can fly";
	}
}

/* Mouse clicked, key typed and draw screen methods are here */
}

 

There's few issues I'm having here:

 

1. I can't pass entity to the GuiCamera, I tried using world.getEntitiesWithinAABB, but it throws and error saying "Error executing task"

2. I need Container in order to open the GUI, but I don't know how to pass entity in it and I don't know how to use this class to communicate between client and server or how to use it to change state of the entity

 

So now is the question: how can I use IGuiHandler to modify state of the custom entity?

 

Thank you for your attention :)

 

P.S.: I don't ask for ready to use code, I ask for guidance. Thanks.

 

P.S.S.: when I'm pressing "Done" button in GUI, for some reason game starts to glitch a little bit, for example when I use /give command given item/block doesn't appear in the inventory, but after a while it does appear. It looks like game goes out of sync. Is there any other code I should execute before closing the GUI with mc.displayGuiScreen(null);?

Blockbuster – simple machinimas and cinematics for Minecraft
Posted

1. As you noticed from source (I guess): IGuHandler is mainly designed to connect Container with its GuiContainer.

First, you probably understand sides, and if not: http://mcforge.readthedocs.io/en/latest/concepts/sides/

It is important to get that Entity object is on server and client, where they communicate with each other via entityId.

 

Calling player.openGui will: (by thread)

Server:

* If Container is returned, it will be opened and packet will be sent to client (with world, id, x, y, z, where x/y/z can by anything). Packet will call client opening.

* If null - nothing will happen.

Client:

* It will simply call Minecraft#displayGuiScreen (I might have messed up naming).

 

Now - Container are ONLY ever used to display interactive Guis that hold/display ItemStacks. In this case you don't need that.

And yes - in this case IGuiHandler should be only used to centralize code (meaning that you will open all your guis from player.openGui). And yes - you will retur null on server and normal GuiScreen on client. Now - since only client can open that gui (no container), you need to call opening from client thread (world.isRemote) - this is the 1st mistake you made there (in entity class).

 

2. Next - as one could guess - "client always lies" - if you would want to check (on client) if client can even open a gui, it can always lie. That is where you can implement request/order packet system. Basically - since Entity#processInteract is called on both sides, you can perform checks on server and then if passed - send packet to client to call player.openGui.

 

Followup to this will be SimpleNetworkWrapper and thread safety:

http://www.minecraftforge.net/forum/index.php/topic,20135.0.html

http://greyminecraftcoder.blogspot.com.au/2015/01/thread-safety-with-network-messages.html

If you don't have those yet - you will be using them in future, so I recommend designing abstraction layer.

 

3. Okay, so now Gui itself:

You simply make constructor have CameraEntity (why not EntityCamera? :P) as arg.

There are (as said) two options:

* Open gui with IGuiHandler (player.openGui).

- Then in your IGuiHandler you will be getting that entity using World#getEntityByID. As said - x/y/z can by anything, so it can also be that ID.

* Open gui with Minecraft#displayGuiScreen.

- In that case you can directly pass Entity instance to new Gui. (and instance you can again get from entityID).

 

4. Regarding request/order packets - you will need to send (server->client):

1st option:

Only entityID (entity.getEntityId())

2nd option:

entityID and guiID (so you can use one packet for multiple guis).

In Handler you will be calling opening gui mentioned in 3rd point.

 

EDIT

 

5. Same rules (packets) apply when sending data from gui (client) to server.

You will need thread safety and will need to send data (including entityId) that will (on server) apply that data onto server's entity (that you get from entityID).

 

6. Logically whenever you make such messaging you should do:

* (request/order) clientRequest -> serverCheck -> serverChanges -> serverAnswer -> clientChanges

or

* (order/update) serverChanges -> serverAnswer -> clientChanges

Where 1st one applies when client would want to change entity data.

 

EDIT 2

 

7. Now synchronizing Entity itself:

* EntityTracker - can be used to get all players tracking given entity. You can use that to update all players seeing it when you change value on server. Simply send packet to all those who track it.

* PlayerEvent.StartTracking - when player starts tracking (seeing) entity, it will be called. event.target is entity being tracked. You can use this to sync data with player starting tracking about entity being tracked. This method should be only ever used to OTHER (not yours, eg vanilla) Entities or if you want to centralize your code (e.g you have same behavir for all entities because you assigned @Capability to all of them).

* IEntityAdditionalSpawnData - implement this to your OWN entities - basically what StartTracking does, but more interanlly.

* SimpleNetworkWrapper - send simple packet updates.

 

NEVER FORGET about THREAD SAFETY.

 

Note: Getting grasp of above allows you to pretty much start doing anything (intermidiate).

  Quote

1.7.10 is no longer supported by forge, you are on your own.

Posted

1. As you noticed from source (I guess): IGuHandler is mainly designed to connect Container with its GuiContainer.

First, you probably understand sides, and if not: http://mcforge.readthedocs.io/en/latest/concepts/sides/

It is important to get that Entity object is on server and client, where they communicate with each other via entityId.

 

Calling player.openGui will: (by thread)

Server:

* If Container is returned, it will be opened and packet will be sent to client (with world, id, x, y, z, where x/y/z can by anything). Packet will call client opening.

* If null - nothing will happen.

Client:

* It will simply call Minecraft#displayGuiScreen (I might have messed up naming).

 

Now - Container are ONLY ever used to display interactive Guis that hold/display ItemStacks. In this case you don't need that.

And yes - in this case IGuiHandler should be only used to centralize code (meaning that you will open all your guis from player.openGui). And yes - you will retur null on server and normal GuiScreen on client. Now - since only client can open that gui (no container), you need to call opening from client thread (world.isRemote) - this is the 1st mistake you made there (in entity class).

 

2. Next - as one could guess - "client always lies" - if you would want to check (on client) if client can even open a gui, it can always lie. That is where you can implement request/order packet system. Basically - since Entity#processInteract is called on both sides, you can perform checks on server and then if passed - send packet to client to call player.openGui.

 

Followup to this will be SimpleNetworkWrapper and thread safety:

http://www.minecraftforge.net/forum/index.php/topic,20135.0.html

http://greyminecraftcoder.blogspot.com.au/2015/01/thread-safety-with-network-messages.html

If you don't have those yet - you will be using them in future, so I recommend designing abstraction layer.

 

3. Okay, so now Gui itself:

You simply make constructor have CameraEntity (why not EntityCamera? :P) as arg.

There are (as said) two options:

* Open gui with IGuiHandler (player.openGui).

- Then in your IGuiHandler you will be getting that entity using World#getEntityByID. As said - x/y/z can by anything, so it can also be that ID.

* Open gui with Minecraft#displayGuiScreen.

- In that case you can directly pass Entity instance to new Gui. (and instance you can again get from entityID).

 

4. Regarding request/order packets - you will need to send (server->client):

1st option:

Only entityID (entity.getEntityId())

2nd option:

entityID and guiID (so you can use one packet for multiple guis).

In Handler you will be calling opening gui mentioned in 3rd point.

 

EDIT

 

5. Same rules (packets) apply when sending data from gui (client) to server.

You will need thread safety and will need to send data (including entityId) that will (on server) apply that data onto server's entity (that you get from entityID).

 

6. Logically whenever you make such messaging you should do:

* (request/order) clientRequest -> serverCheck -> serverChanges -> serverAnswer -> clientChanges

or

* (order/update) serverChanges -> serverAnswer -> clientChanges

Where 1st one applies when client would want to change entity data.

 

EDIT 2

 

7. Now synchronizing Entity itself:

* EntityTracker - can be used to get all players tracking given entity. You can use that to update all players seeing it when you change value on server. Simply send packet to all those who track it.

* PlayerEvent.StartTracking - when player starts tracking (seeing) entity, it will be called. event.target is entity being tracked. You can use this to sync data with player starting tracking about entity being tracked. This method should be only ever used to OTHER (not yours, eg vanilla) Entities or if you want to centralize your code (e.g you have same behavir for all entities because you assigned @Capability to all of them).

* IEntityAdditionalSpawnData - implement this to your OWN entities - basically what StartTracking does, but more interanlly.

* SimpleNetworkWrapper - send simple packet updates.

 

NEVER FORGET about THREAD SAFETY.

 

Note: Getting grasp of above allows you to pretty much start doing anything (intermidiate).

  Quote

1.7.10 is no longer supported by forge, you are on your own.

Posted

Many thanks! Your reply was really fast!  :)

 

  Quote
why not EntityCamera?

 

I started naming classes *Block/Entity/Item, and then found out that about the convention...

I'll rename classes later.

 

  Quote
Next - as one could guess - "client always lies" - if you would want to check (on client) if client can even open a gui, it can always lie.

 

I did some server programming on perl long time ago, so I know about validating data that comes from client. :)

 

I'll try out your suggestions and reply later if I'll have any troubles. Thanks again.

Blockbuster – simple machinimas and cinematics for Minecraft
Posted

Many thanks! Your reply was really fast!  :)

 

  Quote
why not EntityCamera?

 

I started naming classes *Block/Entity/Item, and then found out that about the convention...

I'll rename classes later.

 

  Quote
Next - as one could guess - "client always lies" - if you would want to check (on client) if client can even open a gui, it can always lie.

 

I did some server programming on perl long time ago, so I know about validating data that comes from client. :)

 

I'll try out your suggestions and reply later if I'll have any troubles. Thanks again.

Blockbuster – simple machinimas and cinematics for Minecraft
Posted

Thanks, Ernio, for links and suggestions. :) There's only one problem left to be solved and that's the entity tracking. I don't understand how to use EntityTracker. Is it supposed to be activated on client, on server or on both sides (like in CameraEntity's constructor)?

 

Here's what I've come up with:

 

/* Package and imports */

public class GuiCamera extends GuiScreen
{
protected GuiSlider speed;
protected GuiSlider accelerationRate;
protected GuiSlider accelerationMax;
protected GuiButton canFly;
protected GuiButton done;

private CameraEntity camera;

public GuiCamera(CameraEntity entity)
{
	camera = entity;
}

/* initialize GUI */

@Override
protected void actionPerformed(GuiButton button) throws IOException
{
	switch (button.id)
	{
		case 3: updateFlyButton(); break;
		case 4: saveAndExit(); break;
	}
}

private void saveAndExit()
{
	float cSpeed = (float)speed.getValue();
	float cRate = (float)accelerationRate.getValue();
	float cMax = (float)accelerationMax.getValue();
	boolean cCanFly = canFly.displayString == "Can fly";

	Mod.channel.sendToServer(new CameraAttributesUpdate(camera.getEntityId(), cSpeed, cRate, cMax, cCanFly));

	camera.speed = cSpeed;
	camera.accelerationRate = cRate;
	camera.accelerationMax = cMax;
	camera.canFly = cCanFly;

	mc.displayGuiScreen(null);
}

/* Drawing and clicking logic */
}

 

As you can see I setup SimpleNetworkWrapper and sending message to handle by handler it (on server). This way camera is only synchronized only on client that sent the message and on server, but how to do it to all other connected players?

 

Here's my IMessage and IMessageHandler implementing classes:

 

/* Package and imports */

public class CameraAttributesUpdate implements IMessage
{
protected int id;
protected float speed;
protected float accelerationRate;
protected float accelerationMax;
protected boolean canFly; 

public CameraAttributesUpdate() {}

public CameraAttributesUpdate(int eid, float speeed, float rate, float max, boolean fly)
{
	id = eid;
	speed = speeed;
	accelerationRate = rate;
	accelerationMax = max;
	canFly = fly;
}

@Override
public void fromBytes(ByteBuf buf)
{
	id = buf.readInt();
	speed = buf.readFloat();
	accelerationRate = buf.readFloat();
	accelerationMax = buf.readFloat();
	canFly = buf.readBoolean();
}

@Override
public void toBytes(ByteBuf buf)
{
	buf.writeInt(id);
	buf.writeFloat(speed);
	buf.writeFloat(accelerationRate);
	buf.writeFloat(accelerationMax);
	buf.writeBoolean(canFly);
}

public static class Handler implements IMessageHandler<CameraAttributesUpdate, IMessage>
{
	@Override
	public IMessage onMessage(final CameraAttributesUpdate message, final MessageContext ctx)
	{
		IThreadListener world = (WorldServer)ctx.getServerHandler().playerEntity.worldObj;

		world.addScheduledTask(new Runnable()
		{
			@Override
			public void run()
			{
				Entity entity = ctx.getServerHandler().playerEntity.worldObj.getEntityByID(message.id);
				CameraEntity camera = (CameraEntity)entity;

				camera.speed = (float)message.speed;
				camera.accelerationRate = (float)message.accelerationRate;
				camera.accelerationMax = (float)message.accelerationMax;
				camera.canFly = message.canFly;
			}
		});

		return null;
	}
}
}

 

Maybe I can return another message from CameraAttributesUpdate.Handler that will notify somehow other (and maybe the client that sent the message) players?

Blockbuster – simple machinimas and cinematics for Minecraft
Posted

Thanks, Ernio, for links and suggestions. :) There's only one problem left to be solved and that's the entity tracking. I don't understand how to use EntityTracker. Is it supposed to be activated on client, on server or on both sides (like in CameraEntity's constructor)?

 

Here's what I've come up with:

 

/* Package and imports */

public class GuiCamera extends GuiScreen
{
protected GuiSlider speed;
protected GuiSlider accelerationRate;
protected GuiSlider accelerationMax;
protected GuiButton canFly;
protected GuiButton done;

private CameraEntity camera;

public GuiCamera(CameraEntity entity)
{
	camera = entity;
}

/* initialize GUI */

@Override
protected void actionPerformed(GuiButton button) throws IOException
{
	switch (button.id)
	{
		case 3: updateFlyButton(); break;
		case 4: saveAndExit(); break;
	}
}

private void saveAndExit()
{
	float cSpeed = (float)speed.getValue();
	float cRate = (float)accelerationRate.getValue();
	float cMax = (float)accelerationMax.getValue();
	boolean cCanFly = canFly.displayString == "Can fly";

	Mod.channel.sendToServer(new CameraAttributesUpdate(camera.getEntityId(), cSpeed, cRate, cMax, cCanFly));

	camera.speed = cSpeed;
	camera.accelerationRate = cRate;
	camera.accelerationMax = cMax;
	camera.canFly = cCanFly;

	mc.displayGuiScreen(null);
}

/* Drawing and clicking logic */
}

 

As you can see I setup SimpleNetworkWrapper and sending message to handle by handler it (on server). This way camera is only synchronized only on client that sent the message and on server, but how to do it to all other connected players?

 

Here's my IMessage and IMessageHandler implementing classes:

 

/* Package and imports */

public class CameraAttributesUpdate implements IMessage
{
protected int id;
protected float speed;
protected float accelerationRate;
protected float accelerationMax;
protected boolean canFly; 

public CameraAttributesUpdate() {}

public CameraAttributesUpdate(int eid, float speeed, float rate, float max, boolean fly)
{
	id = eid;
	speed = speeed;
	accelerationRate = rate;
	accelerationMax = max;
	canFly = fly;
}

@Override
public void fromBytes(ByteBuf buf)
{
	id = buf.readInt();
	speed = buf.readFloat();
	accelerationRate = buf.readFloat();
	accelerationMax = buf.readFloat();
	canFly = buf.readBoolean();
}

@Override
public void toBytes(ByteBuf buf)
{
	buf.writeInt(id);
	buf.writeFloat(speed);
	buf.writeFloat(accelerationRate);
	buf.writeFloat(accelerationMax);
	buf.writeBoolean(canFly);
}

public static class Handler implements IMessageHandler<CameraAttributesUpdate, IMessage>
{
	@Override
	public IMessage onMessage(final CameraAttributesUpdate message, final MessageContext ctx)
	{
		IThreadListener world = (WorldServer)ctx.getServerHandler().playerEntity.worldObj;

		world.addScheduledTask(new Runnable()
		{
			@Override
			public void run()
			{
				Entity entity = ctx.getServerHandler().playerEntity.worldObj.getEntityByID(message.id);
				CameraEntity camera = (CameraEntity)entity;

				camera.speed = (float)message.speed;
				camera.accelerationRate = (float)message.accelerationRate;
				camera.accelerationMax = (float)message.accelerationMax;
				camera.canFly = message.canFly;
			}
		});

		return null;
	}
}
}

 

Maybe I can return another message from CameraAttributesUpdate.Handler that will notify somehow other (and maybe the client that sent the message) players?

Blockbuster – simple machinimas and cinematics for Minecraft
Posted

You code looks well (dude, trust me, there are so many people who wouldn't know what to do with all that I wrote, but that is what I got used to since a lot of ppl who come here don't know Java).

 

Direct answers:

  On 5/30/2016 at 9:02 AM, Ernio said:

* EntityTracker - can be used to get all players tracking given entity. You can use that to update all players seeing it when you change value on server. Simply send packet to all those who track it.

 

1. Yes, this is server side thingy that keeps track of which player should receive updates about which entity.

Best design for those things is to make:

@Override
public final void updateTrackers(Entity entity, IMessage message) // method in my SimpleNetworkWrapper
{
	EntityTracker et = ((WorldServer) entity.worldObj).getEntityTracker();
	et.func_151248_b(entity, this.getInstance().getPacketFrom(message)); // this = SimpleNetworkWrapper
}

 

What this does is basically get "tracker" of "entity" and "func_151248_b" (note: maybe they finally renamed it) will send given IMessage to all EntityPlayer seeing this "entity". SNW#getPacketFrom(IMessage) converts IMessage to vanilla format Packet.

 

How it should be used?

Best design is probably something like sided setter in Entity class:

private int something;
public void setSomething(int value, boolean notify)
{
    this.something = value;
    if (!this.worldObj.isRemote && notify)
    {
        SNW#updateTrackers(this, new IMessage(this.entityId, this.something)); // calls my method in SNW
    }
}

 

Some people do this using methods such as SimpleNetworkWrapper#sendToAllAround(IMessage message, NetworkRegistry.TargetPoint point) which is provided by Forge itself, but I think it is simply bad. EntityTracker is superior.

 

So basically:

* EntityTracker - solves existance updating (changes made to entity when someone sees (tracks) it alredy). Server only.

* IEntityAdditionalSpawnData (IEASD) - solves spawn updating (data sent precisely when you start tracking entity).

* PlayerEvent.StartTracking - like IEASD - allows doing the same for not your entities, it also allows other things (think about it). Not it fires server only.

 

EDIT

 

Bog note - my techniques regarding EntityTracker, while still good, might be outdated. Please lookup class itself as it now provides methods such as getTrackingPlayers and sendToAllTrackingEntity. As to one I have - func_151248_b is vanilla's one - also note that "tracking entities" are also the the entity itself (If passed Entity is EntityPlayer, it tracks itself).

 

Additional info:

I forgot to re-point out:

  Quote

6. Logically whenever you make such messaging you should do:

* (request/order) clientRequest -> serverCheck -> serverChanges -> serverAnswer -> clientChanges

or

* (order/update) serverChanges -> serverAnswer -> clientChanges

Where 1st one applies when client would want to change entity data.

 

  Quote

private void saveAndExit()
{
	float cSpeed = (float)speed.getValue();
	float cRate = (float)accelerationRate.getValue();
	float cMax = (float)accelerationMax.getValue();
	boolean cCanFly = canFly.displayString == "Can fly";

	Mod.channel.sendToServer(new CameraAttributesUpdate(camera.getEntityId(), cSpeed, cRate, cMax, cCanFly));

// DON'T DO THIS (START)

	camera.speed = cSpeed;
	camera.accelerationRate = cRate;
	camera.accelerationMax = cMax;
	camera.canFly = cCanFly;

// DON'T DO THIS (END)

	mc.displayGuiScreen(null);
}

 

This should be taken care of from server's point of view. How do you know the server will acceps sent values? And if not - it may lead to your client having bad data.

 

EDIT 2

 

Just a reminder - not everything needs to be synced at all times. If all player seeing camera don't actually need some values, you can simply not update them with those. You could e.g send those values only when they will start interaction (just before you send openGui order-packet).

  Quote

1.7.10 is no longer supported by forge, you are on your own.

Posted

Thanks for another reply!  :)

 

  Quote
You code looks well (dude, trust me, there are so many people who would know what to do with all that I wrote, but that is what I got used to since a lot of ppl who come here don't know Java).

 

Sorry to disappoint you, but my problem isn't about knowledge of the language. Java is just like any other languages with built-in support of OOP. My problem is that I'm not familiar with minecraft's API. I started developing my mod a week and a half ago.

 

So, now about the EntityTracker. I read some Forge and Minecraft source code, and now I think I get how to use EntityTracker. From forge.fml.common.registry.EntityRegistry I get that Forge is automatically adds entity to tracking when I register my custom mod, but it seems to me that EntityTracker isn't going to help me with syncing my custom fields from server to the client. EntityTrackerEntry

 

By the way, my mod is targeted towards single-player experience, so I don't really need to do all those validation checks.

Blockbuster – simple machinimas and cinematics for Minecraft
Posted

Thanks for another reply!  :)

 

  Quote
You code looks well (dude, trust me, there are so many people who would know what to do with all that I wrote, but that is what I got used to since a lot of ppl who come here don't know Java).

 

Sorry to disappoint you, but my problem isn't about knowledge of the language. Java is just like any other languages with built-in support of OOP. My problem is that I'm not familiar with minecraft's API. I started developing my mod a week and a half ago.

 

So, now about the EntityTracker. I tried to copy-paste your code examples, but it doesn't seem to work. When I open GUI again it shows the old values in GUI, but on server it prints the sent values. I don't really understand how does SNW#getPacketFrom(message) can magically convert my message into right ordered packet and then on the client side inject those values into correct fields.

 

I read some Forge and Minecraft source code, and now I think I get how to use EntityTracker. From forge.fml.common.registry.EntityRegistry I get that Forge is automatically adds entity to tracking when I register my custom mod, but it seems to me that EntityTracker isn't going to help me with syncing my custom fields from server to the client. EntityTrackerEntry in net.minecraft.entity have a lot of fields, but it looks like it syncing only entity position and rotation. Is that right? Is EntityTracker is responsible only for syncing entity's position and rotation? If so, I can't use EntityTracker to sync my custom data. Correct me if I'm wrong.

 

Also, I decided to add writeEntityToNBT and corresponding reading method to my CameraEntity, and it looks like those custom fields are ok on the server side, but on client side, they're always equals to default, even if I save and quit and then relog again. What am I doing wrong? Fixed by implementing IEntityAdditionSpawnData, but it still doesn't sync while I'm online.

 

This is how my Message looks like now:

 

public class CameraAttributesUpdate implements IMessage
{
protected int id;
protected float speed;
protected float accelerationRate;
protected float accelerationMax;
protected boolean canFly; 

public CameraAttributesUpdate() {}

public CameraAttributesUpdate(int eid, float speeed, float rate, float max, boolean fly)
{
	id = eid;
	speed = speeed;
	accelerationRate = rate;
	accelerationMax = max;
	canFly = fly;
}

@Override
public void fromBytes(ByteBuf buf)
{
	id = buf.readInt();
	speed = buf.readFloat();
	accelerationRate = buf.readFloat();
	accelerationMax = buf.readFloat();
	canFly = buf.readBoolean();
}

@Override
public void toBytes(ByteBuf buf)
{
	buf.writeInt(id);
	buf.writeFloat(speed);
	buf.writeFloat(accelerationRate);
	buf.writeFloat(accelerationMax);
	buf.writeBoolean(canFly);
}

public static class Handler implements IMessageHandler<CameraAttributesUpdate, IMessage>
{
	@Override
	public IMessage onMessage(final CameraAttributesUpdate message, final MessageContext ctx)
	{
		IThreadListener world = (WorldServer)ctx.getServerHandler().playerEntity.worldObj;

		world.addScheduledTask(new Runnable()
		{
			@Override
			public void run()
			{
				WorldServer world = (WorldServer)ctx.getServerHandler().playerEntity.worldObj;
				Entity entity = world.getEntityByID(message.id);
				CameraEntity camera = (CameraEntity)entity;

				camera.setConfiguration(message.speed, message.accelerationRate, message.accelerationMax, message.canFly);

				world.getEntityTracker().func_151248_b(camera, Mod.channel.getPacketFrom(message));
			}
		});

		return null;
	}
}
}

 

By the way, my mod is targeted towards single-player experience, so I don't really need to do all those validation checks.

 

P.S.: Sorry if I'm being ignorant, but I just not familiar enough with minecraft and forge code base.  :(

Blockbuster – simple machinimas and cinematics for Minecraft
Posted

Skype: ernio333

TeamViewer if you can so I can quickly explain code + examples.

 

That is if earlier post are not enough (they should be, there is not much really to say, but only to show some things).

 

And lol me - "dude, trust me, there are so many people who would know what to do with all that I wrote"

it was supposed to be "who wouldn't" - I messed up, actually your code is (almost) good.

  Quote

1.7.10 is no longer supported by forge, you are on your own.

Posted

I sent you PM (to avoid too many connects, lol).

 

  Quote
And lol me - "dude, trust me, there are so many people who would know what to do with all that I wrote"

it was supposed to be "who wouldn't" - I messed up, actually your code is good.

 

Thanks! :)

Blockbuster – simple machinimas and cinematics for Minecraft
Posted

Thanks to Ernio who helped me to overcome this problem, so there's report:

 

To create a GUI that changes state of the custom entity you have to:

 

1. Create a GUI class that extends GuiScreen (look at GuiCommandBlock for example for click)

2. In your entity's processInteract method on client side (world.isRemote == true) open Gui either via openGui (but first setup IGuiHandler) or via Minecraft.getMinecraft().displayGuiScreen

3. On Gui exit (when you trigger mc.displayGuiScreen(null)), send the message with new values to server side via SimpleNetworkWrapper (as in my second post, see GuiCamera#saveAndExit)

4. On server side in message handler (see CameraAttributesUpdate.Handler#onMessage), you invoke a setter (see Ernio's post where he shows his SNW#updateTracker) which in turn sends another message via your SimpleNetworkWrapper's wrapper to the client

5. On client side you should have another message handler that updates the client entity

 

There's updated SNW#updateTrackers of Ernio:

 

    public static void updateTrackers(Entity entity, IMessage message)
    {
        EntityTracker et = ((WorldServer) entity.worldObj).getEntityTracker();

        for (EntityPlayer player : et.getTrackingPlayers(entity))
        {
            DISPATCHER.sendTo(message, (EntityPlayerMP) player);
        }
    }

 

I hope this gonna be helpful in the future :)

 

P.S.: See also Ernio's links and suggestions for more information

Blockbuster – simple machinimas and cinematics for Minecraft

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

    • Introduction Are you ready to revolutionize your online shopping experience and save a whopping amount on your favorite items? We have fantastic news for you! Get ready to be amazed by the Temu coupon code [acu639380] $100 off, a golden ticket to unlock unbelievable discounts on the incredible Temu marketplace. This is your exclusive invitation to a world of savings, especially designed for our cherished customers in the USA, Canada, and across European nations. With the acu639380 Temu coupon code, you are not just getting a discount; you are stepping into a realm of unparalleled value and affordability on a vast selection of products. We are thrilled to bring you this opportunity to enhance your shopping without breaking the bank. Prepare to be delighted as we unveil the magic of the acu639380 code, offering you a Temu 100 off coupon code that is simply too good to miss. Yes, you heard it right! This incredible Temu coupon code $100 off ensures that your shopping cart becomes lighter on your pocket, allowing you to indulge in more of what you love without any guilt. Get ready to explore the endless possibilities of saving with Temu and us! What Is The Coupon Code "acu639380" For Temu $100 Off? We understand you might be wondering, "What's the secret behind this incredible $100 discount?" Well, let us unveil the key to unlocking massive savings on Temu: the acu639380 coupon code. This is not just any ordinary discount code; it's your gateway to a treasure trove of deals, whether you are a seasoned Temu shopper or just discovering the magic of online bargains. Whether you are a new customer eager to explore the vast world of Temu or an existing loyal customer looking for even more reasons to shop, the $100 off Temu coupon is designed for you. We believe everyone deserves to experience the joy of saving, and that's precisely what this coupon code delivers. Imagine getting a flat $100 reduction on your purchase, or accessing a bundle of coupons totaling $100 for multiple delightful shopping sprees. Let's delve into the amazing benefits that await you when you use the acu639380 Temu coupon code $100 off: Flat $100 Off: Picture this – you find exactly what you've been searching for on Temu, add it to your cart, and then, with just a simple code, you instantly knock off a flat $100 from your total. It's like finding extra money in your pocket, ready to be spent on more of your favorite items. This is pure, unadulterated savings at your fingertips.   $100 Coupon Pack For Multiple Uses: Why settle for just a single discount when you can enjoy savings across multiple purchases? The acu639380 code can unlock a $100 coupon pack, giving you a collection of coupons to use on various orders. This means the savings keep coming, purchase after purchase, making your shopping experience continuously rewarding.   $100 Flat Discount For New Customers: Welcome to the Temu family! As a new customer, you are in for a special treat. Using the acu639380 code guarantees you a whopping $100 flat discount on your very first purchase. It's the perfect way to start your Temu journey, allowing you to explore and indulge without any hesitation. We believe in making your first impression truly unforgettable.   Extra $100 Promo Code For Existing Customers: We value your loyalty, and that's why we haven't forgotten our existing customers. The acu639380 code isn't just for newcomers; it's also an extra $100 promo code for existing customers. This is our way of saying thank you for being a part of the Temu community, giving you an added incentive to continue enjoying the incredible shopping experience we offer.   $100 Coupon For USA/Canada Users: Specifically for our valued shoppers in the USA and Canada, the acu639380 code unlocks a special $100 coupon tailored just for you. We understand the unique needs of our North American customers, and this localized offer ensures you get the maximum possible savings on a wide array of products. Consider it our special nod to your patronage.   Temu Coupon Code "acu639380" $100 Off For New Users In 2025 Are you stepping into the exciting world of Temu in 2025? Then you are in for a delightful surprise! We have an exclusive Temu coupon code $100 off designed specifically to welcome our new users with open arms and unbeatable savings. The acu639380 code is your magic key to unlocking a phenomenal shopping experience right from the get-go. We believe that your first experience with Temu should be nothing short of extraordinary, and what better way to start than with a generous $100 off? This Temu coupon code [acu639380] $100 off is your invitation to explore our vast catalog, discover incredible deals, and enjoy premium products without the premium price tag. We are committed to making your initial journey seamless, affordable, and utterly enjoyable. Here are the fantastic perks awaiting new users who utilize the Temu coupon code $100 off “acu639380” in 2025: Flat $100 Discount For New Users: Imagine signing up for Temu and instantly being greeted with a flat $100 discount for new users. It's like receiving a welcome gift that allows you to explore and purchase your desired items at a significantly reduced price. This is the perfect way to kickstart your Temu shopping adventure.   $100 Coupon Bundle For New Customers: Why limit your savings to just one purchase? As a new customer using the acu639380 code, you can unlock a $100 coupon bundle. This means you receive a collection of coupons, each offering substantial discounts, ready for you to use across multiple orders. The savings just keep on coming!   Up To $100 Coupon Bundle For Multiple Uses: The value keeps escalating! The acu639380 code can potentially unlock a coupon bundle totaling up to $100, designed for multiple uses across different categories and purchases. This flexibility ensures that you can maximize your savings no matter what you're shopping for on Temu.   Free Shipping To 68 Countries: Shipping costs can often be a deterrent to online shopping, but not with Temu! Using the acu639380 code June also grant you free shipping to 68 countries. This incredible benefit extends your savings even further, making your online purchases even more cost-effective and convenient, no matter where you are located within our extensive delivery network.   Extra 30% Off On Any Purchase For First-Time Users: As if the $100 discount and free shipping weren't enough, new users also get to enjoy an extra 30% off on any purchase for first-time users with the acu639380 code. This is the cherry on top, allowing you to save even more on your initial order. It’s an unparalleled opportunity to grab everything you need and desire at an incredibly low price point.   How To Redeem The Temu Coupon $100 Off For New Customers? Ready to seize these amazing savings as a new Temu customer? Redeeming your Temu $100 coupon is incredibly easy and straightforward. We've crafted a simple step-by-step guide to ensure you can effortlessly apply the acu639380 code and start enjoying your discounts right away. No complications, just pure savings! Follow these steps to redeem your Temu $100 off coupon code [acu639380] for new users: Step 1: Download the Temu App or Visit the Website First things first, if you haven't already, download the Temu app from your mobile app store (available on both iOS and Android) or visit the Temu website on your computer's browser. Temu's user-friendly interface is designed for seamless navigation, ensuring a pleasant shopping experience from the moment you arrive. Step 2: Sign Up or Create a New Account To unlock the new user benefits, you'll need to create a Temu account. Click on the "Sign Up" or "Register" button, usually located at the top right corner of the website or app. Follow the simple registration process, which typically involves providing your email address or phone number and creating a password. Step 3: Start Shopping and Add Items to Your Cart Now comes the fun part! Browse through Temu's vast catalog of products, from fashion and electronics to home goods and more. Once you find items you love, simply click "Add to Cart" for each item you wish to purchase. Take your time and explore the incredible variety Temu offers. Step 4: Proceed to Checkout Once you've filled your cart with all your desired items, click on the cart icon, usually located at the top right corner, and then proceed to checkout. This is where you'll finalize your order and apply your amazing discount. Step 5: Apply Your Temu $100 Coupon "acu639380" During the checkout process, you'll find a section labeled "Apply Coupon Code" or "Promo Code." This is where the magic happens. Carefully enter the acu639380 code into the designated box. Double-check to ensure you've typed it correctly to avoid any errors. Step 6: Click "Apply" and Enjoy Your Discount! After entering the acu639380 code, click the "Apply" button. You'll instantly see the Temu $100 coupon being applied to your order total. Watch as the price magically decreases, reflecting your fantastic savings! Step 7: Complete Your Purchase With your discount applied, review your order summary to confirm the reduced price. Then, proceed to complete your purchase by entering your shipping address, payment details, and confirming your order. Congratulations, you've just snagged incredible savings on Temu! Temu Coupon [acu639380] $100 Off For Existing Customers We haven't forgotten about our loyal Temu shoppers! We deeply appreciate your continued support and are thrilled to offer Temu $100 coupon codes for existing users. Yes, you heard it right! The savings aren't just for new customers; as a valued existing customer, you too can unlock fantastic discounts with the acu639380 coupon code. We believe in rewarding our loyal community, and this Temu coupon $100 off for existing customers free shipping using the acu639380 code is our way of saying thank you for being a part of the Temu family. Continue enjoying the incredible variety, quality, and affordability Temu offers, now with even more savings in your pocket. Here are the amazing benefits that existing Temu users can unlock with the acu639380 coupon code: $100 Extra Discount For Existing Temu Users: As a thank you for your loyalty, you can enjoy a $100 extra discount for existing Temu users with the acu639380 code. This is our way of showing our appreciation, allowing you to save significantly on your next Temu purchase.   $100 Coupon Bundle For Multiple Purchases: Just like our new customers, existing users can also unlock a $100 coupon bundle for multiple purchases using the acu639380 code. This means savings across various orders, ensuring that you can consistently enjoy discounts while shopping on Temu.   Free Gift With Express Shipping All Over The USA/Canada: As a special bonus for our existing customers in the USA and Canada, using the acu639380 code June also unlock a free gift with express shipping all over the USA/Canada. This adds extra value to your purchase, delivering a delightful surprise right to your doorstep with speedy shipping.   Extra 30% Off On Top Of The Existing Discount: Want to maximize your savings even further? The acu639380 code can also grant you an extra 30% off on top of the existing discount. This means you can combine this coupon with other ongoing promotions and sales, potentially stacking up incredible savings on your Temu purchases.   Free Shipping To 68 Countries: Just like new users, existing customers using the acu639380 code June also be eligible for free shipping to 68 countries. This widely applicable free shipping offer ensures that no matter where you are in our extensive delivery network, you can enjoy cost-effective and convenient shopping.   How To Use The Temu Coupon Code "acu639380" $100 Off For Existing Customers? Using the Temu coupon code $100 off as an existing customer is just as simple as it is for new users! We've created another easy-to-follow step-by-step guide to ensure you can quickly apply the Temu coupon $100 off code “acu639380” and start enjoying your well-deserved discounts. Here’s how existing Temu customers can redeem the acu639380 coupon code: Step 1: Open the Temu App or Visit the Website Begin by launching the Temu app on your mobile device or navigating to the Temu website on your computer. Ensure you are logged into your existing Temu account. Step 2: Browse and Add Items to Your Cart Explore Temu's vast selection of products and add your desired items to your shopping cart. Whether you are restocking on essentials or treating yourself to something special, Temu has a wide range of options to choose from. Step 3: Proceed to Checkout Once you've selected all your items, click on the cart icon and proceed to the checkout page. Step 4: Locate the "Apply Coupon Code" Section During the checkout process, look for the section labeled "Apply Coupon Code" or "Promo Code." This is usually clearly visible on the checkout page. Step 5: Enter Your Temu Coupon Code "acu639380" In the designated box, carefully type in the Temu coupon code $100 off “acu639380”. Double-check for accuracy to ensure the code is applied successfully. Step 6: Click "Apply" and Watch Your Savings Appear! Click the "Apply" button after entering the code. You'll instantly see the Temu coupon $100 off being reflected in your order summary. Enjoy the satisfying sight of your total price decreasing! Step 7: Complete Your Order Review your order summary with the discount applied, confirm your shipping details and payment method, and finalize your purchase. Congratulations! You've successfully used your Temu coupon code and unlocked fantastic savings as a loyal customer. Latest Temu Coupon $100 Off First Order Are you about to place your very first order on Temu? Prepare for an incredible start! The latest Temu coupon $100 off first order is here to make your initial shopping experience absolutely delightful and budget-friendly. The acu639380 code is your ticket to maximizing savings right from the moment you join the Temu community. We believe in making first impressions count, and that's why we've made sure that your Temu coupon code first order is exceptionally rewarding. With the Temu coupon code $100 off first time user offer unlocked by the acu639380 code, you can explore our extensive catalog and indulge in your desired items without worrying about breaking the bank. Here are the exciting benefits awaiting you when you use the acu639380 coupon code for your first Temu order: Flat $100 Discount For The First Order: Imagine starting your Temu journey with a flat $100 discount for the first order! The acu639380 code makes this a reality, giving you substantial savings right from the start. It's the perfect incentive to explore and discover everything Temu has to offer.   $100 Temu Coupon Code For The First Order: The acu639380 code unlocks a dedicated $100 Temu coupon code for the first order, ensuring you receive maximum savings on your initial purchase. This is a fantastic opportunity to try out Temu and experience the incredible value we provide.   Up To $100 Coupon For Multiple Uses: Even with your first order, the savings don't have to end there. The acu639380 code June also grant you access to a coupon bundle up to $100 for multiple uses, potentially extending your savings beyond your initial purchase and into future shopping sprees.   Free Shipping To 68 Countries: Make your first order even more cost-effective with free shipping to 68 countries, potentially unlocked by the acu639380 code. This benefit eliminates shipping costs, making your first Temu experience even more budget-friendly and convenient.   Extra 30% Off On Any Purchase For The First Order: To top it all off, new customers using the acu639380 code can enjoy an extra 30% off on any purchase for the first order. This incredible bonus discount, combined with the $100 savings and free shipping, ensures that your first Temu order is exceptionally affordable and rewarding.   How To Find The Temu Coupon Code "acu639380" $100 Off? Wondering where to find this incredible Temu coupon $100 off? We've made it easy for you to access the acu639380 code and other amazing Temu deals. Finding your way to savings is simpler than you might think! Here are some reliable ways to find the Temu coupon $100 off and other exciting promotions: Sign Up For The Temu Newsletter: One of the most effective ways to stay updated on the Temu coupon $100 off and other exclusive offers is to sign up for the Temu newsletter. By subscribing, you'll receive regular emails directly from Temu, often containing verified and tested coupons, promo codes, and early access to sales events. It's like having savings delivered straight to your inbox!   Visit Temu's Social Media Pages: Temu is active on various social media platforms, such as Facebook, Instagram, and Twitter. Following Temu's official social media pages is a great way to discover the Temu coupon $100 off and other limited-time promotions. Temu often posts about new deals, flash sales, and exclusive coupon codes on their social media channels, keeping you in the loop on the latest savings opportunities.   Explore Trusted Coupon Websites: Numerous reputable coupon websites and online deal platforms are dedicated to collecting and sharing the latest and working coupon codes for various online retailers, including Temu. Websites like RetailMeNot, Honey, and often feature Temu coupon $100 off and other verified promo codes. Simply search for "Temu coupons" on these sites to find a list of available deals. Always ensure you are using trusted coupon sites to avoid expired or invalid codes.   When searching for coupon codes, remember to look for the specific Temu coupon $100 off Reddit threads and online communities. Platforms like Reddit often have dedicated communities where users share and verify coupon codes, including those for Temu. However, always double-check the validity and terms of any coupon code you find on user-generated platforms to ensure it is current and applicable to your purchase. Is Temu $100 Off Coupon Legit? This is a question we understand you might be asking, and we're here to put your mind at ease! Yes, the Temu $100 Off Coupon Legit offered with the acu639380 code is absolutely legitimate and ready for you to use. We take pride in providing verified and working coupon codes that deliver real savings to our valued customers. You can confidently use our Temu 100 off coupon legit with the acu639380 code to unlock the advertised $100 discount and other fantastic benefits. We understand the importance of trust and transparency, and we want to assure you that our coupon codes are not only legitimate but also regularly tested and verified to ensure they function correctly and provide the promised discounts. Our Temu coupon code “acu639380” is absolutely legit and designed to help you save money on your Temu purchases. We work diligently to ensure that our coupon codes are up-to-date, valid, and provide the advertised discounts without any hidden catches or misleading claims. Furthermore, our Temu coupon code is valid worldwide, meaning it's not restricted to specific regions. Whether you are shopping from the USA, Canada, Europe, or any of the 68 countries Temu ships to, you can use the acu639380 code to enjoy the $100 discount and other associated benefits. And importantly, our coupon code doesn't have any expiration date, meaning you can use it anytime you want, giving you flexibility and peace of mind. So, shop with confidence knowing that the Temu $100 off coupon legit with the acu639380 code is a real and reliable way to save money on your Temu purchases. We are committed to providing you with genuine savings opportunities and a trustworthy shopping experience. How Does Temu $100 Off Coupon Work? The acu639380 Temu coupon code $100 off first-time user and for existing users works in a simple and straightforward manner to provide you with instant savings on your Temu purchases. Essentially, it acts as a digital discount voucher that you apply at checkout to reduce your order total. Here's a detailed explanation of how Temu $100 off coupon works: When you enter the acu639380 coupon code in the designated "Apply Coupon Code" box during the checkout process on the Temu app or website, the Temu system instantly recognizes the code and verifies its validity. Upon successful verification, the system automatically applies the promised discount to your order total. The discount can take various forms depending on the specific offer associated with the acu639380 code. It might be a flat $100 discount, meaning a fixed amount of $100 is subtracted from your total purchase value, regardless of the order total (within any specified terms and conditions). Alternatively, it could be in the form of a coupon bundle totaling $100, providing you with a collection of smaller coupons to use across multiple purchases. In some cases, the Temu coupon codes 100 off with the acu639380 code might also unlock additional benefits, such as free shipping or extra percentage discounts (e.g., 30% off). These bonus perks further enhance your savings and make your Temu shopping experience even more rewarding. The beauty of the acu639380 coupon code is its ease of use and instant gratification. With just a few clicks, you can significantly reduce your spending and enjoy your desired items at a fraction of the original price. It's a smart and convenient way to shop online and maximize your budget. How To Earn Temu $100 Coupons As A New Customer? Beyond the fantastic Temu coupon code $100 off with the acu639380 code, Temu offers various other exciting ways for new customers to earn even more coupons and maximize their savings. We believe in showering our new users with welcome rewards! Here are some popular methods to earn Temu $100 coupons as a new customer: When you first sign up for a Temu account, you are often greeted with a welcome bonus package that June include a 100 off Temu coupon code [acu639380] or a bundle of coupons totaling $100. This initial sign-up bonus is Temu's way of saying "welcome" and encouraging you to explore their platform and start shopping. Keep an eye out for pop-up messages or email notifications immediately after creating your account to claim your welcome coupons. Temu frequently runs promotional events and contests where new customers have the opportunity to win Temu coupon code [acu639380] $100 off or other valuable coupons. These promotions might involve activities like referral programs (where you earn coupons for inviting friends to Temu), social media contests, or in-app games and challenges. Participating in these events can be a fun and rewarding way to accumulate more savings. Temu's referral program is a particularly lucrative way to earn coupons. By sharing your unique referral link with friends and family, you can earn Temu coupon code [acu639380] $100 off or other coupon rewards when they sign up for Temu through your link and make their first purchase. It's a win-win situation – your friends get to discover Temu amazing deals, and you get rewarded with extra savings. Keep an eye on Temu's promotional banners and sections within the app and website. Temu often highlights special coupon offers and deals in these areas, including opportunities to earn 100 off Temu coupon code or other valuable discounts. Regularly checking these promotional sections ensures you don't miss out on any current coupon-earning opportunities. What Are The Advantages Of Using The Temu Coupon $100 Off? Using the Temu coupon code $100 off with the acu639380 code unlocks a plethora of advantages, making your shopping experience on Temu not only affordable but also incredibly rewarding. We believe in delivering exceptional value to our customers, and these advantages perfectly illustrate that commitment. Here's a bulleted list highlighting the key advantages of using the Temu coupon code 100 off with the acu639380 code: $100 Discount On The First Order: The most immediate and significant advantage is the $100 discount on the first order for new users. This substantial saving allows you to explore Temu's offerings and purchase your desired items at a significantly reduced price right from the start.   $100 Coupon Bundle For Multiple Uses: The Temu coupon code [acu639380] $100 off often unlocks a $100 coupon bundle for multiple uses. This means you receive a collection of coupons, each providing valuable discounts, ready to be used across multiple purchases, extending your savings beyond a single order.   70% Discount On Popular Items: In addition to the $100 savings, the acu639380 code June also unlock access to special promotions, such as a 70% discount on popular items. This allows you to grab trending and sought-after products at incredibly low prices, making your shopping experience even more exciting.   Extra 30% Off For Existing Temu Customers: Loyalty deserves to be rewarded! Existing Temu customers can also benefit from the acu639380 code with an extra 30% off for existing Temu customers. This is our way of thanking you for your continued patronage and providing you with added savings on your regular purchases.   Up To 90% Off In Selected Items: Prepare for jaw-dropping deals! The Temu coupon code $100 off June also unlock promotions offering up to 90% off in selected items. These deep discounts allow you to snag incredible bargains on a wide range of products, stretching your budget further than ever before.   Free Gift For New Users: As a welcome gift, new users utilizing the acu639380 code June also receive a free gift for new users. This added perk enhances your first Temu experience and provides a delightful surprise alongside your discounted purchase.   Free Delivery To 68 Countries: Shipping costs can often add up, but not with the Temu coupon code $100 off! This code June also grant you free delivery to 68 countries, eliminating shipping fees and making your online purchases even more cost-effective and convenient, no matter where you are located within our extensive delivery network.   Temu $100 Discount Code And Free Gift For New And Existing Customers The Temu $100 off coupon code with the acu639380 code isn't just about one benefit – it's about a cascade of savings and rewards for both new and existing customers! We believe in showering our shoppers with multiple perks to make their Temu experience truly exceptional. There are truly multiple benefits to using our Temu coupon code. Let's break down the incredible advantages you can unlock with the $100 off Temu coupon code “acu639380”: $100 Discount For The First Order: Whether you are a new or existing customer making your first order of a new account, the acu639380 code can unlock a $100 discount for the first order. This significant saving sets the stage for a budget-friendly shopping spree.   Extra 30% Off On Any Item: Want to save even more? The acu639380 code June also grant you an extra 30% off on any item. This percentage discount can be applied across Temu's vast catalog, allowing you to maximize your savings on your preferred products.   Free Gift For New Temu Users: New to Temu? Prepare for a warm welcome! The acu639380 code June also unlock a free gift for new Temu users. This complimentary item adds a touch of delight to your first purchase, making your initial experience even more memorable.   Up To 70% Discount On Any Item On The Temu App: Dive into deep discounts with the acu639380 code! It June unlock promotions offering up to 70% discount on any item on the Temu app. These massive markdowns allow you to snag incredible bargains across various categories and products.   Free Gift With Free Shipping In 68 Countries Including The USA And UK: As a truly exceptional bonus, the acu639380 code June even unlock a free gift with free shipping in 68 countries including the USA and UK. This combined offer provides both a complimentary item and free delivery, making your Temu shopping experience incredibly cost-effective and convenient, no matter where you are.   Pros And Cons Of Using The Temu Coupon Code [acu639380] $100 Off This Month Like any offer, the Temu coupon $100 off code with the acu639380 code has its set of advantages and considerations. We believe in transparency and want to provide you with a balanced perspective to help you make the most informed shopping decisions. Here are the pros and cons of using the Temu coupon 100 off coupon “acu639380” this month: Pros: Significant Savings: The most obvious pro is the potential for significant savings. A $100 discount, coupled with other benefits like percentage discounts, free shipping, and free gifts, can dramatically reduce your overall shopping costs, allowing you to buy more for less.   Versatility For New And Existing Users: The Temu coupon $100 off with the acu639380 code caters to both new and existing customers, ensuring that everyone can benefit from the savings. Whether you are discovering Temu for the first time or are a loyal shopper, this coupon code offers valuable rewards.   Wide Product Range Applicability: The discounts unlocked by the acu639380 code are often applicable across a wide range of products on Temu, from fashion and electronics to home goods and more. This versatility allows you to save on various items you need or desire.   Potential For Stackable Savings: In some cases, the Temu coupon $100 off coupon can be stacked with other ongoing promotions or sales on Temu, potentially leading to even greater overall savings. This stacking effect can maximize your discounts and help you stretch your budget further.   Global Validity: The acu639380 code and associated benefits are often valid in 68 countries worldwide, including the USA and UK. This wide geographical validity ensures that shoppers across numerous regions can access and enjoy the savings.   Cons: Limited-Time Offers: While the acu639380 code itself June not have an expiration date, some of the specific benefits associated with it (like free gifts or percentage discounts) might be limited-time offers. It's essential to check the terms and conditions to understand the duration of all perks.   Minimum Purchase Requirements (Potentially): While we strive for no minimum purchase requirements, some very specific or deeply discounted promotions associated with the acu639380 code might occasionally have a minimum purchase threshold. Always review the terms and conditions to confirm if any minimum spending is required to unlock all benefits. However, for the standard $100 off offer, there is generally no minimum purchase needed.   Terms And Conditions Of Using The Temu Coupon $100 Off In 2025 To ensure a smooth and transparent shopping experience, it's essential to understand the terms and conditions of using the Temu coupon $100 off free shipping and other benefits associated with the latest Temu coupon code $100 off “acu639380” in 2025. We believe in clear and upfront communication, so you know exactly what to expect. Here are some key terms and conditions to be aware of when using the acu639380 coupon code: No Expiration Date: Fantastic news! Our acu639380 coupon code doesn't have any expiration date. You can use it anytime you want in 2025 and beyond, giving you ample flexibility and peace of mind to shop at your convenience.   Valid For New And Existing Users: The acu639380 code is designed to be inclusive, valid for both new and existing users. Whether you are a first-time shopper or a loyal Temu customer, you can take advantage of the savings and benefits.   Applicable In 68 Countries Worldwide: Enjoy global savings! Our acu639380 coupon code is valid in 68 countries worldwide, including major regions like the USA, Canada, Europe, and many more. No matter where you are shopping from within our delivery network, you can access the discounts.   No Minimum Purchase Requirements: We believe in making savings accessible to everyone, regardless of their spending amount. Generally, there are no minimum purchase requirements for using our Temu coupon code “acu639380”. You can apply the code and enjoy the discounts even on smaller orders, making it truly versatile.   One-Time Use Per Account (Potentially For Certain Benefits): While the code itself June be reusable, certain specific benefits unlocked by the acu639380 code, such as the flat $100 discount or free gift, might be limited to one-time use per Temu account, particularly for new user welcome offers. However, coupon bundles for multiple uses provide ongoing savings across several orders. Always review the specific terms of each offer.   Final Note: Use The Latest Temu Coupon Code "acu639380" $100 Off In conclusion, the Temu coupon code $100 off with the acu639380 code is your ultimate key to unlocking incredible savings and a rewarding shopping experience on Temu. Don't miss out on this opportunity to maximize your budget and indulge in your desired items at unbeatable prices. We encourage you to take advantage of the Temu coupon code $100 off “acu639380” today and experience the joy of smart and affordable online shopping. Happy saving, and happy shopping on Temu! FAQs Of Temu $100 Off Coupon Question 1: Is the Temu $100 off coupon code "acu639380" valid for both new and existing customers? Answer: Yes, absolutely! The Temu $100 off coupon code "acu639380" is designed to be inclusive and beneficial for both new customers discovering Temu for the first time and our valued existing customers who are already part of the Temu family. Everyone can enjoy the fantastic savings this code offers. Question 2: Is there any minimum purchase amount required to use the Temu $100 off coupon code "acu639380"? Answer: Generally, no, there is no minimum purchase amount required to redeem the Temu $100 off coupon code "acu639380". You can apply this code and enjoy the discounts even on smaller orders, making it incredibly versatile and accessible for all your shopping needs on Temu. Question 3: In which countries is the Temu $100 coupon code "acu639380" valid? Answer: The Temu $100 off coupon code "acu639380" is widely valid in 68 countries around the world, including major shopping destinations like the USA, Canada, and numerous European nations. This extensive global validity ensures that a vast majority of our customers can benefit from these amazing savings, no matter where they are located within our delivery network. Question 4: Does the Temu $100 off coupon code "acu639380" have an expiration date? Answer: No, you don't need to worry about rushing to use it! The Temu $100 off coupon code "acu639380" is designed with your convenience in mind and does not have an expiration date. This means you have the flexibility to use it anytime you want, whenever you are ready to shop on Temu and maximize your savings at your own pace. Question 5: Can I stack the Temu $100 off coupon code "acu639380" with other promotions or discounts on Temu? Answer: In many cases, yes, you can potentially stack the Temu $100 off coupon code "acu639380" with other ongoing promotions or discounts that Temu might be offering. This ability to combine savings can lead to even greater overall reductions in your shopping costs, helping you stretch your budget even further and get the most value for your money on Temu.  
    • Temu Coupon Code $100 OFF → [acu639380] for Existing Customers Unlock $100 Off with  Temu Coupon Code (acu639380)  Temu continues to lead the e-commerce world with unbeatable discounts and trending products, and June 2025 is no exception. With  Temu coupon code (acu639380), you can score up to $100 off, whether you're a first-time shopper or a returning customer. With ultra-fast delivery, free shipping across 67 countries, and discounts reaching up to 90% off,  Temu is offering exclusive bundles and promo codes this June that are simply too good to pass up. Here’s how to make the most of  Temu coupon code (acu639380) and start saving today. Why June 2025 Is the Best Time to Shop on  Temu June is packed with limited-time offers, trending new arrivals, and secret price cuts across all categories. From fashion and electronics to beauty and home essentials,  Temu delivers must-have items at prices that crush the competition. Apply  Temu coupon code (acu639380) and get access to: $100 off for new users $100 off for existing customers 40% extra discount on select categories A $100 coupon bundle for both new and returning shoppers A free welcome gift for first-time buyers Exclusive Benefits of  Temu Coupon Codes These tailored discounts are crafted for every type of shopper. Maximize your savings with:  Temu coupon code (acu639380) $100 off — Slash your total bill on bulk purchases.  Temu coupon code (acu639380) for existing users — Premium deals just for loyal shoppers.  Temu coupon code (acu639380) for new users — Save big on your first order.  Temu coupon code (acu639380) 40% off — Ideal for fashion and seasonal finds.  Temu $100 coupon bundle — Unlock stacked discounts across departments.  Temu first-time user coupon — Get a head start with a gift and discount. Country-Specific Deals with  Temu Code (acu639380)  Temu’s global reach means personalized offers no matter where you shop:  Temu coupon code $100 off — USA  Temu coupon code $100 off — Canada  Temu coupon code $100 off — UK  Temu coupon code $100 off — Japan  Temu coupon code 40% off — Mexico  Temu coupon code 40% off — Brazil  Temu coupon code $100 off — Germany  Temu coupon code $100 off — France  Temu new user coupon — Argentina  Temu coupons for existing users — Italy  Temu promo code (acu639380) for June 2025 — Spain What to Buy on  Temu in June 2025  Temu’s diverse inventory spans thousands of categories. Here are hot picks eligible for  Temu discount code (acu639380): Smart gadgets and accessories Fashion-forward styles for all ages Stylish home decor and space-saving solutions Wellness, fitness, and beauty essentials Kitchen tools and cookware Office supplies, toys, and gifts My Experience Saving $100 with  Temu Coupon Code (acu639380) When I used  Temu coupon code (acu639380) as a returning customer, I immediately received a $100 discount. Pairing that with a 40% off category promo and the $100 coupon bundle, I walked away with over $200 in value for under $80. You can enjoy the same benefits. Just apply  Temu coupon code (acu639380) at checkout, and your savings will automatically apply — with free global delivery to top it off. More  Temu Deals for June 2025 This month is loaded with rotating offers, surprise bundles, and daily flash sales. Stay updated on: New drops using the  Temu new user coupon Weekly refreshes of  Temu coupons for existing users Regional promotions with  Temu promo code (acu639380) for June 2025 Final Thoughts No matter where you are — North America, Europe, or South America —  Temu coupon code (acu639380) is your key to serious savings. With discounts for both new and loyal customers, now is the time to make the most of  Temu’s irresistible prices. Use acu639380 today to enjoy exclusive perks and unlock smarter shopping at unbeatable value.  
    • TℰℳU Coupon Code $100 Off [acu639380] First Time User Unlock Huge Savings:  TℰℳU Coupon Code (acu639380) for June 2025  TℰℳU is transforming the way the world shops—and June 2025 delivers its boldest offers yet. With the exclusive  TℰℳU coupon code (acu639380), you're entering a world of rewards: from a $100 discount to premium coupon bundles, it's your passport to smart, stylish savings. The  TℰℳU Advantage in June 2025  TℰℳU is known for redefining affordability and access. With unbeatable prices across trending categories—from fashion to electronics—it now delivers to 67 countries with speed and reliability. But this month, it’s not just about what you buy. It’s about how much you save. With  TℰℳU coupon code (acu639380) in hand, your savings soar. Instant Rewards with  TℰℳU Coupon Code (acu639380) If you haven't activated this exclusive code, here's what you're missing: $100 Off for first-time users $100 Off for returning customers 40% Off on sitewide items Free gifts for new sign-ups $100 Coupon Bundle available for all users What Makes  TℰℳU Coupon Code (acu639380) Unique? This code is designed to reward all shoppers—first-timers and loyal fans alike. Here’s how each discount delivers:  TℰℳU coupon code (acu639380) $100 off: Best for newcomers stocking up.  TℰℳU coupon code (acu639380) $100 off for existing users: Returning shoppers save big.  TℰℳU coupon code (acu639380) 40% off: Big savings on trending picks.  TℰℳU $100 coupon bundle: Split savings across several purchases.  TℰℳU first time user coupon: Ideal to kickstart your shopping spree. Global Value, Personalized Access  TℰℳU isn't just generous—it’s international. Whether you're in a Toronto high-rise or a Yorkshire farmhouse, the  TℰℳU promo code (acu639380) unlocks smart deals and chic finds. Coupon Code Highlights by Country  TℰℳU coupon code $100 off for USA – (acu639380)  TℰℳU coupon code $100 off for Canada – (acu639380)  TℰℳU coupon code $100 off for UK – (acu639380)  TℰℳU coupon code $100 off for Japan – (acu639380)  TℰℳU coupon code 40% off for Mexico – (acu639380)  TℰℳU coupon code 40% off for Brazil – (acu639380) Why  TℰℳU is the Marketplace of the Moment Unbeatable prices: Save up to 90% every day Worldwide reach: Ships to 67 countries New promotions: Fresh  TℰℳU new offers in June 2025 Fast, free delivery: No matter where you are FAQ: Maximize Your  TℰℳU Experience What’s the best  TℰℳU discount in June 2025? The top offer is  TℰℳU coupon code (acu639380) $100 off, for both new and existing users. Can I use these deals worldwide? Yes. The  TℰℳU discount code (acu639380) for June 2025 is valid in North America, South America, Europe, and Asia. Can I combine discounts? Absolutely. Pair your  TℰℳU $100 coupon bundle with seasonal deals for extra savings. Final Takeaway Smart shopping isn’t just about what you add to your cart—it’s about how you unlock value. With  TℰℳU coupon codes for new users,  TℰℳU coupon codes for existing users, and exciting June 2025 promotions, the best time to save is now. Don’t wait. Use  TℰℳU coupon code (acu639380) today to claim your rewards and transform the way you shop. New offers, global access, and exclusive savings await.  
    • I used the Temu coupon code acu639380 and got a $200 discount bundle. Works for new and existing users in the US and Canada. Free shipping included. Just enter the code at checkout.
    • Maybe the server or a java instance is still running in background - so restarting the server after the crash results in the "failed to bind port" error   The crash itself points to jvm.dll - so something on your system prevents java from working - maybe the antivirus program, firewall or something else - I have no idea
  • Topics

×
×
  • Create New...

Important Information

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