Updated Via API usage

This commit is contained in:
RaphiMC 2024-05-27 13:34:32 +02:00
parent f398394a2e
commit d7d33926ec
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94
3 changed files with 3 additions and 5 deletions

View File

@ -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) {

View File

@ -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() {

View File

@ -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;
}