[ci skip] Add some helper methods to the ObfHelper util class (#6374)
This commit is contained in:
@@ -130,17 +130,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.maxDuration = maxRunTime;
|
||||
this.entryCondition = requiredMemoryState;
|
||||
+ // Paper start - configurable behavior tick rate and timings
|
||||
+ String key = this.getClass().getSimpleName();
|
||||
+ final var mappings = io.papermc.paper.util.ObfHelper.INSTANCE.mappings();
|
||||
+ if (mappings != null) {
|
||||
+ final var classMapping = mappings.get(this.getClass().getName());
|
||||
+ if (classMapping != null) {
|
||||
+ key = classMapping.mojangName();
|
||||
+ int lastSeparator = key.lastIndexOf('.');
|
||||
+ if (lastSeparator != -1) {
|
||||
+ key = key.substring(lastSeparator + 1);
|
||||
+ }
|
||||
+ }
|
||||
+ String key = io.papermc.paper.util.ObfHelper.INSTANCE.deobfClassName(this.getClass().getName());
|
||||
+ int lastSeparator = key.lastIndexOf('.');
|
||||
+ if (lastSeparator != -1) {
|
||||
+ key = key.substring(lastSeparator + 1);
|
||||
+ }
|
||||
+ this.configKey = key.toLowerCase(java.util.Locale.ROOT);
|
||||
+ this.timing = co.aikar.timings.MinecraftTimings.getBehaviorTimings(configKey);
|
||||
@@ -197,17 +190,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
public Sensor(int senseInterval) {
|
||||
+ // Paper start - configurable sensor tick rate and timings
|
||||
+ String key = this.getClass().getSimpleName();
|
||||
+ final var mappings = io.papermc.paper.util.ObfHelper.INSTANCE.mappings();
|
||||
+ if (mappings != null) {
|
||||
+ final var classMapping = mappings.get(this.getClass().getName());
|
||||
+ if (classMapping != null) {
|
||||
+ key = classMapping.mojangName();
|
||||
+ int lastSeparator = key.lastIndexOf('.');
|
||||
+ if (lastSeparator != -1) {
|
||||
+ key = key.substring(lastSeparator + 1);
|
||||
+ }
|
||||
+ }
|
||||
+ String key = io.papermc.paper.util.ObfHelper.INSTANCE.deobfClassName(this.getClass().getName());
|
||||
+ int lastSeparator = key.lastIndexOf('.');
|
||||
+ if (lastSeparator != -1) {
|
||||
+ key = key.substring(lastSeparator + 1);
|
||||
+ }
|
||||
+ this.configKey = key.toLowerCase(java.util.Locale.ROOT);
|
||||
+ this.timing = co.aikar.timings.MinecraftTimings.getSensorTimings(configKey, senseInterval);
|
||||
|
||||
Reference in New Issue
Block a user