minor adjustments
This commit is contained in:
parent
20b5b724c5
commit
d1f9d1a919
@ -25,10 +25,10 @@ public final class WrappedVillager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return True if the villager is optimized by the plugin, otherwise false.
|
* @return True if the villager is optimized by this or another plugin, otherwise false.
|
||||||
*/
|
*/
|
||||||
public boolean isOptimized() {
|
public boolean isOptimized() {
|
||||||
return dataContainer.has(Keys.OPTIMIZATION_TYPE.key());
|
return dataContainer.has(Keys.OPTIMIZATION_TYPE.key()) || !villager.isAware() || !villager.hasAI();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,7 +28,6 @@ public class Config {
|
|||||||
"If set to true, will display messages based on client language");
|
"If set to true, will display messages based on client language");
|
||||||
this.cache_keep_time_seconds = getInt("general.cache-keep-time-seconds", 30,
|
this.cache_keep_time_seconds = getInt("general.cache-keep-time-seconds", 30,
|
||||||
"The amount of time in seconds a villager will be kept in the plugin's cache.");
|
"The amount of time in seconds a villager will be kept in the plugin's cache.");
|
||||||
this.addComment("", "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ConfigFile loadConfig(File ymlFile) throws Exception {
|
private ConfigFile loadConfig(File ymlFile) throws Exception {
|
||||||
@ -51,14 +50,14 @@ public class Config {
|
|||||||
private void structureConfig() {
|
private void structureConfig() {
|
||||||
config.addDefault("config-version", 1.00);
|
config.addDefault("config-version", 1.00);
|
||||||
createTitledSection("General", "general");
|
createTitledSection("General", "general");
|
||||||
createTitledSection("Optimization Methods", "optimization-methods");
|
createTitledSection("Optimization", "optimization-methods");
|
||||||
addComment("optimization-methods", """
|
|
||||||
BE AWARE:\s
|
|
||||||
It is recommended to choose preferably one (no more than 2) of the below methods, as this can\s
|
|
||||||
get confusing and depending on your config exploitable otherwise.
|
|
||||||
""");
|
|
||||||
config.addDefault("optimization-methods.commands.unoptimizevillagers", null);
|
config.addDefault("optimization-methods.commands.unoptimizevillagers", null);
|
||||||
config.addDefault("optimization-methods.nametag-optimization.enable", true);
|
config.addDefault("optimization-methods.nametag-optimization.enable", true);
|
||||||
|
addComment("optimization-methods", """
|
||||||
|
BE AWARE:\s
|
||||||
|
It is recommended to choose preferably ONE, no more than TWO of the below methods, as it can\s
|
||||||
|
become confusing and - depending on your config - exploitable otherwise.
|
||||||
|
""");
|
||||||
createTitledSection("Villager Chunk Limit", "villager-chunk-limit");
|
createTitledSection("Villager Chunk Limit", "villager-chunk-limit");
|
||||||
createTitledSection("Gameplay", "gameplay");
|
createTitledSection("Gameplay", "gameplay");
|
||||||
config.addDefault("gameplay.villagers-spawn-as-adults.enable", false);
|
config.addDefault("gameplay.villagers-spawn-as-adults.enable", false);
|
||||||
|
@ -27,16 +27,16 @@ public class PreventVillagerDamage implements VillagerOptimizerModule, Listener
|
|||||||
Config config = VillagerOptimizer.getConfiguration();
|
Config config = VillagerOptimizer.getConfiguration();
|
||||||
config.addComment("gameplay.prevent-damage.enable",
|
config.addComment("gameplay.prevent-damage.enable",
|
||||||
"Configure what kind of damage you want to cancel for optimized villagers here.");
|
"Configure what kind of damage you want to cancel for optimized villagers here.");
|
||||||
this.block = config.getBoolean("gameplay.prevent-damage.block", false,
|
|
||||||
"Prevents damage from blocks like lava, tnt, respawn anchors, etc.");
|
|
||||||
this.player = config.getBoolean("gameplay.prevent-damage.player", false,
|
|
||||||
"Prevents damage from getting hit by players.");
|
|
||||||
this.mob = config.getBoolean("gameplay.prevent-damage.mob", true,
|
|
||||||
"Prevents damage from hostile mobs.");
|
|
||||||
this.other = config.getBoolean("gameplay.prevent-damage.other", true,
|
|
||||||
"Prevents damage from all other entities.");
|
|
||||||
this.push = config.getBoolean("gameplay.prevent-damage.prevent-push-from-attack", true,
|
this.push = config.getBoolean("gameplay.prevent-damage.prevent-push-from-attack", true,
|
||||||
"Prevents optimized villagers from getting pushed by an attacking entity");
|
"Prevents optimized villagers from getting pushed by an attacking entity");
|
||||||
|
this.block = config.getBoolean("gameplay.prevent-damage.damagers.block", false,
|
||||||
|
"Prevents damage from blocks like lava, tnt, respawn anchors, etc.");
|
||||||
|
this.player = config.getBoolean("gameplay.prevent-damage.damagers.player", false,
|
||||||
|
"Prevents damage from getting hit by players.");
|
||||||
|
this.mob = config.getBoolean("gameplay.prevent-damage.damagers.mob", true,
|
||||||
|
"Prevents damage from hostile mobs.");
|
||||||
|
this.other = config.getBoolean("gameplay.prevent-damage.damagers.other", true,
|
||||||
|
"Prevents damage from all other entities.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user