Skip to content
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

Merged
merged 4 commits into from
Sep 2, 2023

Conversation

mergu
Copy link
Contributor

@mergu mergu commented Aug 4, 2023

tested on 1.20.1

Debug.echoError(e);
}
for (PlayerTag player : players) {
((CraftPlayer) player.getPlayerEntity()).getHandle().connection.send(packet);
Copy link
Member

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) {
Copy link
Member

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));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List#of

Comment on lines 71 to 72
@ArgName("entity") @ArgLinear EntityTag entity,
@ArgName("location") @ArgLinear @ArgDefaultNull LocationTag location,
Copy link
Member

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);
Copy link
Member

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

@mergu
Copy link
Contributor Author

mergu commented Sep 2, 2023

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
Copy link
Member

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

@mcmonkey4eva mcmonkey4eva merged commit e2e883a into DenizenScript:dev Sep 2, 2023
1 check passed
@mergu mergu deleted the fake_mount branch September 2, 2023 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants