Skip to content

Commit c3ebcc3

Browse files
committed
Commands mapping updated.
Signed-off-by: Pavel Erokhin (MairwunNx) <[email protected]>
1 parent 81a3557 commit c3ebcc3

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/main/java/com/mairwunnx/projectessentials/core/impl/vanilla/commands/ExecuteCommand.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public static void register(CommandDispatcher<CommandSource> dispatcher) {
139139
}))).then(Commands.literal("anchored").then(Commands.argument("anchor", EntityAnchorArgument.entityAnchor()).redirect(literalcommandnode, (p_201091_0_) -> {
140140
return p_201091_0_.getSource().withEntityAnchorType(EntityAnchorArgument.getEntityAnchor(p_201091_0_, "anchor"));
141141
}))).then(Commands.literal("in").then(Commands.argument("dimension", DimensionArgument.getDimension()).redirect(literalcommandnode, (p_201089_0_) -> {
142-
return p_201089_0_.getSource().withWorld(p_201089_0_.getSource().getServer().getWorld(DimensionArgument.func_212592_a(p_201089_0_, "dimension")));
142+
return p_201089_0_.getSource().withWorld(p_201089_0_.getSource().getServer().getWorld(DimensionArgument.getDimensionArgument(p_201089_0_, "dimension")));
143143
}))));
144144
}
145145

