mirror of
https://github.com/ViaVersion/ViaLegacy.git
synced 2025-01-30 23:03:03 +01:00
Updated Via API usage
This commit is contained in:
parent
f398394a2e
commit
d7d33926ec
@ -454,7 +454,7 @@ public class Protocola1_2_3_5_1_2_6Tob1_0_1_1_1 extends StatelessProtocol<Client
|
||||
}
|
||||
|
||||
public static Item copyItem(final Item item) {
|
||||
return item == null ? null : new DataItem(item);
|
||||
return item == null ? null : item.copy();
|
||||
}
|
||||
|
||||
public static Item[] copyItems(final Item[] items) {
|
||||
|
@ -17,7 +17,6 @@
|
||||
*/
|
||||
package net.raphimc.vialegacy.protocol.alpha.a1_2_3_5_1_2_6tob1_0_1_1_1.model;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.item.DataItem;
|
||||
import com.viaversion.viaversion.api.minecraft.item.Item;
|
||||
|
||||
public class CraftingRecipe {
|
||||
@ -72,7 +71,7 @@ public class CraftingRecipe {
|
||||
}
|
||||
|
||||
public Item createResult() {
|
||||
return new DataItem(this.resultItem);
|
||||
return this.resultItem.copy();
|
||||
}
|
||||
|
||||
public int getRecipeSize() {
|
||||
|
@ -20,7 +20,6 @@ package net.raphimc.vialegacy.protocol.alpha.a1_2_3_5_1_2_6tob1_0_1_1_1.storage;
|
||||
import com.viaversion.viaversion.api.connection.StoredObject;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.BlockPosition;
|
||||
import com.viaversion.viaversion.api.minecraft.item.DataItem;
|
||||
import com.viaversion.viaversion.api.minecraft.item.Item;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.type.Types;
|
||||
@ -431,7 +430,7 @@ public class AlphaInventoryTracker extends StoredObject {
|
||||
|
||||
private Item splitStack(final Item item, final int size) {
|
||||
item.setAmount(item.amount() - size);
|
||||
final Item newItem = new DataItem(item);
|
||||
final Item newItem = item.copy();
|
||||
newItem.setAmount(size);
|
||||
return newItem;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user