EntityMetadata utilities
This commit is contained in:
parent
0da1d44f97
commit
4c0ca7008c
2 changed files with 60 additions and 43 deletions
|
@ -5,7 +5,7 @@
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="9d5d9b6f-43c8-41a4-bb42-a66ffc96c9b0" name="Changes" comment="">
|
<list default="true" id="9d5d9b6f-43c8-41a4-bb42-a66ffc96c9b0" name="Changes" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/test-plugin/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/test-plugin/build.gradle" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
@ -106,51 +106,51 @@
|
||||||
<option name="showExcludedFiles" value="false" />
|
<option name="showExcludedFiles" value="false" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
<component name="PropertiesComponent">{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"Downloaded.Files.Path.Enabled": "false",
|
"Downloaded.Files.Path.Enabled": "false",
|
||||||
"Gradle.Build EntityLib.executor": "Run",
|
"Gradle.Build EntityLib.executor": "Run",
|
||||||
"Gradle.EntityLib [dependencies].executor": "Run",
|
"Gradle.EntityLib [dependencies].executor": "Run",
|
||||||
"Gradle.EntityLib [publish].executor": "Run",
|
"Gradle.EntityLib [publish].executor": "Run",
|
||||||
"Gradle.EntityLib [runServer] (1).executor": "Run",
|
"Gradle.EntityLib [runServer] (1).executor": "Run",
|
||||||
"Gradle.EntityLib [runServer].executor": "Run",
|
"Gradle.EntityLib [runServer].executor": "Run",
|
||||||
"Gradle.EntityLib:code-gen [:code-gen:Main.main()].executor": "Run",
|
"Gradle.EntityLib:code-gen [:code-gen:Main.main()].executor": "Run",
|
||||||
"Gradle.EntityLib:test-plugin [cleanAllRunTaskCaches].executor": "Run",
|
"Gradle.EntityLib:test-plugin [cleanAllRunTaskCaches].executor": "Run",
|
||||||
"Gradle.EntityLib:test-plugin [cleanCustomServiceCaches].executor": "Run",
|
"Gradle.EntityLib:test-plugin [cleanCustomServiceCaches].executor": "Run",
|
||||||
"Gradle.EntityLib:test-plugin [cleanPaperCache].executor": "Run",
|
"Gradle.EntityLib:test-plugin [cleanPaperCache].executor": "Run",
|
||||||
"Gradle.EntityLib:test-plugin [cleanPaperPluginsCache].executor": "Run",
|
"Gradle.EntityLib:test-plugin [cleanPaperPluginsCache].executor": "Run",
|
||||||
"Gradle.EntityLib:test-plugin [publish].executor": "Run",
|
"Gradle.EntityLib:test-plugin [publish].executor": "Run",
|
||||||
"Gradle.EntityLib:test-plugin [runServer].executor": "Run",
|
"Gradle.EntityLib:test-plugin [runServer].executor": "Run",
|
||||||
"Gradle.EntityLib:test-plugin [shadowJar].executor": "Run",
|
"Gradle.EntityLib:test-plugin [shadowJar].executor": "Run",
|
||||||
"JAR Application.Unnamed.executor": "Run",
|
"JAR Application.Unnamed.executor": "Run",
|
||||||
"Repository.Attach.Annotations": "false",
|
"Repository.Attach.Annotations": "false",
|
||||||
"Repository.Attach.JavaDocs": "false",
|
"Repository.Attach.JavaDocs": "false",
|
||||||
"Repository.Attach.Sources": "false",
|
"Repository.Attach.Sources": "false",
|
||||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"WebServerToolWindowFactoryState": "false",
|
"WebServerToolWindowFactoryState": "false",
|
||||||
"git-widget-placeholder": "master",
|
"git-widget-placeholder": "master",
|
||||||
"ignore.virus.scanning.warn.message": "true",
|
"ignore.virus.scanning.warn.message": "true",
|
||||||
"jdk.selected.JAVA_MODULE": "corretto-17",
|
"jdk.selected.JAVA_MODULE": "corretto-17",
|
||||||
"kotlin-language-version-configured": "true",
|
"kotlin-language-version-configured": "true",
|
||||||
"last_opened_file_path": "/home/tofaa/Github/EntityLib/model-engine-addon",
|
"last_opened_file_path": "/home/tofaa/Github/EntityLib/model-engine-addon",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
"node.js.selected.package.tslint": "(autodetect)",
|
"node.js.selected.package.tslint": "(autodetect)",
|
||||||
"nodejs_package_manager_path": "npm",
|
"nodejs_package_manager_path": "npm",
|
||||||
"project.structure.last.edited": "Modules",
|
"project.structure.last.edited": "Modules",
|
||||||
"project.structure.proportion": "0.15",
|
"project.structure.proportion": "0.15",
|
||||||
"project.structure.side.proportion": "0.2",
|
"project.structure.side.proportion": "0.2",
|
||||||
"settings.editor.selected.configurable": "preferences.editor",
|
"settings.editor.selected.configurable": "preferences.editor",
|
||||||
"vue.rearranger.settings.migration": "true"
|
"vue.rearranger.settings.migration": "true"
|
||||||
},
|
},
|
||||||
"keyToStringList": {
|
"keyToStringList": {
|
||||||
"kotlin-gradle-user-dirs": [
|
"kotlin-gradle-user-dirs": [
|
||||||
"/home/tofaa/.gradle"
|
"/home/tofaa/.gradle"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
<recent name="$PROJECT_DIR$/model-engine-addon" />
|
<recent name="$PROJECT_DIR$/model-engine-addon" />
|
||||||
|
@ -406,6 +406,8 @@
|
||||||
<workItem from="1716206341414" duration="1609000" />
|
<workItem from="1716206341414" duration="1609000" />
|
||||||
<workItem from="1716212065238" duration="80000" />
|
<workItem from="1716212065238" duration="80000" />
|
||||||
<workItem from="1716488324710" duration="3710000" />
|
<workItem from="1716488324710" duration="3710000" />
|
||||||
|
<workItem from="1716722129881" duration="965000" />
|
||||||
|
<workItem from="1716926795264" duration="1000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -17,6 +17,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class WrapperEntity implements Tickable, TrackedEntity {
|
public class WrapperEntity implements Tickable, TrackedEntity {
|
||||||
|
|
||||||
|
@ -280,6 +281,20 @@ public class WrapperEntity implements Tickable, TrackedEntity {
|
||||||
return entityMeta;
|
return entityMeta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public <T extends EntityMeta> T getEntityMeta(@NotNull Class<T> metaClass) {
|
||||||
|
return metaClass.cast(entityMeta);
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T extends EntityMeta> void consumeEntityMeta(@NotNull Class<T> metaClass, Consumer<T> consumer) {
|
||||||
|
T meta = getEntityMeta(metaClass);
|
||||||
|
consumer.accept(meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void consumeMeta(Consumer<EntityMeta> consumer) {
|
||||||
|
consumer.accept(entityMeta);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public @NotNull UUID getUuid() {
|
public @NotNull UUID getUuid() {
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue