specified interactive option for markers, fixes #372
This commit is contained in:
1 parent
5f34b5c96c
commit
d90b4a306a
3 files changed
+46
-5
No files matched your search
+12
-2
@@ -3397,11 +3397,21 @@ Available shapes:
|
|||||||
* `height` - height of the cyllinder, defaults to `0`, so flat disk. Can be negative.
|
* `height` - height of the cyllinder, defaults to `0`, so flat disk. Can be negative.
|
||||||
* `level` - level of details, see `'sphere'`.
|
* `level` - level of details, see `'sphere'`.
|
||||||
|
|
||||||
### `create_marker(text, pos, rotation?, block?)`
|
### `create_marker(text, pos, rotation?, block?, interactive?)`
|
||||||
|
|
||||||
Spawns a (permanent) marker entity with text or block at position. Returns that entity for further manipulations.
|
Spawns a (permanent) marker entity with text or block at position. Returns that entity for further manipulations.
|
||||||
Unloading the app that spawned them will cause all the markers from the loaded portion of the world to be removed.
|
Unloading the app that spawned them will cause all the markers from the loaded portion of the world to be removed.
|
||||||
Also, if the game loads that marker in the future and the app is not loaded, it will be removed as well.
|
Also, if the game loads that marker in the future and the app is not loaded, it will be removed as well.
|
||||||
|
|
||||||
|
If `interactive` (`true` by default) is `false`, the armorstand will be a marker and would not be interactive in any
|
||||||
|
gamemode. But blocks can be placed inside markers and will not catch any interaction events.
|
||||||
|
|
||||||
|
Y Position of a marker text or block will be adjusted to make blocks or text appear at the specified position.
|
||||||
|
This makes so that actual armorstand position may be offset on Y axis. You would need to adjust your entity
|
||||||
|
locations if you plan to move the armorstand around after the fact. If both text and block are specified - one of them
|
||||||
|
will be aligned (armorstand type markers text shows up at their feet, while for regular armorstands - above the head,
|
||||||
|
while block on the head always render in the same position regardless if its a marker or not).
|
||||||
|
|
||||||
|
|
||||||
### `remove_all_markers()`
|
### `remove_all_markers()`
|
||||||
|
|
||||||
|
|||||||
@@ -105,11 +105,21 @@ Available shapes:
|
|||||||
* `height` - height of the cyllinder, defaults to `0`, so flat disk. Can be negative.
|
* `height` - height of the cyllinder, defaults to `0`, so flat disk. Can be negative.
|
||||||
* `level` - level of details, see `'sphere'`.
|
* `level` - level of details, see `'sphere'`.
|
||||||
|
|
||||||
### `create_marker(text, pos, rotation?, block?)`
|
### `create_marker(text, pos, rotation?, block?, interactive?)`
|
||||||
|
|
||||||
Spawns a (permanent) marker entity with text or block at position. Returns that entity for further manipulations.
|
Spawns a (permanent) marker entity with text or block at position. Returns that entity for further manipulations.
|
||||||
Unloading the app that spawned them will cause all the markers from the loaded portion of the world to be removed.
|
Unloading the app that spawned them will cause all the markers from the loaded portion of the world to be removed.
|
||||||
Also, if the game loads that marker in the future and the app is not loaded, it will be removed as well.
|
Also, if the game loads that marker in the future and the app is not loaded, it will be removed as well.
|
||||||
|
|
||||||
|
If `interactive` (`true` by default) is `false`, the armorstand will be a marker and would not be interactive in any
|
||||||
|
gamemode. But blocks can be placed inside markers and will not catch any interaction events.
|
||||||
|
|
||||||
|
Y Position of a marker text or block will be adjusted to make blocks or text appear at the specified position.
|
||||||
|
This makes so that actual armorstand position may be offset on Y axis. You would need to adjust your entity
|
||||||
|
locations if you plan to move the armorstand around after the fact. If both text and block are specified - one of them
|
||||||
|
will be aligned (armorstand type markers text shows up at their feet, while for regular armorstands - above the head,
|
||||||
|
while block on the head always render in the same position regardless if its a marker or not).
|
||||||
|
|
||||||
|
|
||||||
### `remove_all_markers()`
|
### `remove_all_markers()`
|
||||||
|
|
||||||
|
|||||||
@@ -2905,9 +2905,30 @@ public class CarpetExpression
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArmorStandEntity armorstand = new ArmorStandEntity(EntityType.ARMOR_STAND, cc.s.getWorld());
|
ArmorStandEntity armorstand = new ArmorStandEntity(EntityType.ARMOR_STAND, cc.s.getWorld());
|
||||||
|
double yoffset;
|
||||||
|
if (targetBlock == null && name.isEmpty())
|
||||||
|
{
|
||||||
|
yoffset = 0.0;
|
||||||
|
}
|
||||||
|
else if (!interactable && targetBlock == null)
|
||||||
|
{
|
||||||
|
yoffset = -0.41;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (targetBlock==null)
|
||||||
|
{
|
||||||
|
yoffset = -armorstand.getHeight()-0.41;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
yoffset = -armorstand.getHeight()+0.3;
|
||||||
|
}
|
||||||
|
}
|
||||||
armorstand.refreshPositionAndAngles(
|
armorstand.refreshPositionAndAngles(
|
||||||
pointLocator.vec.x,
|
pointLocator.vec.x,
|
||||||
pointLocator.vec.y - ((targetBlock==null)?(armorstand.getHeight()+0.41):(armorstand.getHeight()-0.3)),
|
//pointLocator.vec.y - ((!interactable && targetBlock == null)?0.41f:((targetBlock==null)?(armorstand.getHeight()+0.41):(armorstand.getHeight()-0.3))),
|
||||||
|
pointLocator.vec.y + yoffset,
|
||||||
pointLocator.vec.z,
|
pointLocator.vec.z,
|
||||||
(float)pointLocator.yaw,
|
(float)pointLocator.yaw,
|
||||||
(float) pointLocator.pitch
|
(float) pointLocator.pitch
|
||||||
|
|||||||
Reference in new issue
Block a user