BlockBreakingDropType class
Пакет: com.hypixel.hytale.server.core.asset.type.blocktype.config
Файл: com/hypixel/hytale/server/core/asset/type/blocktype/config/BlockBreakingDropType.java
implements: NetworkSerializable<BlockBreaking>
Поля (2)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
BuilderCodec<BlockBreakingDropType> |
CODEC |
|
BlockBreaking |
var1 |
Методы (6)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
String |
getDropListIdString getDropListId() |
public |
String |
getGatherTypeString getGatherType() |
public |
String |
getItemIdString getItemId() |
public |
int |
getQualityint getQuality() |
public |
int |
getQuantityint getQuantity() |
|
|
if if(this.itemId != null) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.blocktype.config;
class="kw">import com.hypixel.hytale.assetstore.codec.ContainedAssetCodec;
class="kw">import com.hypixel.hytale.codec.Codec;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;
class="kw">import com.hypixel.hytale.protocol.BlockBreaking;
class="kw">import com.hypixel.hytale.server.core.asset.type.item.config.Item;
class="kw">import com.hypixel.hytale.server.core.asset.type.item.config.ItemDropList;
class="kw">import com.hypixel.hytale.server.core.io.NetworkSerializable;
class="kw">import javax.annotation.Nonnull;
class="kw">public class BlockBreakingDropType class="kw">implements NetworkSerializable<BlockBreaking> {
class="kw">public class="kw">static class="kw">final BuilderCodec<BlockBreakingDropType> CODEC = BuilderCodec.builder(BlockBreakingDropType.class, BlockBreakingDropType::new)
.append(new KeyedCodec<>("GatherType", Codec.STRING), (var0, var1) -> var0.gatherType = var1, var0 -> var0.gatherType)
.add()
.append(new KeyedCodec<>("Quality", Codec.INTEGER), (var0, var1) -> var0.quality = var1, var0 -> var0.quality)
.add()
.<String>append(new KeyedCodec<>("ItemId", Codec.STRING), (var0, var1) -> var0.itemId = var1, var0 -> var0.itemId)
.addValidatorLate(() -> Item.VALIDATOR_CACHE.getValidator().late())
.add()
.append(new KeyedCodec<>("Quantity", Codec.INTEGER), (var0, var1) -> var0.quantity = var1, var0 -> var0.quantity)
.add()
.<String>append(
new KeyedCodec<>("DropList", new ContainedAssetCodec<>(ItemDropList.class, ItemDropList.CODEC)),
(var0, var1) -> var0.dropListId = var1,
var0 -> var0.dropListId
)
.addValidatorLate(() -> ItemDropList.VALIDATOR_CACHE.getValidator().late())
.add()
.build();
class="kw">protected String gatherType;
class="kw">protected int quality;
class="kw">protected String itemId;
class="kw">protected String dropListId;
class="kw">protected int quantity = 1;
class="kw">public BlockBreakingDropType(String var1, int var2, int var3, String var4, String var5) {
this.gatherType = var1;
this.quality = var2;
this.quantity = var3;
this.itemId = var4;
this.dropListId = var5;
}
class="kw">protected BlockBreakingDropType() {
}
@Nonnull
class="kw">public BlockBreaking toPacket() {
BlockBreaking var1 = new BlockBreaking();
var1.gatherType = this.gatherType;
var1.quality = this.quality;
var1.quantity = this.quantity;
if (this.itemId != null) {
var1.itemId = this.itemId.toString();
}
var1.dropListId = this.dropListId;
class="kw">return var1;
}
class="kw">public String getGatherType() {
class="kw">return this.gatherType;
}
class="kw">public int getQuality() {
class="kw">return this.quality;
}
class="kw">public int getQuantity() {
class="kw">return this.quantity;
}
class="kw">public String getItemId() {
class="kw">return this.itemId;
}
class="kw">public String getDropListId() {
class="kw">return this.dropListId;
}
@Nonnull
class="kw">public BlockBreakingDropType withoutDrops() {
class="kw">return new BlockBreakingDropType(this.gatherType, 0, 0, null, null);
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "BlockBreakingDropType{gatherType='"
+ this.gatherType
+ "', quality="
+ this.quality
+ ", quantity="
+ this.quantity
+ ", itemId="
+ this.itemId
+ ", dropListId='"
+ this.dropListId
+ "'}";
}
}