austinv11 / PeripheralsPlusPlus

A pseudo-port of miscperipherals, with other stuff as well!
GNU General Public License v2.0
25 stars 28 forks source link

peripheral container Crafting not working #164

Open m10653 opened 8 years ago

m10653 commented 8 years ago

Description

peripheral container Crafting does not seem to work at all.

When trying to craft a peripheral into the peripheral container nothing happens. This happens in all crafting benches, default,inventory and modded.

This prevents any peripheral from being added to the container. ...

Erhannis commented 7 years ago

Hey, so I had the same problem and spent the last 9 hours debugging it. Looks like there were three problems:

  1. In ContainerRecipe.java, (ArrayUtils.indexOf(blacklist, block) == -1) ought to have been !=
  2. ContainerRecipe depended on IPeripheralProvider being implemented to mark which items on the crafting table were peripherals. In aug 2015, there was a refactoring which took IPeripheralProvider off the blocks which extended it, at which point ContainerRecipe no longer recognized any peripherals.
  3. Not all peripherals ever extended IPeripheralProvider, anyway, so some peripherals were never usable with the PeripheralContainer to begin with.

I've made some fixes (https://github.com/Erhannis/PeripheralsPlusPlus), but I feel like there's a better way of doing it.

  1. The first was a straightforward fix. 2/3. I've basically just put in a new empty interface (IPeripheralBlock) that marks the peripheral blocks the way IPeripheralProvider did before it was removed. It means the block peripherals can be contained, but the others still can't. I feel like there's probably a better way of identifying whether an item is a peripheral or not, than by an interface on an associated block (which don't exist for all peripherals). It doesn't help that I've done very little Minecraft modding, so I'm not clear on the distinction between tiles/items/blocks and which is used in the crafting table, etc.

Note that I've tested whether you can combine them in the crafting table, but not whether you can actually use them in a turtle; kindof assuming you can, for now.

Anyway, hope this helps somebody.

Also I hope this gets fixed better and more officially.