GnaspGames / Smelt

A CLI tool for Minecraft map makers
http://smelt.gnasp.com
MIT License
19 stars 4 forks source link

Issue with conditional cmd blocks when changing direction #35

Closed GnaspGames closed 8 years ago

GnaspGames commented 8 years ago

An issue has been noticed with how Smelt changes the direction of command blocks. When a command block is conditional, this breaks the conditional logic.

Example: http://i.imgur.com/PjQLZT7.png

Workaround: Users can insert their own blank commands to push the chain of blocks 'around the corner' before the conditional chain is placed. I would prefer it if Smelt could do something to 'fix' this scenario.

There is one known solution that I've tested, which involves inserting generated command blocks when the direction is changed, and the one before the conditional block then uses /blockdata to try and reset the SuccessCount of the previous command. This will fail if the previous command failed (is already 0) and will succeed if the previous command succeeded (it was 1, so we could reset to 0).

Example: http://imgur.com/a/0EqFk

There may be issues with this that need considering. Could this affect other commands or use cases?

It might be possible to also solve this using /stats block but that would require a custom entity and scoreboard objective as well. Which means that the map maker would HAVE to install a module into their world to allow for this type of fix (or the generated code would have to EACH TIME).

I'm going to think about this some more.

GnaspGames commented 8 years ago

I'm going to be using features from #12 to help fix this; so my focus is on that now.

GnaspGames commented 8 years ago

Skaran pointed out that the /testforblock command would be able to do something simular to /blockdata without resetting the SuccessCount.

testforblock ? ? ? minecraft:chain_command_block -1 {SuccessCount:1}

However, the correct command block type would have to be used,

In feature #12 I will hopefully be making it possible to know what the last command block coords and type are. This should make this possible.

GnaspGames commented 8 years ago

Hopefully b876dea will fix this issue. I want to rewrite some code after this; but this will do for now.

GnaspGames commented 8 years ago

Closed with version 0.9.3