arpruss / raspberryjammod

Raspberry Jam Mod - a Mod Forge Minecraft mod implementing most of Raspberry Juice/Pi API
http://www.instructables.com/id/Python-coding-for-Minecraft/
Other
348 stars 94 forks source link

Request: add config to select Absolute or Relative position. #30

Closed eah123 closed 6 years ago

eah123 commented 6 years ago

I know that MC-Pi Edition defaults to relative position because the Spawn Point is (0,0,0). This results in the wrong coordinates in desktop editions unless you do /setworldspawn 0 0 0 to set the Spawn Point.

I see that the latest commit of raspberryjuice allows you to select relative or absolute position using a configuration file.

https://github.com/zhuowei/RaspberryJuice/tree/master/src/main/java/net/zhuoweizhang/raspberryjuice

Can you please add this functionality to raspberryjam? In the meantime, I removed the subtraction of the spawnpoint in Location.java to force absolute positions and then re-built.

Thanks

arpruss commented 6 years ago

Wouldn't that break a lot of the scripts online which assume that 0,0,0 is the spawn point?

eah123 commented 6 years ago

Almost all scripts are written relative to the player’s position, not relative to 0,0,0. The only concern would be if you were to try to build or teleport off the map. But this is not prevented by using relative position anyway.

eah123 commented 6 years ago

raspberryjammod.zip I think these changes do the trick.

Ellipse0934 commented 6 years ago

I agree with @eah123 . All scripts are relative to player position. It's way more convenient to use the coordinates reported by debug mode as one does not need to type any command to find their position.

arpruss commented 6 years ago

Added in 0.94.