fix wolf collar color

This commit is contained in:
Tofaa 2024-03-16 21:14:32 +04:00
parent 256e043e29
commit 13e29016ab
2 changed files with 48 additions and 39 deletions

View file

@ -4,13 +4,7 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</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$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/meta/EntityMeta.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/meta/EntityMeta.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/platforms/spigot/src/main/java/me/tofaa/entitylib/spigot/InternalRegistryListener.java" beforeDir="false" afterPath="$PROJECT_DIR$/platforms/spigot/src/main/java/me/tofaa/entitylib/spigot/InternalRegistryListener.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/testentitylib/TestPlayerCommand.java" beforeDir="false" afterPath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/testentitylib/TestPlayerCommand.java" afterDir="false" />
</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" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -96,39 +90,39 @@
<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": { &quot;keyToString&quot;: {
"Downloaded.Files.Path.Enabled": "false", &quot;Downloaded.Files.Path.Enabled&quot;: &quot;false&quot;,
"Gradle.Build EntityLib.executor": "Run", &quot;Gradle.Build EntityLib.executor&quot;: &quot;Run&quot;,
"Gradle.EntityLib [dependencies].executor": "Run", &quot;Gradle.EntityLib [dependencies].executor&quot;: &quot;Run&quot;,
"Gradle.EntityLib [publish].executor": "Run", &quot;Gradle.EntityLib [publish].executor&quot;: &quot;Run&quot;,
"Gradle.EntityLib:code-gen [:code-gen:Main.main()].executor": "Run", &quot;Gradle.EntityLib:code-gen [:code-gen:Main.main()].executor&quot;: &quot;Run&quot;,
"Gradle.EntityLib:test-plugin [publish].executor": "Run", &quot;Gradle.EntityLib:test-plugin [publish].executor&quot;: &quot;Run&quot;,
"Gradle.EntityLib:test-plugin [runServer].executor": "Debug", &quot;Gradle.EntityLib:test-plugin [runServer].executor&quot;: &quot;Debug&quot;,
"Gradle.EntityLib:test-plugin [shadowJar].executor": "Run", &quot;Gradle.EntityLib:test-plugin [shadowJar].executor&quot;: &quot;Run&quot;,
"Repository.Attach.Annotations": "false", &quot;Repository.Attach.Annotations&quot;: &quot;false&quot;,
"Repository.Attach.JavaDocs": "false", &quot;Repository.Attach.JavaDocs&quot;: &quot;false&quot;,
"Repository.Attach.Sources": "false", &quot;Repository.Attach.Sources&quot;: &quot;false&quot;,
"RunOnceActivity.OpenProjectViewOnStart": "true", &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"WebServerToolWindowFactoryState": "false", &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
"git-widget-placeholder": "master", &quot;git-widget-placeholder&quot;: &quot;master&quot;,
"ignore.virus.scanning.warn.message": "true", &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
"jdk.selected.JAVA_MODULE": "corretto-17", &quot;jdk.selected.JAVA_MODULE&quot;: &quot;corretto-17&quot;,
"kotlin-language-version-configured": "true", &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
"last_opened_file_path": "D:/Github/EntityLib/api/src/main/java/me/tofaa/entitylib/extras", &quot;last_opened_file_path&quot;: &quot;D:/Github/EntityLib/api/src/main/java/me/tofaa/entitylib/extras&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"project.structure.last.edited": "Project", &quot;project.structure.last.edited&quot;: &quot;Project&quot;,
"project.structure.proportion": "0.15", &quot;project.structure.proportion&quot;: &quot;0.15&quot;,
"project.structure.side.proportion": "0.2", &quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
"settings.editor.selected.configurable": "preferences.pluginManager", &quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}]]></component> }</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="D:\Github\EntityLib\api\src\main\java\me\tofaa\entitylib\extras" /> <recent name="D:\Github\EntityLib\api\src\main\java\me\tofaa\entitylib\extras" />
@ -327,6 +321,7 @@
<workItem from="1709057446428" duration="195000" /> <workItem from="1709057446428" duration="195000" />
<workItem from="1709074092924" duration="24000" /> <workItem from="1709074092924" duration="24000" />
<workItem from="1709139306864" duration="1813000" /> <workItem from="1709139306864" duration="1813000" />
<workItem from="1709142473633" duration="2565000" />
</task> </task>
<servers /> <servers />
</component> </component>
@ -350,6 +345,11 @@
<line>33</line> <line>33</line>
<option name="timeStamp" value="3" /> <option name="timeStamp" value="3" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/testentitylib/TestPlayerCommand.java</url>
<line>69</line>
<option name="timeStamp" value="4" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-method"> <line-breakpoint enabled="true" type="java-method">
<url>file://$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/types/DisplayMeta.java</url> <url>file://$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/types/DisplayMeta.java</url>
<line>153</line> <line>153</line>

View file

@ -1,6 +1,7 @@
package me.tofaa.entitylib.meta.mobs.tameable; package me.tofaa.entitylib.meta.mobs.tameable;
import com.github.retrooper.packetevents.protocol.entity.data.EntityDataTypes; import com.github.retrooper.packetevents.protocol.entity.data.EntityDataTypes;
import me.tofaa.entitylib.extras.DyeColor;
import me.tofaa.entitylib.meta.Metadata; import me.tofaa.entitylib.meta.Metadata;
import me.tofaa.entitylib.meta.types.TameableMeta; import me.tofaa.entitylib.meta.types.TameableMeta;
@ -29,6 +30,14 @@ public class WolfMeta extends TameableMeta {
super.metadata.setIndex(offset(OFFSET, 1), EntityDataTypes.INT, value); super.metadata.setIndex(offset(OFFSET, 1), EntityDataTypes.INT, value);
} }
public DyeColor getCollarColorAsDye() {
return DyeColor.values()[super.metadata.getIndex(offset(OFFSET, 1), DyeColor.RED.ordinal())];
}
public void setCollarColor(DyeColor color) {
super.metadata.setIndex(offset(OFFSET, 1), EntityDataTypes.INT, color.ordinal());
}
public int getAngerTime() { public int getAngerTime() {
return super.metadata.getIndex(offset(OFFSET, 2), 0); return super.metadata.getIndex(offset(OFFSET, 2), 0);
} }