mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-09 08:32:07 -07:00
Add config to remove player as vehicle restriction in /ride (#12327)
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
--- a/net/minecraft/server/commands/RideCommand.java
|
||||||
|
+++ b/net/minecraft/server/commands/RideCommand.java
|
||||||
|
@@ -58,7 +_,7 @@
|
||||||
|
Entity vehicle1 = target.getVehicle();
|
||||||
|
if (vehicle1 != null) {
|
||||||
|
throw ERROR_ALREADY_RIDING.create(target.getDisplayName(), vehicle1.getDisplayName());
|
||||||
|
- } else if (vehicle.getType() == EntityType.PLAYER) {
|
||||||
|
+ } else if (vehicle.getType() == EntityType.PLAYER && !io.papermc.paper.configuration.GlobalConfiguration.get().commands.rideCommandAllowPlayerAsVehicle) { // Paper - allow player as vehicle
|
||||||
|
throw ERROR_MOUNTING_PLAYER.create();
|
||||||
|
} else if (target.getSelfAndPassengers().anyMatch(passenger -> passenger == vehicle)) {
|
||||||
|
throw ERROR_MOUNTING_LOOP.create();
|
@@ -12,7 +12,6 @@ import net.minecraft.core.component.DataComponents;
|
|||||||
import net.minecraft.network.protocol.Packet;
|
import net.minecraft.network.protocol.Packet;
|
||||||
import net.minecraft.network.protocol.game.ServerboundPlaceRecipePacket;
|
import net.minecraft.network.protocol.game.ServerboundPlaceRecipePacket;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.item.Items;
|
|
||||||
import org.jspecify.annotations.Nullable;
|
import org.jspecify.annotations.Nullable;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
|
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
|
||||||
@@ -202,6 +201,8 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|||||||
public class Commands extends ConfigurationPart {
|
public class Commands extends ConfigurationPart {
|
||||||
public boolean suggestPlayerNamesWhenNullTabCompletions = true;
|
public boolean suggestPlayerNamesWhenNullTabCompletions = true;
|
||||||
public boolean timeCommandAffectsAllWorlds = false;
|
public boolean timeCommandAffectsAllWorlds = false;
|
||||||
|
@Comment("Allow mounting entities to a player in the Vanilla '/ride' command.")
|
||||||
|
public boolean rideCommandAllowPlayerAsVehicle = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Logging logging;
|
public Logging logging;
|
||||||
|
Reference in New Issue
Block a user