Disable default worker production
This commit is contained in:
@@ -200,6 +200,9 @@ public final class NpcService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!plugin.getConfig().getBoolean("npc.worker.allow_default_production", false)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
Material material = Material.matchMaterial(plugin.getConfig().getString("npc.worker.produce_material", "BREAD"));
|
Material material = Material.matchMaterial(plugin.getConfig().getString("npc.worker.produce_material", "BREAD"));
|
||||||
int amount = plugin.getConfig().getInt("npc.worker.produce_amount", 2);
|
int amount = plugin.getConfig().getInt("npc.worker.produce_amount", 2);
|
||||||
return material == null || amount <= 0 ? null : new WorkerRecipe("default", "PRODUCE", material, amount, Map.of(), List.of(), true);
|
return material == null || amount <= 0 ? null : new WorkerRecipe("default", "PRODUCE", material, amount, Map.of(), List.of(), true);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ npc:
|
|||||||
max_surcharge_percent: 20
|
max_surcharge_percent: 20
|
||||||
worker:
|
worker:
|
||||||
tick_interval_seconds: 20
|
tick_interval_seconds: 20
|
||||||
|
allow_default_production: false
|
||||||
produce_material: BREAD
|
produce_material: BREAD
|
||||||
produce_amount: 2
|
produce_amount: 2
|
||||||
roles:
|
roles:
|
||||||
|
|||||||
@@ -82,10 +82,12 @@ Admins can add starting goods or coal:
|
|||||||
===== Configuration =====
|
===== Configuration =====
|
||||||
|
|
||||||
Worker roles are matched by NPC name under ''npc.worker.roles''. For example, an NPC named ''Farmer Joe'' uses the ''farmer'' role.
|
Worker roles are matched by NPC name under ''npc.worker.roles''. For example, an NPC named ''Farmer Joe'' uses the ''farmer'' role.
|
||||||
|
Workers whose names do not match a configured role do nothing by default.
|
||||||
|
|
||||||
npc:
|
npc:
|
||||||
worker:
|
worker:
|
||||||
tick_interval_seconds: 20
|
tick_interval_seconds: 20
|
||||||
|
allow_default_production: false
|
||||||
roles:
|
roles:
|
||||||
farmer:
|
farmer:
|
||||||
behavior: FARM
|
behavior: FARM
|
||||||
|
|||||||
Reference in New Issue
Block a user