Search in sources :

Example 1 with PacketSyncEffects

use of de.sanandrew.mods.claysoldiers.network.packet.PacketSyncEffects in project ClaySoldiersMod by SanAndreasP.

the class EntityClaySoldier method readSpawnData.

@Override
public void readSpawnData(ByteBuf buffer) {
    if (this.world.isRemote) {
        // just making sure this gets called on the client...
        PacketSyncUpgrades pktu = new PacketSyncUpgrades();
        pktu.fromBytes(buffer);
        pktu.applyUpgrades(this);
        PacketSyncEffects pkte = new PacketSyncEffects();
        pkte.fromBytes(buffer);
        pkte.applyEffects(this);
    }
}
Also used : PacketSyncEffects(de.sanandrew.mods.claysoldiers.network.packet.PacketSyncEffects) PacketSyncUpgrades(de.sanandrew.mods.claysoldiers.network.packet.PacketSyncUpgrades)

Example 2 with PacketSyncEffects

use of de.sanandrew.mods.claysoldiers.network.packet.PacketSyncEffects in project ClaySoldiersMod by SanAndreasP.

the class EntityClaySoldier method writeSpawnData.

@Override
public void writeSpawnData(ByteBuf buffer) {
    PacketSyncUpgrades pktu = new PacketSyncUpgrades(this, true, this.upgradeSyncList.stream().map(entry -> new UpgradeEntry(entry.getUpgrade(), entry.getUpgradeType())).toArray(UpgradeEntry[]::new));
    pktu.toBytes(buffer);
    PacketSyncEffects pkte = new PacketSyncEffects(this, true, this.effectSyncList.toArray(new ISoldierEffectInst[0]));
    pkte.toBytes(buffer);
}
Also used : PacketSyncEffects(de.sanandrew.mods.claysoldiers.network.packet.PacketSyncEffects) PacketSyncUpgrades(de.sanandrew.mods.claysoldiers.network.packet.PacketSyncUpgrades) UpgradeEntry(de.sanandrew.mods.claysoldiers.registry.upgrade.UpgradeEntry) ISoldierEffectInst(de.sanandrew.mods.claysoldiers.api.soldier.effect.ISoldierEffectInst)

Aggregations

PacketSyncEffects (de.sanandrew.mods.claysoldiers.network.packet.PacketSyncEffects)2 PacketSyncUpgrades (de.sanandrew.mods.claysoldiers.network.packet.PacketSyncUpgrades)2 ISoldierEffectInst (de.sanandrew.mods.claysoldiers.api.soldier.effect.ISoldierEffectInst)1 UpgradeEntry (de.sanandrew.mods.claysoldiers.registry.upgrade.UpgradeEntry)1