All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.level.terra.delegate.PNXItemDelegate Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.level.terra.delegate;

import cn.nukkit.api.PowerNukkitXOnly;
import cn.nukkit.api.Since;
import com.dfsek.terra.api.inventory.Item;
import com.dfsek.terra.api.inventory.ItemStack;

@PowerNukkitXOnly
@Since("1.6.0.0-PNX")
public record PNXItemDelegate(cn.nukkit.item.Item innerItem) implements Item {
    @Override
    public ItemStack newItemStack(int i) {
        final var tmp = innerItem.clone();
        tmp.setCount(i);
        return new PNXItemStack(tmp);
    }

    @Override
    public double getMaxDurability() {
        return innerItem.getMaxDurability();
    }

    @Override
    public cn.nukkit.item.Item getHandle() {
        return innerItem;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy