mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
--- a/net/minecraft/commands/arguments/ArgumentEntity.java
|
||||
+++ b/net/minecraft/commands/arguments/ArgumentEntity.java
|
||||
@@ -102,9 +102,15 @@
|
||||
}
|
||||
|
||||
private EntitySelector parse(StringReader stringreader, boolean flag) throws CommandSyntaxException {
|
||||
+ // CraftBukkit start
|
||||
+ return parse(stringreader, flag, false);
|
||||
+ }
|
||||
+
|
||||
+ public EntitySelector parse(StringReader stringreader, boolean flag, boolean overridePermissions) throws CommandSyntaxException {
|
||||
+ // CraftBukkit end
|
||||
boolean flag1 = false;
|
||||
ArgumentParserSelector argumentparserselector = new ArgumentParserSelector(stringreader, flag);
|
||||
- EntitySelector entityselector = argumentparserselector.parse();
|
||||
+ EntitySelector entityselector = argumentparserselector.parse(overridePermissions); // CraftBukkit
|
||||
|
||||
if (entityselector.getMaxResults() > 1 && this.single) {
|
||||
if (this.playersOnly) {
|
@@ -0,0 +1,38 @@
|
||||
--- a/net/minecraft/commands/arguments/EntityArgument.java
|
||||
+++ b/net/minecraft/commands/arguments/EntityArgument.java
|
||||
@@ -102,21 +102,27 @@
|
||||
}
|
||||
|
||||
private EntitySelector parse(StringReader reader, boolean allowAtSelectors) throws CommandSyntaxException {
|
||||
+ // CraftBukkit start
|
||||
+ return this.parse(reader, allowAtSelectors, false);
|
||||
+ }
|
||||
+
|
||||
+ public EntitySelector parse(StringReader stringreader, boolean flag, boolean overridePermissions) throws CommandSyntaxException {
|
||||
+ // CraftBukkit end
|
||||
boolean flag1 = false;
|
||||
- EntitySelectorParser argumentparserselector = new EntitySelectorParser(reader, allowAtSelectors);
|
||||
- EntitySelector entityselector = argumentparserselector.parse();
|
||||
+ EntitySelectorParser argumentparserselector = new EntitySelectorParser(stringreader, flag);
|
||||
+ EntitySelector entityselector = argumentparserselector.parse(overridePermissions); // CraftBukkit
|
||||
|
||||
if (entityselector.getMaxResults() > 1 && this.single) {
|
||||
if (this.playersOnly) {
|
||||
- reader.setCursor(0);
|
||||
- throw EntityArgument.ERROR_NOT_SINGLE_PLAYER.createWithContext(reader);
|
||||
+ stringreader.setCursor(0);
|
||||
+ throw EntityArgument.ERROR_NOT_SINGLE_PLAYER.createWithContext(stringreader);
|
||||
} else {
|
||||
- reader.setCursor(0);
|
||||
- throw EntityArgument.ERROR_NOT_SINGLE_ENTITY.createWithContext(reader);
|
||||
+ stringreader.setCursor(0);
|
||||
+ throw EntityArgument.ERROR_NOT_SINGLE_ENTITY.createWithContext(stringreader);
|
||||
}
|
||||
} else if (entityselector.includesEntities() && this.playersOnly && !entityselector.isSelfSelector()) {
|
||||
- reader.setCursor(0);
|
||||
- throw EntityArgument.ERROR_ONLY_PLAYERS_ALLOWED.createWithContext(reader);
|
||||
+ stringreader.setCursor(0);
|
||||
+ throw EntityArgument.ERROR_ONLY_PLAYERS_ALLOWED.createWithContext(stringreader);
|
||||
} else {
|
||||
return entityselector;
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
--- a/net/minecraft/commands/arguments/blocks/ArgumentBlock.java
|
||||
+++ b/net/minecraft/commands/arguments/blocks/ArgumentBlock.java
|
||||
@@ -67,7 +67,7 @@
|
||||
private final StringReader reader;
|
||||
private final boolean forTesting;
|
||||
private final boolean allowNbt;
|
||||
- private final Map<IBlockState<?>, Comparable<?>> properties = Maps.newHashMap();
|
||||
+ private final Map<IBlockState<?>, Comparable<?>> properties = Maps.newLinkedHashMap(); // CraftBukkit - stable
|
||||
private final Map<String, String> vagueProperties = Maps.newHashMap();
|
||||
private MinecraftKey id = MinecraftKey.withDefaultNamespace("");
|
||||
@Nullable
|
||||
@@ -275,7 +275,7 @@
|
||||
Iterator iterator = iblockstate.getPossibleValues().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
- T t0 = (Comparable) iterator.next();
|
||||
+ T t0 = (T) iterator.next(); // CraftBukkit - decompile error
|
||||
|
||||
if (t0 instanceof Integer integer) {
|
||||
suggestionsbuilder.suggest(integer);
|
||||
@@ -545,7 +545,7 @@
|
||||
Optional<T> optional = iblockstate.getValue(s);
|
||||
|
||||
if (optional.isPresent()) {
|
||||
- this.state = (IBlockData) this.state.setValue(iblockstate, (Comparable) optional.get());
|
||||
+ this.state = (IBlockData) this.state.setValue(iblockstate, (T) optional.get()); // CraftBukkit - decompile error
|
||||
this.properties.put(iblockstate, (Comparable) optional.get());
|
||||
} else {
|
||||
this.reader.setCursor(i);
|
||||
@@ -581,7 +581,7 @@
|
||||
private static <T extends Comparable<T>> void appendProperty(StringBuilder stringbuilder, IBlockState<T> iblockstate, Comparable<?> comparable) {
|
||||
stringbuilder.append(iblockstate.getName());
|
||||
stringbuilder.append('=');
|
||||
- stringbuilder.append(iblockstate.getName(comparable));
|
||||
+ stringbuilder.append(iblockstate.getName((T) comparable)); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
public static record a(IBlockData blockState, Map<IBlockState<?>, Comparable<?>> properties, @Nullable NBTTagCompound nbt) {
|
@@ -0,0 +1,38 @@
|
||||
--- a/net/minecraft/commands/arguments/blocks/BlockStateParser.java
|
||||
+++ b/net/minecraft/commands/arguments/blocks/BlockStateParser.java
|
||||
@@ -67,7 +67,7 @@
|
||||
private final StringReader reader;
|
||||
private final boolean forTesting;
|
||||
private final boolean allowNbt;
|
||||
- private final Map<Property<?>, Comparable<?>> properties = Maps.newHashMap();
|
||||
+ private final Map<Property<?>, Comparable<?>> properties = Maps.newLinkedHashMap(); // CraftBukkit - stable
|
||||
private final Map<String, String> vagueProperties = Maps.newHashMap();
|
||||
private ResourceLocation id = ResourceLocation.withDefaultNamespace("");
|
||||
@Nullable
|
||||
@@ -275,7 +275,7 @@
|
||||
Iterator iterator = property.getPossibleValues().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
- T t0 = (Comparable) iterator.next();
|
||||
+ T t0 = (T) iterator.next(); // CraftBukkit - decompile error
|
||||
|
||||
if (t0 instanceof Integer integer) {
|
||||
builder.suggest(integer);
|
||||
@@ -545,7 +545,7 @@
|
||||
Optional<T> optional = property.getValue(value);
|
||||
|
||||
if (optional.isPresent()) {
|
||||
- this.state = (BlockState) this.state.setValue(property, (Comparable) optional.get());
|
||||
+ this.state = (BlockState) this.state.setValue(property, (T) optional.get()); // CraftBukkit - decompile error
|
||||
this.properties.put(property, (Comparable) optional.get());
|
||||
} else {
|
||||
this.reader.setCursor(cursor);
|
||||
@@ -581,7 +581,7 @@
|
||||
private static <T extends Comparable<T>> void appendProperty(StringBuilder builder, Property<T> property, Comparable<?> value) {
|
||||
builder.append(property.getName());
|
||||
builder.append('=');
|
||||
- builder.append(property.getName(value));
|
||||
+ builder.append(property.getName((T) value)); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
public static record BlockResult(BlockState blockState, Map<Property<?>, Comparable<?>> properties, @Nullable CompoundTag nbt) {
|
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
+++ b/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
@@ -93,7 +93,7 @@
|
||||
}
|
||||
|
||||
private void checkPermissions(CommandSourceStack source) throws CommandSyntaxException {
|
||||
- if (this.usesSelector && !source.hasPermission(2)) {
|
||||
+ if (this.usesSelector && !source.hasPermission(2, "minecraft.command.selector")) { // CraftBukkit
|
||||
throw EntityArgument.ERROR_SELECTORS_NOT_ALLOWED.create();
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
+++ b/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
@@ -93,7 +93,7 @@
|
||||
}
|
||||
|
||||
private void checkPermissions(CommandListenerWrapper commandlistenerwrapper) throws CommandSyntaxException {
|
||||
- if (this.usesSelector && !commandlistenerwrapper.hasPermission(2)) {
|
||||
+ if (this.usesSelector && !commandlistenerwrapper.hasPermission(2, "minecraft.command.selector")) { // CraftBukkit
|
||||
throw ArgumentEntity.ERROR_SELECTORS_NOT_ALLOWED.create();
|
||||
}
|
||||
}
|
@@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/commands/arguments/selector/ArgumentParserSelector.java
|
||||
+++ b/net/minecraft/commands/arguments/selector/ArgumentParserSelector.java
|
||||
--- a/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
|
||||
+++ b/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
|
||||
@@ -158,7 +158,7 @@
|
||||
axisalignedbb = this.createAabb(this.deltaX == null ? 0.0D : this.deltaX, this.deltaY == null ? 0.0D : this.deltaY, this.deltaZ == null ? 0.0D : this.deltaZ);
|
||||
}
|
||||
|
||||
- Function function;
|
||||
+ Function<Vec3D, Vec3D> function; // CraftBukkit - decompile error
|
||||
+ Function<Vec3, Vec3> function; // CraftBukkit - decompile error
|
||||
|
||||
if (this.x == null && this.y == null && this.z == null) {
|
||||
function = (vec3d) -> {
|
||||
@@ -21,13 +21,13 @@
|
||||
+ // CraftBukkit end
|
||||
this.suggestions = this::suggestSelector;
|
||||
if (!this.reader.canRead()) {
|
||||
throw ArgumentParserSelector.ERROR_MISSING_SELECTOR_TYPE.createWithContext(this.reader);
|
||||
throw EntitySelectorParser.ERROR_MISSING_SELECTOR_TYPE.createWithContext(this.reader);
|
||||
@@ -505,6 +507,12 @@
|
||||
}
|
||||
|
||||
public EntitySelector parse() throws CommandSyntaxException {
|
||||
+ // CraftBukkit start
|
||||
+ return parse(false);
|
||||
+ return this.parse(false);
|
||||
+ }
|
||||
+
|
||||
+ public EntitySelector parse(boolean overridePermissions) throws CommandSyntaxException {
|
Reference in New Issue
Block a user