Skip to content

Commit

Permalink
fix locationtag.with_world
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 9, 2021
1 parent 4f15e69 commit 2005bd6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
Expand Up @@ -620,6 +620,12 @@ public LocationTag multiply(double input) {
return this;
}

@Override
public void setWorld(World world) {
super.setWorld(world);
backupWorld = world == null ? null : world.getName();
}

public double distanceSquaredNoWorld(Location loc2) {
return NumberConversions.square(getX() - loc2.getX()) + NumberConversions.square(getY() - loc2.getY()) + NumberConversions.square(getZ() - loc2.getZ());
}
Expand Down Expand Up @@ -1565,6 +1571,7 @@ public static void registerTags() {
// @returns LocationTag
// @description
// Returns the exact impact normal at the location this location is pointing at.
// In minecraft, the impact normal is generally the side of the block that the location is facing.
// Optionally, specify a maximum range to find the location from (defaults to 200).
// -->
registerTag("precise_impact_normal", (attribute, object) -> {
Expand Down Expand Up @@ -2802,7 +2809,7 @@ else if (attribute.startsWith("unexplored_structure", 2) && attribute.hasContext
// @attribute <LocationTag.vector_to_face>
// @returns ElementTag
// @description
// Returns the name of the BlockFace represented by a vector.
// Returns the name of the BlockFace represented by a normal vector.
// Result can be any of the following:
// NORTH, EAST, SOUTH, WEST, UP, DOWN, NORTH_EAST, NORTH_WEST, SOUTH_EAST, SOUTH_WEST,
// WEST_NORTH_WEST, NORTH_NORTH_WEST, NORTH_NORTH_EAST, EAST_NORTH_EAST, EAST_SOUTH_EAST,
Expand Down
Expand Up @@ -308,7 +308,8 @@ public static void registerTags() {
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the material is a bisected material (doors, beds, double chests, double plants, ...).
// Returns whether the material type is a bisected material type (doors, beds, double chests, double plants, ...).
// Some MaterialTag instances, such as single chests, may return true for this tag even though the specific material instance is not bisected.
// When this returns true, <@link tag MaterialTag.half>, <@link tag MaterialTag.relative_vector>
// and <@link mechanism MaterialTag.half> are accessible.
// -->
Expand All @@ -317,17 +318,17 @@ public static void registerTags() {
});

// <--[tag]
// @attribute <MaterialTag.is_bamboo>
// @attribute <MaterialTag.has_leaf_size>
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the material is a bamboo material.
// Returns whether the material has a bamboo leaf size (currently only bamboo).
// When this returns true, <@link tag MaterialTag.leaf_size>,
// and <@link mechanism MaterialTag.leaf_size> are accessible.
// -->
registerTag("is_bamboo", (attribute, object) -> {
registerTag("has_leaf_size", (attribute, object) -> {
return new ElementTag(MaterialLeafSize.describes(object));
});
}, "is_bamboo");

// <--[tag]
// @attribute <MaterialTag.is_levelable>
Expand Down Expand Up @@ -419,7 +420,7 @@ public static void registerTags() {
// and <@link mechanism MaterialTag.switch_face> are accessible.
// -->
registerTag("is_switch", (attribute, object) -> {
return new ElementTag(MaterialSnowable.describes(object));
return new ElementTag(MaterialSwitchFace.describes(object));
});

// <--[tag]
Expand Down
Expand Up @@ -40,7 +40,7 @@ public CreateWorldCommand() {
// This command creates a new minecraft world with the specified name, or loads an existing world by that name.
//
// Optionally specify a plugin-based world generator by it's generator ID.
// If you want an empty void world, you can use "generate:denizen:void".
// If you want an empty void world, you can use "generator:denizen:void".
//
// Optionally specify additional generator settings as JSON input.
//
Expand Down

0 comments on commit 2005bd6

Please sign in to comment.