-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/main/java/com/laytonsmith/abstraction/MCAnvilInventory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.laytonsmith.abstraction; | ||
|
||
public interface MCAnvilInventory extends MCInventory { | ||
MCItemStack getFirstItem(); | ||
MCItemStack getSecondItem(); | ||
MCItemStack getResult(); | ||
int getMaximumRepairCost(); | ||
int getRepairCost(); | ||
int getRepairCostAmount(); | ||
String getRenameText(); | ||
|
||
void setFirstItem(MCItemStack stack); | ||
void setSecondItem(MCItemStack stack); | ||
void setResult(MCItemStack stack); | ||
void setMaximumRepairCost(int levels); | ||
void setRepairCost(int levels); | ||
void setRepairCostAmount(int levels); | ||
} |
80 changes: 80 additions & 0 deletions
80
src/main/java/com/laytonsmith/abstraction/bukkit/BukkitMCAnvilInventory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package com.laytonsmith.abstraction.bukkit; | ||
|
||
import com.laytonsmith.abstraction.MCAnvilInventory; | ||
import com.laytonsmith.abstraction.MCItemStack; | ||
import org.bukkit.inventory.AnvilInventory; | ||
|
||
public class BukkitMCAnvilInventory extends BukkitMCInventory implements MCAnvilInventory { | ||
|
||
AnvilInventory ai; | ||
|
||
public BukkitMCAnvilInventory(AnvilInventory inventory) { | ||
super(inventory); | ||
ai = inventory; | ||
} | ||
|
||
@Override | ||
public MCItemStack getFirstItem() { | ||
return new BukkitMCItemStack(ai.getItem(0)); | ||
} | ||
|
||
@Override | ||
public MCItemStack getSecondItem() { | ||
return new BukkitMCItemStack(ai.getItem(1)); | ||
} | ||
|
||
@Override | ||
public MCItemStack getResult() { | ||
return new BukkitMCItemStack(ai.getItem(2)); | ||
} | ||
|
||
@Override | ||
public int getMaximumRepairCost() { | ||
return ai.getMaximumRepairCost(); | ||
} | ||
|
||
@Override | ||
public int getRepairCost() { | ||
return ai.getRepairCost(); | ||
} | ||
|
||
@Override | ||
public int getRepairCostAmount() { | ||
return ai.getRepairCostAmount(); | ||
} | ||
|
||
@Override | ||
public String getRenameText() { | ||
return ai.getRenameText(); | ||
} | ||
|
||
@Override | ||
public void setFirstItem(MCItemStack stack) { | ||
ai.setItem(0, ((BukkitMCItemStack) stack).asItemStack()); | ||
} | ||
|
||
@Override | ||
public void setSecondItem(MCItemStack stack) { | ||
ai.setItem(1, ((BukkitMCItemStack) stack).asItemStack()); | ||
} | ||
|
||
@Override | ||
public void setResult(MCItemStack stack) { | ||
ai.setItem(2, ((BukkitMCItemStack) stack).asItemStack()); | ||
} | ||
|
||
@Override | ||
public void setMaximumRepairCost(int levels) { | ||
ai.setMaximumRepairCost(levels); | ||
} | ||
|
||
@Override | ||
public void setRepairCost(int levels) { | ||
ai.setRepairCost(levels); | ||
} | ||
|
||
@Override | ||
public void setRepairCostAmount(int levels) { | ||
ai.setRepairCostAmount(levels); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/com/laytonsmith/abstraction/events/MCPrepareAnvilEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.laytonsmith.abstraction.events; | ||
|
||
import com.laytonsmith.abstraction.MCPlayer; | ||
import com.laytonsmith.abstraction.MCItemStack; | ||
|
||
public interface MCPrepareAnvilEvent extends MCInventoryEvent { | ||
MCPlayer getPlayer(); | ||
|
||
void setResult(MCItemStack i); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters