feature/d01-component-system #5
@@ -28,6 +28,8 @@ public class GaggingComponent implements IItemComponent {
|
|||||||
range = config.get("range").getAsDouble();
|
range = config.get("range").getAsDouble();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
comprehension = Math.max(0.0, Math.min(1.0, comprehension));
|
||||||
|
range = Math.max(0.0, range);
|
||||||
return new GaggingComponent(comprehension, range);
|
return new GaggingComponent(comprehension, range);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public class LockableComponent implements IItemComponent {
|
|||||||
if (config != null && config.has("lock_resistance")) {
|
if (config != null && config.has("lock_resistance")) {
|
||||||
resistance = config.get("lock_resistance").getAsInt();
|
resistance = config.get("lock_resistance").getAsInt();
|
||||||
}
|
}
|
||||||
|
resistance = Math.max(0, resistance);
|
||||||
return new LockableComponent(resistance);
|
return new LockableComponent(resistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class ResistanceComponent implements IItemComponent {
|
|||||||
if (config != null && config.has("base")) {
|
if (config != null && config.has("base")) {
|
||||||
base = config.get("base").getAsInt();
|
base = config.get("base").getAsInt();
|
||||||
}
|
}
|
||||||
|
base = Math.max(0, base);
|
||||||
return new ResistanceComponent(base);
|
return new ResistanceComponent(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user