-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mount_to arg to fakespawn command #2513
Conversation
Debug.echoError(e); | ||
} | ||
for (PlayerTag player : players) { | ||
((CraftPlayer) player.getPlayerEntity()).getHandle().connection.send(packet); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PacketHelperImpl#send
@@ -101,6 +103,22 @@ public void deTrackEntity(Player player, Entity entity) { | |||
|
|||
public record TrackerData(PlayerTag player, ServerEntity tracker) {} | |||
|
|||
@Override | |||
public void addFakePassenger(List<PlayerTag> players, Entity vehicle, FakeEntity fakeEntity) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fakeEntity
-> fakePassenger
or something like that
} | ||
players = Collections.singletonList(Utilities.getEntryPlayer(scriptEntry)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List#of
plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/FakeSpawnCommand.java
Show resolved
Hide resolved
@ArgName("entity") @ArgLinear EntityTag entity, | ||
@ArgName("location") @ArgLinear @ArgDefaultNull LocationTag location, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe these two would need legacy out-of-order args handling? (note that cancel
shouldn't need that as it's a boolean arg).
@@ -76,6 +77,7 @@ public class PlayerHelperImpl extends PlayerHelper { | |||
|
|||
public static final Field FLY_TICKS = ReflectionHelper.getFields(ServerGamePacketListenerImpl.class).get(ReflectionMappingsInfo.ServerGamePacketListenerImpl_aboveGroundTickCount, int.class); | |||
public static final Field VEHICLE_FLY_TICKS = ReflectionHelper.getFields(ServerGamePacketListenerImpl.class).get(ReflectionMappingsInfo.ServerGamePacketListenerImpl_aboveGroundVehicleTickCount, int.class); | |||
public static final Field ENTITY_PASSENGERS = ReflectionHelper.getFields(ClientboundSetPassengersPacket.class).get(ReflectionMappingsInfo.ClientboundSetPassengersPacket_passengers, int[].class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would probably name this PASSENGERS_PACKET_PASSENGERS
or something, ENTITY_PASSENGERS
isn't really clear
Pushed up all the above requested changes |
} | ||
|
||
// <--[command] | ||
// @Name FakeSpawn | ||
// @Syntax fakespawn [<entity>] [<location>/cancel] (players:<player>|...) (d:<duration>{10s}) | ||
// @Syntax fakespawn [<entity>] [<location>/cancel] (players:<player>|...) (duration:<duration>{10s}) (mount_to:<entity>) | ||
// @Required 2 | ||
// @Maximum 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value needs to be updated
tested on 1.20.1