jhuckaby / magic-sorting-system

A data pack for Minecraft 1.13, 1.14 and 1.15 (Java) for automatically sorting every item in the game.
39 stars 15 forks source link

Chests disappearing #4

Closed k4ps closed 4 years ago

k4ps commented 5 years ago

Hi there. Absolutely love the data packs.

It works like a charm with one exception. I seem to be loosing chests. I put them in the system by dropping them onto the lapis block like this 2018-12-04_15 43 31

They then get sent to item frames that are arranged like the ones on the left (the arrangement on the right is an earlier design). 2018-12-04_15 42 07 From there its only hoppers and chests.

Now, when I put chests to be sorted, most arrive. But i noticed that some go missing. So I tested it and filled the Input chest full with Stack of chests. 2018-12-04_15 48 10

That's the amount that arrived. I only noticed this behaviour with chests through. Nothing else gets lost. Any idea why this could be?

The version is 1.13.2 btw.

jhuckaby commented 5 years ago

Hello, and thank you!

Ah yes, so this is actually kind of "as designed". The sorting system is designed so that you drop off all your items in the magic chest, then break the chest (so all the items become entities and can be teleported). But a new chest is created automatically in place of the old one, so in order to clean this up and not "give" you a free chest each time, I have to "delete" exactly 1 chest entity every time the sorting system is activated, a microsecond before the items are teleported. It's this line of code here, in sort.mcfunction line 7:

execute at @s unless score #mss_cooldown mss_cooldown matches 1 run kill @e[limit=1,sort=nearest,type=item,nbt={Item:{id:"minecraft:chest",Count:1b}}]

Looking at your screenshot, I think the problem may be that you're using a bare controller for farms, i.e. one without a chest. Those types of controllers are meant specifically for farms, i.e. to collect items like mob drops or crops, and not really chests. Chests are kinda special :)

I can't think of an easy way to fix this, but if you are only going to use a bare controller in your world and never a chest one, you can just edit the sort.mcfunction file and remove or comment out line 7.

I know, that's a lame solution. I'll try to think of a better way to implement this in the next major release. I'll mark this as a bug and leave it open.

Thanks for the issue report!

k4ps commented 5 years ago

Thanks for the answer. I'm gonna comment out the line. We're only using bare controller on our small server, since it's apparantly a hassle for some to destroy the chest every time.

Plus, when you forget to destroy the chest and something gets sorted by a bare controller, the conten of the chest is deleted.

jhuckaby commented 5 years ago

Plus, when you forget to destroy the chest and something gets sorted by a bare controller, the conten of the chest is deleted.

Ah ha, that's yet another bug! I will add that as a separate GitHub issue, thank you!

jhuckaby commented 4 years ago

This should be fixed in v2.0.0 now, if you craft an auto-drop chest with a redstone clock.

Note that 2.0.0 is a major release, and much has changed. Specifically, there is no longer a chest that replaces itself. See the Upgrading from v1.0 section for details.