mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +01:00
parent
523eecefc6
commit
41b07c2f36
2
pom.xml
2
pom.xml
@ -18,7 +18,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.16.1-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Boss -->
|
||||
|
59
src/main/java/com/gamingmesh/jobs/nmsUtil/v1_16.java
Normal file
59
src/main/java/com/gamingmesh/jobs/nmsUtil/v1_16.java
Normal file
@ -0,0 +1,59 @@
|
||||
package com.gamingmesh.jobs.nmsUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.Damageable;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import com.gamingmesh.jobs.NMS;
|
||||
|
||||
public class v1_16 implements NMS {
|
||||
|
||||
@Override
|
||||
public List<Block> getPistonRetractBlocks(BlockPistonRetractEvent event) {
|
||||
List<Block> blocks = new ArrayList<>();
|
||||
blocks.addAll(event.getBlocks());
|
||||
return blocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRealType(Entity entity) {
|
||||
return entity.getType().name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemInMainHand(Player player) {
|
||||
return player.getInventory().getItemInMainHand();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemInMainHand(Player player, ItemStack item) {
|
||||
player.getInventory().setItemInMainHand(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxHealth(LivingEntity entity) {
|
||||
return entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getDurability(ItemStack item) {
|
||||
return (short) ((Damageable) item.getItemMeta()).getDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSkullOwner(SkullMeta meta, OfflinePlayer player) {
|
||||
if (meta != null && player != null) {
|
||||
meta.setOwningPlayer(player);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user