Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to create a formatted interactive book and place in chest #60

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

timcu
Copy link
Contributor

@timcu timcu commented Sep 1, 2017

This pull request allows user to create a formatted interactive book (instructions and examples in book.py). The book can be added to a chest using mc.addBookToChest(x,y,z,book). The API sends the book as JSON to spigot server giving lots of flexibility and future proofing.
There is a new test demonstrating creation of a book in Test.py.
Pull request includes a small upgrade to signs where commas and parentheses are no longer translated to other characters but escaped and unescaped throught the api. I would recommend escaping player names also as the api will break if player names contain commas or parentheses.

timcu added 3 commits August 31, 2017 14:18
Escape parentheses, commas, section breaks, ampersands and new 
lines using & type html entities. This now works with signs and books.
Java plugin unescapes these characters so now they are preserved 
rather than translated.
Add test for book creation
Make entity test more compact so quicker
@timcu
Copy link
Contributor Author

timcu commented Nov 1, 2017

It would be great if this pull request could be incorporated in the 1.11 update. All commits apart from the last 3 were already included in pull request 59 so there are only 3 to look at.

@martinohanlon
Copy link
Collaborator

I will leave this till the next release. There is already a significant amount of change (and therefore risk of issues) in 1.11.

@martinohanlon
Copy link
Collaborator

I will make a candidate release in dev for v1.12 after I have done v1.11, by merging in this PR.

martinohanlon and others added 4 commits November 1, 2017 20:07
Position at y=100 to avoid damaging user's constructions at y=50
Make test position parameters of function
Make possible to choose which tests to run
Make clearArea clear complete area
Show progress when clearing area in case already clear
Show progress when running block test in case already created
Keep times slow to avoid server crash
Split stairs from inverted stairs to make clearer
Speed up dancing villager which shouldn't crash server
Allow entity test to run consecutively without crashing placing hangers
Reduce size of squid pool to reduce load on server
Reduce size of entity test platform
Update print(listOfBlocks) for python 3
@timcu
Copy link
Contributor Author

timcu commented Nov 8, 2017

OK. I have resolved conflicts between this and your dev branch. I have also taken opportunity to improve the tests. For some reason you had moved y location to 50 which is not a great place to run tests because it is underground. Tests were susceptible to falling water/lava/sand, were in the dark, and more likely to clobber user's constructions.
I understand what you are saying about server crashing although my server never crashed. Hopefully my changes make it less likely for server to crash. I have put in some moving glowstone blocks which act like a progress bar when there is nothing else obviously happening, eg clearing area when area previously cleared or creating blocks when blocks previously created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants