mirror of
https://github.com/darksaid98/AlathranWars.git
synced 2026-12-04 14:38:57 +00:00
missing refactors
This commit is contained in:
1 parent
89fc6d1769
commit
60b425b056
3 files changed
+4
-5
No files matched your search
@@ -48,7 +48,6 @@ public class WarItemRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, ItemStack> getItemRegistry() {
|
public Map<String, ItemStack> getItemRegistry() {
|
||||||
|
|
||||||
return itemRegistry.entrySet()
|
return itemRegistry.entrySet()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(v -> v.getValue() != null)
|
.filter(v -> v.getValue() != null)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class RamItem implements IWarItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<Recipe> getRecipes() {
|
public Set<Recipe> getRecipes() {
|
||||||
ItemStack output = Main.itemRegistry.getOrNull("ram");
|
ItemStack output = WarItemRegistry.getInstance().getOrNull("ram");
|
||||||
NamespacedKey key = new NamespacedKey(Main.getInstance(), "ram");
|
NamespacedKey key = new NamespacedKey(Main.getInstance(), "ram");
|
||||||
ShapedRecipe recipe = new ShapedRecipe(key, output);
|
ShapedRecipe recipe = new ShapedRecipe(key, output);
|
||||||
recipe.shape("$@$", "B##");
|
recipe.shape("$@$", "B##");
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class PlayerInteractListener implements Listener {
|
|||||||
if (clicked.getType().toString().contains("DOOR")) { // left click + any door types
|
if (clicked.getType().toString().contains("DOOR")) { // left click + any door types
|
||||||
Door door = (Door) clicked.getBlockData();
|
Door door = (Door) clicked.getBlockData();
|
||||||
// lock door in the opposite position
|
// lock door in the opposite position
|
||||||
if (item.equals(Main.itemRegistry.getOrNull("ram"))) {
|
if (item.equals(WarItemRegistry.getInstance().getOrNull("ram"))) {
|
||||||
boolean inSiegeOrRaid = false;
|
boolean inSiegeOrRaid = false;
|
||||||
//siege check
|
//siege check
|
||||||
for (Siege s : SiegeData.getSieges()) {
|
for (Siege s : SiegeData.getSieges()) {
|
||||||
@@ -101,7 +101,7 @@ public class PlayerInteractListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onPlayerRClick(final PlayerItemDamageEvent event) {
|
public void onPlayerRClick(final PlayerItemDamageEvent event) {
|
||||||
ItemStack item = event.getItem();
|
ItemStack item = event.getItem();
|
||||||
if (item.equals(WarItemRegistry.getOrNull("ram"))) {
|
if (item.equals(WarItemRegistry.getInstance().getOrNull("ram"))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ public class PlayerInteractListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.equals(WarItemRegistry.getOrNull("ram"))) {
|
if (item.equals(WarItemRegistry.getInstance().getOrNull("ram"))) {
|
||||||
if (clicked != null) {
|
if (clicked != null) {
|
||||||
if (clicked.getType().name().equals("GRASS_BLOCK")
|
if (clicked.getType().name().equals("GRASS_BLOCK")
|
||||||
|| clicked.getType().name().equals("DIRT")
|
|| clicked.getType().name().equals("DIRT")
|
||||||
|
|||||||
Reference in new issue
Block a user