Cheshire Cat Computing

Software support and information
It is currently Tue Oct 24, 2017 9:33 am

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Oct 01, 2015 11:27 am 
Offline
Silver User

Joined: Sun Sep 06, 2015 9:13 pm
Posts: 42
Hi,

this will be peculiar. When you copy a plan which contains command blocks and those commands place blocks relatively to the command block position with tilde ~ those relative coordinates are not rotated. I have included an example. (There is a button missing on one of the cobblestones on ground level to activate the command chain). When you place the example facing positive Z everything is fine. When you place it facing any other direction it messes up.

Thanks for your hard work.
Attachment:
File comment: Command chain
tmp.cfg [5.52 KiB]
Downloaded 86 times


Top
 Profile Send private message  
 
PostPosted: Fri Oct 02, 2015 11:41 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
Ouch. This would be very awkward to handle.

Yes, currently very little of the metadata in a Tile Entity is modified by rotation.

In v2.7, the rotation of Mobs (including minecarts and armour stands) is preserved and rotated, as is any entity with a 'Pos' and 'Rotation' attribute.

There is also a new provision (initially made for Carpenters Blocks addin) that allows you to (in the config file) specify a tile entity type, and a corresponding attribute and its rotation states. This is intended to handle custom blocks that hold their rotation in their tile entity. A separate rule allows you to define rotation states for custom blocks that hold their rotation state in their DV as with normal blocks.

The problem here is that command blocks have just a large text Command attribute, which would need to be parsed, any relative coordinates identified and modified and then a new command string generated. This would not be a simple procedure. This is made even more complex by rotations -- so "~3 0 ~" would rotate a quarter-turn to become "~ 0 ~-3" and it would be even more complex if you had something like "~2 0 0", not to mention for commands with multiple coordinate sets.

Commands to be affected would include blockdata, execute, fill, clone, particle, setitem, setblock, spawn, spawnpoint, stats, summon, testforblock, testforblocks, tp; I can see how many of these would be in common usage in many adventure structures and would need to rotate properly :(

I can see a way to eventually achieve it, but I hate writing string parsing in Java - I've been spolit by the easy functions in Perl...

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Sat Oct 03, 2015 6:40 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
I have a very rough piece of code that manages to do this, but only for certain commands.

In particular, it doesnt work for CLONE, TESTFORBLOCKS, some EXECUTE and custom commands. It also fails in odd cases where the X coordinate is relative and the Z is absolute...

However, it does work for the example cfg you posted above.

I have this in the 2.7 beta for MC1.8 at the moment. I'd let you have a copy but I think you use MC1.7.10, am I right?

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Sat Oct 03, 2015 10:53 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
Please test this beta: http://minecraft.curseforge.com/project ... ers-helper
Compiled for 1.7.10 and for 1.8
Java 1.8 only

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Mon Oct 05, 2015 11:27 am 
Offline
Silver User

Joined: Sun Sep 06, 2015 9:13 pm
Posts: 42
I use 1.7.10 and also 1.8 (MultiMC). Tested in 1.8 and works flawlessly for the gate (which is the only use of command blocks with the "fill" command at the moment). If I get around to use the command blocks for something else I'll report back. Thanks for your hard work.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 12 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group