New Duplicator 1.6.2 | Now on BL Glass

Author Topic: New Duplicator 1.6.2 | Now on BL Glass  (Read 191721 times)

Obviously when I said final patch I meant this one...


Version 1.6.1
•  Fixed preferences not being registered
•  Fixed supercut modifying dead bricks

Use the automatic updater if you can, otherwise download again from the first page.
If the updater does not show an update, run this command: Updater.checkForUpdates();



An once again I found an issue with your add-on with my Apartment add-on. In this case it's about planting. I saw in your classes/server/selection.cs on line 2536-2550 you're forcing the onLoadPlant. I don't see the reason for why you would do that.

The bug that therefore comes up is that my add-on will then check for apartment and set the owner on the brick that owns the apartment as that should only be done when you load a save.

I don't really know how I would be able to work around this without hacking your code as you hack the load system.

it's also my brother's birthday today :o

I saw in your classes/server/selection.cs on line 2536-2550 you're forcing the onLoadPlant. I don't see the reason for why you would do that.

Because other mods are not supposed to initialize these bricks like they do for manually placing one.
I don't want anything adding door events, setting the item for a bot spawn, zones disabling rendering, etc.

Calling onLoadPlant means that this brick will get all properties set from whatever "loaded" it, and should not be modified like that.


The bug that therefore comes up is that my add-on will then check for apartment and set the owner on the brick that owns the apartment as that should only be done when you load a save.

Not sure what this means.

Because other mods are not supposed to initialize these bricks like they do for manually placing one.
I don't want anything adding door events, setting the item for a bot spawn, zones disabling rendering, etc.

Calling onLoadPlant means that this brick will get all properties set from whatever "loaded" it, and should not be modified like that.

I may have misunderstood what that function is all about. I thought it was used when you load a save, and only when you're doing so. Not when you plant the brick. Would you know an alternative for loaded bricks?

Not sure what this means.
Player A plants a plate and events it so Player B have the ownership of the apartment on it. Player B may then place and edit bricks on that Player A's plate. Player C have trust with Player B and can therefore plant his bricks on Player A's plate. This works alright while planting normally.

When loading a save, each brick have its onLoadPlant called and when a brick finds out that it's loaded on top of Player A's plate which contains the event set for apartment owner Player B, it will therefore set all bricks right above the plate to Player B. The rest of the bricks will automatically be set to Player B due to how the loading system works.

However, when using the New Duplicator, it should work so you can duplicate and place them right on Player A's plate and then set them to the player planting the brick. In this case, as you call onLoadPlant, if Player C plant his brick on Player A's plate, the ownership of the bottom brick planted will go to Player B and not Player C as it should.

As mentioned above, would you know a better way to handle this?

I may have misunderstood what that function is all about. I thought it was used when you load a save, and only when you're doing so. Not when you plant the brick. Would you know an alternative for loaded bricks?

Well, originally that's all it was used for. But ask yourself, why are there even two functions?
I figured it's a way to tell other mods "don't mess with this brick like you normally do"


However, when using the New Duplicator, it should work so you can duplicate and place them right on Player A's plate and then set them to the player planting the brick. In this case, as you call onLoadPlant, if Player C plant his brick on Player A's plate, the ownership of the bottom brick planted will go to Player B and not Player C as it should.

Dup always sets %brick.client to a valid object before calling plant, but default loading sets it to -1. So you could tell them apart that way.

Well, originally that's all it was used for. But ask yourself, why are there even two functions?
I figured it's a way to tell other mods "don't mess with this brick like you normally do"

When I worked with RP Content, onLoadPlant didn't even exists, but I needed such functionality. I used it to determine when the server was loading and then just plant the bricks, while when I planted it manually I checked if you have permission to plant the brick. Because when it's already planted, you don't need to check those permissions when you load the save. Therefore, I need to check when you load the brick so the bricks belongs to the right owner.

Dup always sets %brick.client to a valid object before calling plant, but default loading sets it to -1. So you could tell them apart that way.
This might be the solution. Sorry for asking for so much about this. But I got myself to blame when I came up with this hacky system.

Noedit: I tested it found it working. Thank you once again.

I haven't played Blockland myself in quite awhile. Recently decided to look at the new add-ons to see how far it's come. I am honestly not disappointed.

I haven't gotten around testing my fix yet as I require at least one more cooperative player on my server.
i just open more blocklands and connect to my own server

i just open more blocklands and connect to my own server
In this case I needed two independent bl_ids with the ability to enable and disable trust with each other.

In this case I needed two independent bl_ids with the ability to enable and disable trust with each other.

I'm probably late, but do you need a guinea pig?

I'm probably late, but do you need a guinea pig?

I think it is the wrong place to ask it, as this is not my thread. But I think this should answer your question:

Code: (Changelog) [Select]
Added support for Trust system.
Added compatibility code for New Duplicator.