mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-01 14:38:55 +00:00
Update SiegeEngine.java
Fixed NPE
This commit is contained in:
1 parent
f2518d0367
commit
3c0d641ffe
1 file changed
+2
-2
@@ -70,7 +70,7 @@ public class SiegeEngine implements Cloneable {
|
||||
// Passed parameters
|
||||
public String name = "Unnammed Siege Engine";
|
||||
public ItemStack fuelItem = new ItemStack(Material.GUNPOWDER);
|
||||
public HashMap<ItemStack, SiegeEngineProjectile> projectiles;
|
||||
public HashMap<ItemStack, SiegeEngineProjectile> projectiles = new HashMap<>();
|
||||
|
||||
public int customModelID = 150;
|
||||
|
||||
@@ -129,7 +129,7 @@ public class SiegeEngine implements Cloneable {
|
||||
this.customModelID = customModelID;
|
||||
|
||||
// set projectiles
|
||||
if (projectiles.keySet().isEmpty() || projectiles.isEmpty()) {
|
||||
if (this.projectiles == null || projectiles.keySet().isEmpty() || projectiles.isEmpty()) {
|
||||
this.projectiles.put(new ItemStack(Material.GUNPOWDER), defaultProj);
|
||||
} else {
|
||||
this.projectiles = projectiles;
|
||||
|
||||
Reference in new issue
Block a user