Search in sources :

Example 1 with EntityFixMessage

use of ValkyrienWarfareControl.Network.EntityFixMessage in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class PhysicsObject method fixEntity.

/**
	 * ONLY USE THESE 2 METHODS TO EVER ADD/REMOVE ENTITIES, OTHERWISE YOU'LL RUIN EVERYTHING!
	 *
	 * @param toFix
	 * @param posInLocal
	 */
public void fixEntity(Entity toFix, Vector posInLocal) {
    EntityFixMessage entityFixingMessage = new EntityFixMessage(wrapper, toFix, true, posInLocal);
    for (EntityPlayerMP watcher : watchingPlayers) {
        ValkyrienWarfareControlMod.controlNetwork.sendTo(entityFixingMessage, watcher);
    }
    entityLocalPositions.put(toFix.getPersistentID().hashCode(), posInLocal);
}
Also used : EntityFixMessage(ValkyrienWarfareControl.Network.EntityFixMessage) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP)

Example 2 with EntityFixMessage

use of ValkyrienWarfareControl.Network.EntityFixMessage in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class PhysicsObject method unFixEntity.

/**
	 * ONLY USE THESE 2 METHODS TO EVER ADD/REMOVE ENTITIES, OTHERWISE YOU'LL RUIN EVERYTHING!
	 *
	 * @param toFix
	 * @param posInLocal
	 */
public void unFixEntity(Entity toUnfix) {
    EntityFixMessage entityUnfixingMessage = new EntityFixMessage(wrapper, toUnfix, false, null);
    for (EntityPlayerMP watcher : watchingPlayers) {
        ValkyrienWarfareControlMod.controlNetwork.sendTo(entityUnfixingMessage, watcher);
    }
    entityLocalPositions.remove(toUnfix.getPersistentID().hashCode());
}
Also used : EntityFixMessage(ValkyrienWarfareControl.Network.EntityFixMessage) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP)

Aggregations

EntityFixMessage (ValkyrienWarfareControl.Network.EntityFixMessage)2 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)2