add CoordinateOffset integration#453
Conversation
| import com.jtprince.coordinateoffset.api.CoordinateOffset; | ||
| import com.jtprince.coordinateoffset.adapter.OffsetPlayer; | ||
|
|
||
| public class CoordinateOffsetPlayerProperties implements Property { |
There was a problem hiding this comment.
this is old way of registering properties, should use the new system, example here: https://github.com/DenizenScript/Depenizen/pull/418/changes
|
|
||
| public void registerCoreBridges() { | ||
| // Yes it needs to be `new MyBridge()` not `MyBridge::new` - this is due to an error in the Java runtime. | ||
| registerBridge("CoordinateOffset", () -> new CoordinateOffsetBridge()); |
There was a problem hiding this comment.
Should be sorted alphabetically.
| <dependency> | ||
| <groupId>com.jtprince</groupId> | ||
| <artifactId>CoordinateOffset</artifactId> | ||
| <version>6.1.8-SNAPSHOT</version> | ||
| <scope>system</scope> | ||
| <systemPath>${project.basedir}/lib/CoordinateOffset.jar</systemPath> | ||
| </dependency> |
There was a problem hiding this comment.
While this is technically after BigDoors alphabetically, it's also at the very end of the plugin list and should probably be moved.
There was a problem hiding this comment.
{project.basedir} can also be shortened to just {basedir}
| import com.denizenscript.depenizen.bukkit.Bridge; | ||
| import com.denizenscript.depenizen.bukkit.properties.coordinateoffset.CoordinateOffsetPlayerProperties; | ||
|
|
||
| public class CoordinateOffsetBridge extends Bridge { |
There was a problem hiding this comment.
The addition of a new plugin should also be added to https://github.com/DenizenScript/Depenizen/blob/master/Docs/BukkitPlugins.md and https://github.com/DenizenScript/Depenizen/blob/master/src/main/resources/plugin.yml
- refactor `CoordinateOffset` to use `PropertyExtension` and match the consistent new style
| // Returns the player's current coordinate offset as a LocationTag (x, y, z). | ||
| // --> | ||
| PlayerTag.tagProcessor.registerTag(LocationTag.class, "coordinate_offset", (attribute, player) -> { | ||
| if (!player.isOnline()) { |
There was a problem hiding this comment.
can use registerOnlineOnlyTag method instead
- remove manual `!player.isOnline()` check - resort code - add `CoordinateOffset` to `softdepend` list in `plugin.yml` and `Docs/BukkitPlugins.md` alphabetrically
| // Returns the player's current coordinate offset as a LocationTag (x, y, z). | ||
| // --> | ||
| PlayerTag.registerOnlineOnlyTag(LocationTag.class, "coordinate_offset", (attribute, player) -> { | ||
| OffsetPlayer offsetPlayer = CoordinateOffset.api().adaptPlayer(player.getPlayerEntity()); |
There was a problem hiding this comment.
Since this is used multiple times, you could create a separate static method to get it.
Summary
this adds a new bridge for the
CoordinateOffsetplugin, allowing users to change a player's visualY-axisoffset; this enables creative impossible space black magic and cinematic rendering effects by detaching the client's rendered position from the server's physical position.Prerequisites / Notes
this bridge is designed to utilize the
Y-axisobfuscation logic proposed in CoordinateOffset PR #45; while this bridge will function correctly forXandZoffsets with the current plugin release,Y-axismanipulation will be inactive until the parent pull request #45 is mergedChanges
CoordinateOffsetBridgeto establish the hook into theCoordinateOffsetAPICoordinateOffsetPlayerPropertiesto addthePlayerTag.coordinate_offsettag and mechanism pairDepenizen.javato register the new bridgesystemPathdependency topom.xmlTesting
CoordinateOffsetPlayerTag.coordinate_offsetmechanism to test, like a visual shift:/ex adjust <player> coordinate_offset:0,-64,0Known Limitations
this implementation operates strictly at the packet layer for visual obfuscation; it does not synchronize server-side physics (eg, gravity/collision/walking/etc) with the obfuscated rendering. this feature is primarily intended for cinematic, creative, or flying/noclip use cases