mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-04 06:28: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
|
// Passed parameters
|
||||||
public String name = "Unnammed Siege Engine";
|
public String name = "Unnammed Siege Engine";
|
||||||
public ItemStack fuelItem = new ItemStack(Material.GUNPOWDER);
|
public ItemStack fuelItem = new ItemStack(Material.GUNPOWDER);
|
||||||
public HashMap<ItemStack, SiegeEngineProjectile> projectiles;
|
public HashMap<ItemStack, SiegeEngineProjectile> projectiles = new HashMap<>();
|
||||||
|
|
||||||
public int customModelID = 150;
|
public int customModelID = 150;
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ public class SiegeEngine implements Cloneable {
|
|||||||
this.customModelID = customModelID;
|
this.customModelID = customModelID;
|
||||||
|
|
||||||
// set projectiles
|
// 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);
|
this.projectiles.put(new ItemStack(Material.GUNPOWDER), defaultProj);
|
||||||
} else {
|
} else {
|
||||||
this.projectiles = projectiles;
|
this.projectiles = projectiles;
|
||||||
|
|||||||
Reference in new issue
Block a user