i should have put ai release to a later location

This commit is contained in:
Tofaa 2024-01-19 07:28:56 +03:00
parent eeb64aa909
commit a4f57da66f
6 changed files with 41 additions and 32 deletions

View file

@ -6,6 +6,11 @@
<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$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/entity/WrapperEntity.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/entity/WrapperEntity.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/types/DisplayMeta.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/types/DisplayMeta.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test-plugin/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/test-plugin/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/SpawnClickableFrogCommand.java" beforeDir="false" afterPath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/SpawnClickableFrogCommand.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/TestDisplayCommand.java" beforeDir="false" afterPath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/TestDisplayCommand.java" 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" />
@ -68,29 +73,30 @@
<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">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;Gradle.EntityLib:test-plugin [runServer].executor&quot;: &quot;Debug&quot;, "Gradle.Build EntityLib.executor": "Run",
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;, "Gradle.EntityLib:test-plugin [runServer].executor": "Debug",
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, "RunOnceActivity.OpenProjectViewOnStart": "true",
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;, "RunOnceActivity.ShowReadmeOnStart": "true",
&quot;git-widget-placeholder&quot;: &quot;master&quot;, "WebServerToolWindowFactoryState": "false",
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;, "git-widget-placeholder": "master",
&quot;jdk.selected.JAVA_MODULE&quot;: &quot;corretto-17&quot;, "ignore.virus.scanning.warn.message": "true",
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;, "jdk.selected.JAVA_MODULE": "corretto-17",
&quot;last_opened_file_path&quot;: &quot;D:/Github/EntityLib&quot;, "kotlin-language-version-configured": "true",
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;, "last_opened_file_path": "D:/Github/EntityLib",
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;, "node.js.detected.package.eslint": "true",
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;, "node.js.detected.package.tslint": "true",
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.eslint": "(autodetect)",
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;, "node.js.selected.package.tslint": "(autodetect)",
&quot;project.structure.last.edited&quot;: &quot;Modules&quot;, "nodejs_package_manager_path": "npm",
&quot;project.structure.proportion&quot;: &quot;0.0&quot;, "project.structure.last.edited": "Modules",
&quot;project.structure.side.proportion&quot;: &quot;0.0&quot;, "project.structure.proportion": "0.0",
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;, "project.structure.side.proportion": "0.0",
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot; "settings.editor.selected.configurable": "preferences.pluginManager",
"vue.rearranger.settings.migration": "true"
} }
}</component> }]]></component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="D:\Github\EntityLib\test-plugin" /> <recent name="D:\Github\EntityLib\test-plugin" />
@ -208,6 +214,8 @@
<workItem from="1704502790346" duration="6191000" /> <workItem from="1704502790346" duration="6191000" />
<workItem from="1705192736239" duration="496000" /> <workItem from="1705192736239" duration="496000" />
<workItem from="1705534524814" duration="15424000" /> <workItem from="1705534524814" duration="15424000" />
<workItem from="1705578156456" duration="78000" />
<workItem from="1705636302508" duration="1873000" />
</task> </task>
<servers /> <servers />
</component> </component>

View file

