Skip to content

Commit

Permalink
Merge pull request #55 from TheBusyBiscuit/fix/metas
Browse files Browse the repository at this point in the history
Fixed constructors for ItemMetas
  • Loading branch information
seeseemelk committed May 3, 2020
2 parents 2c887e0 + 17ba657 commit a75d337
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ public class BookMetaMock extends ItemMetaMock implements BookMeta {
private String title;
private List<String> pages = new ArrayList<>();
private String author;

public BookMetaMock() {
super();
}

public BookMetaMock(BookMeta meta) {
super(meta);

this.title = meta.getTitle();
this.author = meta.getAuthor();
this.pages = new ArrayList<>(meta.getPages());
}

@Override
public int hashCode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ public class EnchantedBookMetaMock extends ItemMetaMock implements EnchantmentSt

private Map<Enchantment, Integer> storedEnchantments = new HashMap<>();

public EnchantedBookMetaMock() {
super();
}

public EnchantedBookMetaMock(EnchantmentStorageMeta meta) {
super(meta);

this.storedEnchantments = new HashMap<>(meta.getStoredEnchants());
}

@Override
public int hashCode() {
final int prime = 31;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
**/
public class SkullMetaMock extends ItemMetaMock implements SkullMeta {
private String owner;

public SkullMetaMock() {
super();
}

public SkullMetaMock(SkullMeta meta) {
super(meta);

this.owner = meta.getOwningPlayer().getName();
}

@Override
public String getOwner() {
Expand Down

0 comments on commit a75d337

Please sign in to comment.