Permalink
Browse files

Add "unbreakable" to item meta and "owneruuid" to skull item meta

  • Loading branch information...
PseudoKnight committed Dec 15, 2017
1 parent 4fc76c4 commit 7858186f010aaffdc40e7de36c8545815c6101b8
@@ -105,4 +105,8 @@
int getRepairCost();
void setRepairCost(int cost);
boolean isUnbreakable();
void setUnbreakable(boolean unbreakable);
}
@@ -4,29 +4,23 @@
import com.laytonsmith.abstraction.blocks.MCMaterial;
import java.util.Map;
/**
*
*
*/
public interface MCItemStack extends AbstractionObject{
public MCMaterialData getData();
public short getDurability();
public int getTypeId();
public void setDurability(short data);
public void addEnchantment(MCEnchantment e, int level);
public void addUnsafeEnchantment(MCEnchantment e, int level);
public Map<MCEnchantment, Integer> getEnchantments();
public void removeEnchantment(MCEnchantment e);
public MCMaterial getType();
public void setTypeId(int type);
public int maxStackSize();
public int getAmount();
public void setData(int data);
public boolean hasItemMeta();
public MCItemMeta getItemMeta();
public void setItemMeta(MCItemMeta im);
MCMaterialData getData();
short getDurability();
@Deprecated
int getTypeId();
void setDurability(short data);
void addEnchantment(MCEnchantment e, int level);
void addUnsafeEnchantment(MCEnchantment e, int level);
Map<MCEnchantment, Integer> getEnchantments();
void removeEnchantment(MCEnchantment e);
MCMaterial getType();
@Deprecated
void setTypeId(int type);
int maxStackSize();
int getAmount();
void setData(int data);
boolean hasItemMeta();
MCItemMeta getItemMeta();
void setItemMeta(MCItemMeta im);
}
@@ -1,13 +1,9 @@
package com.laytonsmith.abstraction;
/**
*
* @author jb_aero
*/
public interface MCSkullMeta extends MCItemMeta {
public boolean hasOwner();
public String getOwner();
public boolean setOwner(String owner);
boolean hasOwner();
String getOwner();
MCOfflinePlayer getOwningPlayer();
boolean setOwner(String owner);
void setOwningPlayer(MCOfflinePlayer player);
}
@@ -15,14 +15,17 @@
*/
public interface MCBlock extends MCMetadatable {
@Deprecated
public int getTypeId();
public byte getData();
@Deprecated
public void setTypeId(int idata);
public void setData(byte imeta);
@Deprecated
public void setTypeAndData(int type, byte data, boolean physics);
public double getTemperature();
@@ -6,7 +6,10 @@
public interface MCBlockState extends MCMetadatable {
MCMaterialData getData();
MCMaterial getType();
@Deprecated
int getTypeId();
@Deprecated
void setTypeId(int type);
void setRawData(byte data);
MCBlock getBlock();
@@ -5,26 +5,20 @@
import com.laytonsmith.abstraction.AbstractionObject;
import com.laytonsmith.abstraction.MCMaterialData;
/**
*
*
*/
public interface MCMaterial extends AbstractionObject {
short getMaxDurability();
public int getType();
public MCMaterialData getData();
public String getName();
public int getMaxStackSize();
public boolean hasGravity();
public boolean isBlock();
public boolean isBurnable();
public boolean isEdible();
public boolean isFlammable();
public boolean isOccluding();
public boolean isRecord();
public boolean isSolid();
public boolean isTransparent();
short getMaxDurability();
@Deprecated
int getType();
MCMaterialData getData();
String getName();
int getMaxStackSize();
boolean hasGravity();
boolean isBlock();
boolean isBurnable();
boolean isEdible();
boolean isFlammable();
boolean isOccluding();
boolean isRecord();
boolean isSolid();
boolean isTransparent();
}
@@ -143,4 +143,14 @@ public void addItemFlags(MCItemFlag... flags) {
}
return ret;
}
@Override
public boolean isUnbreakable() {
return im.isUnbreakable();
}
@Override
public void setUnbreakable(boolean unbreakable) {
im.setUnbreakable(unbreakable);
}
}
@@ -1,7 +1,9 @@
package com.laytonsmith.abstraction.bukkit;
import com.laytonsmith.abstraction.AbstractionObject;
import com.laytonsmith.abstraction.MCOfflinePlayer;
import com.laytonsmith.abstraction.MCSkullMeta;
import org.bukkit.OfflinePlayer;
import org.bukkit.inventory.meta.SkullMeta;
public class BukkitMCSkullMeta extends BukkitMCItemMeta implements MCSkullMeta {
@@ -27,9 +29,23 @@ public String getOwner() {
return sm.getOwner();
}
@Override
public MCOfflinePlayer getOwningPlayer(){
return new BukkitMCOfflinePlayer(sm.getOwningPlayer());
}
@Override
public boolean setOwner(String owner) {
return sm.setOwner(owner);
}
@Override
public void setOwningPlayer(MCOfflinePlayer player){
try {
sm.setOwningPlayer((OfflinePlayer) player.getHandle());
} catch(NoSuchMethodError ex) {
// probably prior to 1.12.2
sm.setOwner(player.getName());
}
}
}
@@ -4,6 +4,7 @@
import com.laytonsmith.abstraction.MCMaterialData;
import com.laytonsmith.abstraction.blocks.MCBlock;
import com.laytonsmith.abstraction.blocks.MCBlockState;
import com.laytonsmith.abstraction.blocks.MCMaterial;
import com.laytonsmith.abstraction.bukkit.BukkitMCLocation;
import com.laytonsmith.abstraction.bukkit.BukkitMCMaterialData;
import com.laytonsmith.abstraction.bukkit.BukkitMCMetadatable;
@@ -28,6 +29,11 @@ public MCMaterialData getData() {
return new BukkitMCMaterialData(bs.getData());
}
@Override
public MCMaterial getType() {
return new BukkitMCMaterial(bs.getType());
}
@Override
public void setTypeId(int type) {
bs.setTypeId(type);
@@ -3,6 +3,7 @@
package com.laytonsmith.abstraction.bukkit.blocks;
import com.laytonsmith.abstraction.MCMaterialData;
import com.laytonsmith.abstraction.blocks.MCMaterial;
import com.laytonsmith.abstraction.blocks.MCSign;
import com.laytonsmith.abstraction.bukkit.BukkitMCMaterialData;
import org.bukkit.block.Sign;
@@ -41,6 +42,11 @@ public MCMaterialData getData() {
return new BukkitMCMaterialData(s.getData());
}
@Override
public MCMaterial getType() {
return new BukkitMCMaterial(s.getType());
}
@Override
public int getTypeId() {
return s.getTypeId();
Oops, something went wrong.

0 comments on commit 7858186

Please sign in to comment.