@ -42,13 +42,11 @@ public class WrapperEntity implements Tickable {
if (spawned) return false; if (spawned) return false;
this.location = location; this.location = location;
this.spawned = true; this.spawned = true;
int data = 0; int data = 0;
Optional<Vector3d> velocity; Optional<Vector3d> velocity;
double veloX = 0, veloY = 0, veloZ = 0; double veloX = 0, veloY = 0, veloZ = 0;
if (meta instanceof ObjectData) { if (meta instanceof ObjectData) {
ObjectData od = (ObjectData) meta; ObjectData od = (ObjectData) meta;
data = od.getObjectData(); data = od.getObjectData();
if (od.requiresVelocityPacketAtSpawn()) { if (od.requiresVelocityPacketAtSpawn()) {
final WrapperPlayServerEntityVelocity veloPacket = getVelocityPacket(); final WrapperPlayServerEntityVelocity veloPacket = getVelocityPacket();

View file

@ -10,7 +10,7 @@ import me.tofaa.entitylib.meta.Metadata;
public class DisplayMeta extends EntityMeta { public class DisplayMeta extends EntityMeta {
public static final byte OFFSET = EntityMeta.MAX_OFFSET; public static final byte OFFSET = EntityMeta.MAX_OFFSET;
public static final byte MAX_OFFSET = OFFSET + 14; public static final byte MAX_OFFSET = OFFSET + 15;
public DisplayMeta(int entityId, Metadata metadata) { public DisplayMeta(int entityId, Metadata metadata) {
super(entityId, metadata); super(entityId, metadata);

View file

@ -32,6 +32,6 @@ dependencies {
tasks { tasks {
runServer { runServer {
minecraftVersion("1.19.4") minecraftVersion("1.20.4")
} }
} }

View file

@ -26,7 +26,7 @@ public class SpawnClickableFrogCommand implements CommandExecutor {
@Override @Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) { public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {
Player player = (Player) commandSender; Player player = (Player) commandSender;
WrapperEntity e = EntityLib.createEntity(UUID.randomUUID(), EntityTypes.FROG); WrapperEntity e = EntityLib.createEntity(UUID.randomUUID(), EntityTypes.TEXT_DISPLAY);
FrogMeta meta = (FrogMeta) e.getMeta(); FrogMeta meta = (FrogMeta) e.getMeta();
meta.setHasGlowingEffect(true); meta.setHasGlowingEffect(true);
meta.setCustomNameVisible(true); meta.setCustomNameVisible(true);

View file

@ -1,12 +1,12 @@
package me.tofaa.entitylib; package me.tofaa.entitylib;
import com.github.retrooper.packetevents.protocol.entity.type.EntityTypes; import com.github.retrooper.packetevents.protocol.entity.type.EntityTypes;
import com.github.retrooper.packetevents.util.Vector3f;
import io.github.retrooper.packetevents.util.SpigotConversionUtil; import io.github.retrooper.packetevents.util.SpigotConversionUtil;
import me.tofaa.entitylib.entity.WrapperEntity; import me.tofaa.entitylib.entity.WrapperEntity;
import me.tofaa.entitylib.meta.display.TextDisplayMeta; import me.tofaa.entitylib.meta.display.TextDisplayMeta;
import me.tofaa.entitylib.meta.types.DisplayMeta; import me.tofaa.entitylib.meta.types.DisplayMeta;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -22,10 +22,13 @@ public class TestDisplayCommand implements CommandExecutor {
Player player = (Player) commandSender; Player player = (Player) commandSender;
WrapperEntity e = EntityLib.createEntity(UUID.randomUUID(), EntityTypes.TEXT_DISPLAY); WrapperEntity e = EntityLib.createEntity(UUID.randomUUID(), EntityTypes.TEXT_DISPLAY);
TextDisplayMeta meta = (TextDisplayMeta) e.getMeta(); TextDisplayMeta meta = (TextDisplayMeta) e.getMeta();
meta.setText(Component.text("Hello World!", NamedTextColor.GOLD)); meta.setHasGlowingEffect(true);
meta.setText(Component.text("Hello World!"));
meta.setBillboardConstraints(DisplayMeta.BillboardConstraints.CENTER); meta.setBillboardConstraints(DisplayMeta.BillboardConstraints.CENTER);
e.addViewer((player.getUniqueId())); meta.setScale(new Vector3f(2, 2, 2));
e.spawn(SpigotConversionUtil.fromBukkitLocation((player.getLocation().clone().add(0, 2, 0)))); meta.setTranslation(new Vector3f(10, 0, 0));
return true; e.addViewer(player.getUniqueId());
e.spawn(SpigotConversionUtil.fromBukkitLocation(player.getLocation()));
return false;
} }
} }