ItemPlayerAnimationsPacketGenerator class
Пакет: com.hypixel.hytale.server.core.asset.type.itemanimation
Файл: com/hypixel/hytale/server/core/asset/type/itemanimation/ItemPlayerAnimationsPacketGenerator.java
extends: DefaultAssetPacketGenerator<String, ItemPlayerAnimations>
Поля (4)
| Модификаторы | Тип | Имя |
|---|---|---|
|
UpdateItemPlayerAnimations |
var2 |
|
UpdateItemPlayerAnimations |
var2 |
|
UpdateItemPlayerAnimations |
var3 |
|
com.hypixel.hytale.protocol.ItemPlayerAnimations |
var5 |
Методы (1)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
|
for for(String var4 : var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.itemanimation;
class="kw">import com.hypixel.hytale.assetstore.map.DefaultAssetMap;
class="kw">import com.hypixel.hytale.protocol.ToClientPacket;
class="kw">import com.hypixel.hytale.protocol.UpdateType;
class="kw">import com.hypixel.hytale.protocol.packets.assets.UpdateItemPlayerAnimations;
class="kw">import com.hypixel.hytale.server.core.asset.packet.DefaultAssetPacketGenerator;
class="kw">import com.hypixel.hytale.server.core.asset.type.itemanimation.config.ItemPlayerAnimations;
class="kw">import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
class="kw">import java.util.Map;
class="kw">import java.util.Set;
class="kw">import javax.annotation.Nonnull;
class="kw">public class ItemPlayerAnimationsPacketGenerator class="kw">extends DefaultAssetPacketGenerator<String, ItemPlayerAnimations> {
class="kw">public ItemPlayerAnimationsPacketGenerator() {
}
@Nonnull
@Override
class="kw">public ToClientPacket generateInitPacket(DefaultAssetMap<String, ItemPlayerAnimations> var1, @Nonnull Map<String, ItemPlayerAnimations> var2) {
UpdateItemPlayerAnimations var3 = new UpdateItemPlayerAnimations();
var3.type = UpdateType.Init;
var3.itemPlayerAnimations = new Object2ObjectOpenHashMap(var2.size());
for (ItemPlayerAnimations var5 : var2.values()) {
var3.itemPlayerAnimations.put(var5.getId(), var5.toPacket());
}
class="kw">return var3;
}
@Nonnull
@Override
class="kw">public ToClientPacket generateUpdatePacket(@Nonnull Map<String, ItemPlayerAnimations> var1) {
UpdateItemPlayerAnimations var2 = new UpdateItemPlayerAnimations();
var2.type = UpdateType.AddOrUpdate;
var2.itemPlayerAnimations = new Object2ObjectOpenHashMap(var1.size());
for (ItemPlayerAnimations var4 : var1.values()) {
var2.itemPlayerAnimations.put(var4.getId(), var4.toPacket());
}
class="kw">return var2;
}
@Nonnull
@Override
class="kw">public ToClientPacket generateRemovePacket(@Nonnull Set<String> var1) {
UpdateItemPlayerAnimations var2 = new UpdateItemPlayerAnimations();
var2.type = UpdateType.Remove;
var2.itemPlayerAnimations = new Object2ObjectOpenHashMap(var1.size());
for (String var4 : var1) {
com.hypixel.hytale.protocol.ItemPlayerAnimations var5 = new com.hypixel.hytale.protocol.ItemPlayerAnimations();
var5.id = var4;
var2.itemPlayerAnimations.put(var4, var5);
}
class="kw">return var2;
}
}