mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Further BaseBlock modernisation
This commit is contained in:
@ -31,8 +31,10 @@ import com.sk89q.worldedit.internal.cui.CUIEvent;
|
||||
import com.sk89q.worldedit.session.SessionKey;
|
||||
import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.data.type.HandTypes;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.item.ItemType;
|
||||
import org.spongepowered.api.item.inventory.ItemStack;
|
||||
import org.spongepowered.api.text.Text;
|
||||
import org.spongepowered.api.text.format.TextColor;
|
||||
@ -91,8 +93,11 @@ public class SpongePlayer extends AbstractPlayerActor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void giveItem(int type, int amt) {
|
||||
this.player.getInventory().offer(ItemStack.of(SpongeWorldEdit.inst().getAdapter().resolveItem(type), amt));
|
||||
public void giveItem(BaseItemStack itemStack) {
|
||||
this.player.getInventory().offer(
|
||||
ItemStack.of(Sponge.getGame().getRegistry().getType(ItemType.class, itemStack.getType().getId()).get(),
|
||||
itemStack.getAmount())
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -202,11 +202,6 @@ public abstract class SpongeWorld extends AbstractWorld {
|
||||
return SpongeWorldData.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidBlockType(int id) {
|
||||
return id == 0 || SpongeWorldEdit.inst().getAdapter().resolveBlock(id) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getWorld().hashCode();
|
||||
@ -220,7 +215,7 @@ public abstract class SpongeWorld extends AbstractWorld {
|
||||
SpongeWorld other = ((SpongeWorld) o);
|
||||
World otherWorld = other.worldRef.get();
|
||||
World thisWorld = worldRef.get();
|
||||
return otherWorld != null && thisWorld != null && otherWorld.equals(thisWorld);
|
||||
return otherWorld != null && otherWorld.equals(thisWorld);
|
||||
} else {
|
||||
return o instanceof com.sk89q.worldedit.world.World
|
||||
&& ((com.sk89q.worldedit.world.World) o).getName().equals(getName());
|
||||
|
Reference in New Issue
Block a user