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 better valid block combination detection heuristics [was: BC facades crashes with RotaryCraft] #2175

Closed
huttup opened this issue Nov 7, 2014 · 8 comments
Assignees

Comments

@huttup
Copy link

huttup commented Nov 7, 2014

Hi

There is a problem when BuildCraft tries to create facades for RotaryCraft mod. The game crashes when entering /gamemode 1 and hitting the search button

http://pastebin.com/ny48FQE5

Tried to use the newly released 6.1.7 version which had a bug fix related to facades, but still get the same error as I have gotten with the earlier versions I have tried.

@asiekierka
Copy link
Member

We know very well, however, this is most likely a bug in RotaryCraft. Try blacklisting RotaryCraft blocks in the facade blacklist in buildcraft/main.conf

@huttup
Copy link
Author

huttup commented Nov 7, 2014

I have tried to blacklist the RotaryCraft blocks, but get the same result. Another user have also tried to blacklist RotaryCraft with no luck http://mod-buildcraft.com/forums/index.php?topic=1086.0

Are we blacklisting wrong? Do you have any insight to how to formulate the blacklisting line?

Users are also on Reika's thread on Minecraftforum.net forums asking for help regarding this problem. http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1291655-reikas-mods-tech-worldgen-civilization-and-more?page=676

@ReikaKalseki
Copy link
Contributor

No, it is not an RC bug. BC is trying to create facades for metadatas that do not exist, and then when trying to fetch the name of the block, which is pulled from an array, it throws an OOB. The only way to "fix" this would be to pad all name arrays with 8-15 empty strings so that they all have 16 entries, something I am not going to do.

The real fix for this is something in the BC code for detecting how many metadata states of a block actually exist.

@asiekierka
Copy link
Member

@ReikaKalseki - yes, I know the real fix is detecting all the existing metadata states, but how do you propose to do that? getSubBlocks() is NOT enough, as some blocks can be rotated. Checking all possible functions for NPEs is not a true valid option, either. I cannot use getIcon() either, as the facade registration code also has to be called on the server.

@asiekierka asiekierka reopened this Nov 7, 2014
@asiekierka asiekierka changed the title BC facades crashes with RotaryCraft Add better valid block combination detection heuristics [was: BC facades crashes with RotaryCraft] Nov 7, 2014
@asiekierka asiekierka added this to the BuildCraft 6.1.8 milestone Nov 7, 2014
@asiekierka asiekierka self-assigned this Nov 7, 2014
@ReikaKalseki
Copy link
Contributor

This I am not entirely sure, but here are a few ideas that help, though they do not completely solve the problem, at least not soon:

  • Suggest something in Forge to make blocks have to specify the number of valid subtypes that exist - this may be obsolete in 1.8 with the BlockStates system
  • Add an interface to the BC API which the facade algorithm checks, allowing the block to return Collection<Integer> to know which states are valid
  • Try every block at runtime with each test within a try-catch, and cache the Block:Meta pairs that do not return errors, then only refer to those from then on

@asiekierka
Copy link
Member

@ReikaKalseki - what I did for now is go with the third solution. The first two will be obsolete in 1.8, and the fourth solution (which is what AE2 does) is what I plan to implement in BC 6.2.0: since registerValidFacades only creates all the facades necessary for creative tab viewing and recipes, I could just use getSubBlocks() and call it a day.

@ReikaKalseki
Copy link
Contributor

I would like some mod-level control as well; I have seen "bug" reports of "liquid chroma"/"jet fuel"/etc facades which, while not buggy, nonetheless look very broken.

@asiekierka
Copy link
Member

@ReikaKalseki - there is an IMC command, "blacklist-facade", taking an ItemStack, to do exactly that.

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

No branches or pull requests

3 participants