ItemStackSlotTransaction class
Пакет: com.hypixel.hytale.server.core.inventory.transaction
Файл: com/hypixel/hytale/server/core/inventory/transaction/ItemStackSlotTransaction.java
extends: SlotTransaction
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
boolean |
addToExistingSlot |
|
short |
var4 |
|
short |
var4 |
Методы (2)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
boolean |
isAddToExistingSlotboolean isAddToExistingSlot() |
abstract |
|
super super(var1, var2, var3, var4, var5, var6, var7, var8, var9) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.inventory.transaction;
class="kw">import com.hypixel.hytale.server.core.inventory.ItemStack;
class="kw">import com.hypixel.hytale.server.core.inventory.container.ItemContainer;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class ItemStackSlotTransaction class="kw">extends SlotTransaction {
class="kw">private class="kw">final boolean addToExistingSlot;
@Nullable
class="kw">private class="kw">final ItemStack query;
@Nullable
class="kw">private class="kw">final ItemStack remainder;
class="kw">public ItemStackSlotTransaction(
boolean var1,
@Nonnull ActionType var2,
short var3,
@Nullable ItemStack var4,
@Nullable ItemStack var5,
@Nullable ItemStack var6,
boolean var7,
boolean var8,
boolean var9,
boolean var10,
@Nullable ItemStack var11,
@Nullable ItemStack var12
) {
super(var1, var2, var3, var4, var5, var6, var7, var8, var9);
this.addToExistingSlot = var10;
this.query = var11;
this.remainder = var12;
}
class="kw">public boolean isAddToExistingSlot() {
class="kw">return this.addToExistingSlot;
}
@Nullable
class="kw">public ItemStack getQuery() {
class="kw">return this.query;
}
@Nullable
class="kw">public ItemStack getRemainder() {
class="kw">return this.remainder;
}
@Nonnull
class="kw">public ItemStackSlotTransaction toParent(ItemContainer var1, short var2, ItemContainer var3) {
short var4 = (short)(var2 + this.getSlot());
class="kw">return new ItemStackSlotTransaction(
this.succeeded(),
this.getAction(),
var4,
this.getSlotBefore(),
this.getSlotAfter(),
this.getOutput(),
this.isAllOrNothing(),
this.isExactAmount(),
this.isFilter(),
this.addToExistingSlot,
this.query,
this.remainder
);
}
@Nullable
class="kw">public ItemStackSlotTransaction fromParent(ItemContainer var1, short var2, @Nonnull ItemContainer var3) {
short var4 = (short)(this.getSlot() - var2);
class="kw">return var4 >= 0 && var4 < var3.getCapacity()
? new ItemStackSlotTransaction(
this.succeeded(),
this.getAction(),
var4,
this.getSlotBefore(),
this.getSlotAfter(),
this.getOutput(),
this.isAllOrNothing(),
this.isExactAmount(),
this.isFilter(),
this.addToExistingSlot,
this.query,
this.remainder
)
: null;
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "ItemStackSlotTransaction{addToExistingSlot="
+ this.addToExistingSlot
+ ", query="
+ this.query
+ ", remainder="
+ this.remainder
+ "} "
+ super.toString();
}
}