Prison 3

Prison 3

191k Downloads

Block Damage value not saving.

LarsVandenberghe opened this issue · 8 comments

commented

Which module are you submitting this issue for?

Mines

Describe the issue you are experiencing.

When you create a mine with a block such as diorite, andesite etc. the mines work, but after restarting the server and resetting the mines, all blocks turn into stone. They loose their block damage value. This also happens with colored blocks. I saw that the blocks are stored in json files having the mine name. There is no space for a block damage value.

Describe the steps to reproduce the problem.

Create a mine. Then fill the mine with blocks like this:
/mines block add [mineName] pdiorite 100
Then restart the server.
Once restarted do /mines reset [mineName]

Anything else we need to know?

Store the blockdamage value into the json file.

commented

Hey maybe this helps you out.
I have been looking through the source code and saw you save the data in the Mine class.

At line 132 you do this:

blockStrings.add(block.type.getId() + "-" + block.chance);

Maybe you can add the following code in there?

String.valueOf((short)block.getData())

At line 99
You could add the value and pass it through the block class

commented

Will look into this. Slated for v3.1.2.

commented

This would be a breaking change and would not be ideal. We had a breaking change in v3.1.1 that required that end users delete their existing player files to even get prison to start, which of course is far from ideal.

Also if you are using block types like 1:1 or stone:1, Mojang has removed support for these and so has Prison.

commented

@DylanFPS
Does that mean you are going to look for another way to fix it? For example using custom names. In the file (there is a csv with names already) or are you removing those blocks entirely?

commented

I'm sure I can tamper with the ItemManager, but I need to know the exact command you are typing to reproduce the problem and debug the plugin against it

commented

Oh okay, so first off our server is running spigot 1.8 since most plugins are not actively being updated to higher versions. < Thats what the owner claims, I have no choice here.
Make the mine:
/mines wand
select a region
/mines Demo
/mines block add Demo pdiorite 100
/mines reset Demo
restart server
/mines reset Demo
pdiorite should be turned into stone

commented

I run a 1.12.2 server, having the same issue as Lars, and can replicate this issue via the same method. Any block with a data tag has not been saving correctly; upon rebooting the server, the first mine reset would always remove the data value, no matter how it was entered. If you don't restart the server ever, however, /mines reset will work just fine.

commented

This ticket has been closed. If you have any other issues please open a new ticket.