Merge branch 'master' into 1.17

This commit is contained in:
gnembon committed 2021-04-19 09:33:26 -03:00
commit 400ed75b31
2 files changed
+9 -16

No files matched your search

+2 -14
View File
@@ -57,20 +57,8 @@ living entities based on their spawn group. Negative descriptor resolves to all
category.
* All entity tags including those provided with datapacks. Built-in entity tags include: `skeletons`, `raiders`,
`beehive_inhabitors` (bee, duh), `arrows` and `impact_projectiles`.
* Any of the following standard entity types (equivalent to selection from `/summon` vanilla command:
`area_effect_cloud`, `armor_stand`, `arrow`, `bat`, `bee`, `blaze`, `boat`, `cat`, `cave_spider`, `chest_minecart`,
`chicken`, `cod`, `command_block_minecart`, `cow`, `creeper`, `dolphin`, `donkey`, `dragon_fireball`, `drowned`,
`egg`, `elder_guardian`, `end_crystal`, `ender_dragon`, `ender_pearl`, `enderman`, `endermite`, `evoker`,
`evoker_fangs`, `experience_bottle`, `experience_orb`, `eye_of_ender`, `falling_block`, `fireball`, `firework_rocket`,
`fishing_bobber`, `fox`, `furnace_minecart`, `ghast`, `giant`, `guardian`, `hoglin`, `hopper_minecart`, `horse`,
`husk`, `illusioner`, `iron_golem`, `item`, `item_frame`, `leash_knot`, `lightning_bolt`, `llama`, `llama_spit`,
`magma_cube`, `minecart`, `mooshroom`, `mule`, `ocelot`, `painting`, `panda`, `parrot`, `phantom`, `pig`, `piglin`,
`piglin_brute`, `pillager`, `player`, `polar_bear`, `potion`, `pufferfish`, `rabbit`, `ravager`, `salmon`, `sheep`,
`shulker`, `shulker_bullet`, `silverfish`, `skeleton`, `skeleton_horse`, `slime`, `small_fireball`, `snow_golem`,
`snowball`, `spawner_minecart`, `spectral_arrow`, `spider`, `squid`, `stray`, `strider`, `tnt`, `tnt_minecart`,
`trader_llama`, `trident`, `tropical_fish`, `turtle`, `vex`, `villager`, `vindicator`, `wandering_trader`, `witch`,
`wither`, `wither_skeleton`, `wither_skull`, `wolf`, `zoglin`, `zombie`, `zombie_horse`, `zombie_villager`,
`zombified_piglin`
* Any of the standard entity types, equivalent to selection from `/summon` vanilla command, which is one of the options returned
by `entity_types()`, except for `'fishing_bobber'` and `'player'`.
All categories can be preceded with `'!'` which will fetch all entities (unless otherwise noted) that are valid (health > 0) but not
belonging to that group.
@@ -16,6 +16,7 @@ import net.minecraft.server.world.ServerWorld;
import net.minecraft.text.Text;
import net.minecraft.util.math.Vec2f;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.dimension.DimensionType;
import java.util.List;
import java.util.function.BinaryOperator;
@@ -24,8 +25,8 @@ public class FixedCommandSource extends ServerCommandSource
{
private Vec3d position;
private ServerWorld world;
private final String simpleName;
private final Text name;
private String simpleName;
private Text name;
private final MinecraftServer server;
private Entity entity;
private ResultConsumer<ServerCommandSource> resultConsumer;
@@ -56,6 +57,8 @@ public class FixedCommandSource extends ServerCommandSource
public ServerCommandSource withEntity(Entity entity)
{
this.entity = entity;
this.simpleName = entity.getName().getString();
this.name = entity.getDisplayName();
return this;
}
@@ -107,6 +110,8 @@ public class FixedCommandSource extends ServerCommandSource
public ServerCommandSource withWorld(ServerWorld world)
{
this.world = world;
double d = DimensionType.method_31109(this.world.getDimension(), world.getDimension());
this.position = new Vec3d(this.position.x * d, this.position.y, this.position.z * d);
return this;
}