@@ -184,27 +184,27 @@ private static void checkPermissions(CommandSource source) {
184184
datacommand$idataprovider.createArgument(literal, (p_229765_3_) -> {
185185
return p_229765_3_.then(Commands.argument("path", NBTPathArgument.nbtPath()).then(Commands.literal("int").then(Commands.argument("scale", DoubleArgumentType.doubleArg()).redirect(parent, (p_229801_2_) -> {
186186
return storeIntoNBT(p_229801_2_.getSource(), datacommand$idataprovider.createAccessor(p_229801_2_), NBTPathArgument.getNBTPath(p_229801_2_, "path"), (p_229800_1_) -> {
187-
return IntNBT.func_229692_a_((int) ((double) p_229800_1_ * DoubleArgumentType.getDouble(p_229801_2_, "scale")));
187+
return IntNBT.valueOf((int) ((double) p_229800_1_ * DoubleArgumentType.getDouble(p_229801_2_, "scale")));
188188
}, storingResult);
189189
}))).then(Commands.literal("float").then(Commands.argument("scale", DoubleArgumentType.doubleArg()).redirect(parent, (p_229798_2_) -> {
190190
return storeIntoNBT(p_229798_2_.getSource(), datacommand$idataprovider.createAccessor(p_229798_2_), NBTPathArgument.getNBTPath(p_229798_2_, "path"), (p_229797_1_) -> {
191-
return FloatNBT.func_229689_a_((float) ((double) p_229797_1_ * DoubleArgumentType.getDouble(p_229798_2_, "scale")));
191+
return FloatNBT.valueOf((float) ((double) p_229797_1_ * DoubleArgumentType.getDouble(p_229798_2_, "scale")));
192192
}, storingResult);
193193
}))).then(Commands.literal("short").then(Commands.argument("scale", DoubleArgumentType.doubleArg()).redirect(parent, (p_229794_2_) -> {
194194
return storeIntoNBT(p_229794_2_.getSource(), datacommand$idataprovider.createAccessor(p_229794_2_), NBTPathArgument.getNBTPath(p_229794_2_, "path"), (p_229792_1_) -> {
195-
return ShortNBT.func_229701_a_((short) ((int) ((double) p_229792_1_ * DoubleArgumentType.getDouble(p_229794_2_, "scale"))));
195+
return ShortNBT.valueOf((short) ((int) ((double) p_229792_1_ * DoubleArgumentType.getDouble(p_229794_2_, "scale"))));
196196
}, storingResult);
197197
}))).then(Commands.literal("long").then(Commands.argument("scale", DoubleArgumentType.doubleArg()).redirect(parent, (p_229790_2_) -> {
198198
return storeIntoNBT(p_229790_2_.getSource(), datacommand$idataprovider.createAccessor(p_229790_2_), NBTPathArgument.getNBTPath(p_229790_2_, "path"), (p_229788_1_) -> {
199-
return LongNBT.func_229698_a_((long) ((double) p_229788_1_ * DoubleArgumentType.getDouble(p_229790_2_, "scale")));
199+
return LongNBT.valueOf((long) ((double) p_229788_1_ * DoubleArgumentType.getDouble(p_229790_2_, "scale")));
200200
}, storingResult);
201201
}))).then(Commands.literal("double").then(Commands.argument("scale", DoubleArgumentType.doubleArg()).redirect(parent, (p_229784_2_) -> {
202202
return storeIntoNBT(p_229784_2_.getSource(), datacommand$idataprovider.createAccessor(p_229784_2_), NBTPathArgument.getNBTPath(p_229784_2_, "path"), (p_229781_1_) -> {
203-
return DoubleNBT.func_229684_a_((double) p_229781_1_ * DoubleArgumentType.getDouble(p_229784_2_, "scale"));
203+
return DoubleNBT.valueOf((double) p_229781_1_ * DoubleArgumentType.getDouble(p_229784_2_, "scale"));
204204
}, storingResult);
205205
}))).then(Commands.literal("byte").then(Commands.argument("scale", DoubleArgumentType.doubleArg()).redirect(parent, (p_229774_2_) -> {
206206
return storeIntoNBT(p_229774_2_.getSource(), datacommand$idataprovider.createAccessor(p_229774_2_), NBTPathArgument.getNBTPath(p_229774_2_, "path"), (p_229762_1_) -> {
207-
return ByteNBT.func_229671_a_((byte) ((int) ((double) p_229762_1_ * DoubleArgumentType.getDouble(p_229774_2_, "scale"))));
207+
return ByteNBT.valueOf((byte) ((int) ((double) p_229762_1_ * DoubleArgumentType.getDouble(p_229774_2_, "scale"))));
208208
}, storingResult);
209209
}))));
210210
});

src/main/java/com/mairwunnx/projectessentials/core/impl/vanilla/commands/ForceLoadCommand.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ public static void register(CommandDispatcher<CommandSource> dispatcher) {
5353
CommandAPI.INSTANCE.removeCommand("forceload");
5454

5555
dispatcher.register(Commands.literal("forceload").then(Commands.literal("add").then(Commands.argument("from", ColumnPosArgument.columnPos()).executes((p_212711_0_) -> {
56-
return func_212719_a(p_212711_0_.getSource(), ColumnPosArgument.func_218101_a(p_212711_0_, "from"), ColumnPosArgument.func_218101_a(p_212711_0_, "from"), true);
56+
return func_212719_a(p_212711_0_.getSource(), ColumnPosArgument.fromBlockPos(p_212711_0_, "from"), ColumnPosArgument.fromBlockPos(p_212711_0_, "from"), true);
5757
}).then(Commands.argument("to", ColumnPosArgument.columnPos()).executes((p_212714_0_) -> {
58-
return func_212719_a(p_212714_0_.getSource(), ColumnPosArgument.func_218101_a(p_212714_0_, "from"), ColumnPosArgument.func_218101_a(p_212714_0_, "to"), true);
58+
return func_212719_a(p_212714_0_.getSource(), ColumnPosArgument.fromBlockPos(p_212714_0_, "from"), ColumnPosArgument.fromBlockPos(p_212714_0_, "to"), true);
5959
})))).then(Commands.literal("remove").then(Commands.argument("from", ColumnPosArgument.columnPos()).executes((p_218850_0_) -> {
60-
return func_212719_a(p_218850_0_.getSource(), ColumnPosArgument.func_218101_a(p_218850_0_, "from"), ColumnPosArgument.func_218101_a(p_218850_0_, "from"), false);
60+
return func_212719_a(p_218850_0_.getSource(), ColumnPosArgument.fromBlockPos(p_218850_0_, "from"), ColumnPosArgument.fromBlockPos(p_218850_0_, "from"), false);
6161
}).then(Commands.argument("to", ColumnPosArgument.columnPos()).executes((p_212718_0_) -> {
62-
return func_212719_a(p_212718_0_.getSource(), ColumnPosArgument.func_218101_a(p_212718_0_, "from"), ColumnPosArgument.func_218101_a(p_212718_0_, "to"), false);
62+
return func_212719_a(p_212718_0_.getSource(), ColumnPosArgument.fromBlockPos(p_212718_0_, "from"), ColumnPosArgument.fromBlockPos(p_212718_0_, "to"), false);
6363
}))).then(Commands.literal("all").executes((p_212715_0_) -> {
6464
return func_212722_b(p_212715_0_.getSource());
6565
}))).then(Commands.literal("query").executes((p_212710_0_) -> {
6666
return func_212721_a(p_212710_0_.getSource());
6767
}).then(Commands.argument("pos", ColumnPosArgument.columnPos()).executes((p_212723_0_) -> {
68-
return func_212713_a(p_212723_0_.getSource(), ColumnPosArgument.func_218101_a(p_212723_0_, "pos"));
68+
return func_212713_a(p_212723_0_.getSource(), ColumnPosArgument.fromBlockPos(p_212723_0_, "pos"));
6969
}))));
7070
}
7171

src/main/java/com/mairwunnx/projectessentials/core/impl/vanilla/commands/TeleportCommand.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private static int teleportToEntity(CommandSource source, Collection<? extends E
9898
checkPermissions(source);
9999

100100
for (Entity entity : targets) {
101-
teleport(source, entity, (ServerWorld) destination.world, destination.func_226277_ct_(), destination.func_226278_cu_(), destination.func_226281_cx_(), EnumSet.noneOf(SPlayerPositionLookPacket.Flags.class), destination.rotationYaw, destination.rotationPitch, null);
101+
teleport(source, entity, (ServerWorld) destination.world, destination.getPosX(), destination.getPosY(), destination.getPosZ(), EnumSet.noneOf(SPlayerPositionLookPacket.Flags.class), destination.rotationYaw, destination.rotationPitch, null);
102102
}
103103

104104
if (targets.size() == 1) {
@@ -166,10 +166,10 @@ private static void teleport(CommandSource source, Entity entityIn, ServerWorld
166166

167167
if (entityIn instanceof ServerPlayerEntity) {
168168
ChunkPos chunkpos = new ChunkPos(new BlockPos(x, y, z));
169-
worldIn.getChunkProvider().func_217228_a(TicketType.POST_TELEPORT, chunkpos, 1, entityIn.getEntityId());
169+
worldIn.getChunkProvider().registerTicket(TicketType.POST_TELEPORT, chunkpos, 1, entityIn.getEntityId());
170170
entityIn.stopRiding();
171171
if (((ServerPlayerEntity) entityIn).isSleeping()) {
172-
((ServerPlayerEntity) entityIn).func_225652_a_(true, true);
172+
((ServerPlayerEntity) entityIn).stopSleepInBed(true, true);
173173
}
174174

175175
if (worldIn == entityIn.world) {
@@ -198,7 +198,7 @@ private static void teleport(CommandSource source, Entity entityIn, ServerWorld
198198
entityIn.copyDataFromOld(entity);
199199
entityIn.setLocationAndAngles(x, y, z, f1, f);
200200
entityIn.setRotationYawHead(f1);
201-
worldIn.func_217460_e(entityIn);
201+
worldIn.addFromAnotherDimension(entityIn);
202202
}
203203
}
204204

0 commit comments

Comments
 (0)