addedd a comment for an idea

This commit is contained in:
xSquishyLiam
2025-08-30 00:49:27 +01:00
parent ca9a54ae71
commit 6651ae99f7
2 changed files with 7 additions and 11 deletions

4
.idea/workspace.xml generated
View File

@@ -4,9 +4,7 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="ff2e9770-ec88-4715-adeb-b9dbda130e1a" name="Changes" comment=""> <list default="true" id="ff2e9770-ec88-4715-adeb-b9dbda130e1a" name="Changes" comment="" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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" />

View File

@@ -2,6 +2,7 @@ package re.imc.geysermodelengine.listener;
import com.ticxo.modelengine.api.events.*; import com.ticxo.modelengine.api.events.*;
import com.ticxo.modelengine.api.model.ActiveModel; import com.ticxo.modelengine.api.model.ActiveModel;
import io.papermc.paper.event.packet.PlayerChunkLoadEvent;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
@@ -29,7 +30,6 @@ public class ModelListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void onAddModel(AddModelEvent event) { public void onAddModel(AddModelEvent event) {
if (event.isCancelled()) return; if (event.isCancelled()) return;
plugin.getModelManager().create(event.getTarget(), event.getModel()); plugin.getModelManager().create(event.getTarget(), event.getModel());
} }
@@ -52,6 +52,10 @@ public class ModelListener implements Listener {
} }
} }
/*
/ xSquishyLiam:
/ I'm wondering if we could move this to more of a player loading chunks instead of checking all worlds via PlayerChunkLoadEvent?
*/
@EventHandler @EventHandler
public void onWorldInit(WorldInitEvent event) { public void onWorldInit(WorldInitEvent event) {
World world = event.getWorld(); World world = event.getWorld();
@@ -59,13 +63,7 @@ public class ModelListener implements Listener {
} }
/* /*
/ Temp fix till a better solution is found - / xSquishyLiam - conclusion:
/ the issue is when a player logs out and the mob is there,
/ the player logs back in sometimes it can display as a pig only
/ this issues mainly comes from the functions from EntityTaskManager
/ sendSpawnPacket() and canSee()
/
/ TheLividaProject - conclusion:
/ I'm assuming when a player joins the server the packet for mob spawning is instant so the client resyncs itself / I'm assuming when a player joins the server the packet for mob spawning is instant so the client resyncs itself
/ hence why the pig is shown instead of going invisible and not displaying the texture of the modeled mob / hence why the pig is shown instead of going invisible and not displaying the texture of the modeled mob
*/ */