FancyBlockParticles icon indicating copy to clipboard operation
FancyBlockParticles copied to clipboard

FBP doesn't like Biomes O' Plenty! - Part 2.

Open Adahel opened this issue 7 years ago • 8 comments

Steps to reproduce issue:

FPB + Biomes O' Plenty: (Déjà vu) Already seen, Matrix! Something wrong is not right.

MC Version:

1.8.9

FBP Version:

2.4.1

Forge Version (e.g. 2604):

1.8.9-11.15.1.2318-1.8.9

http://openeye.openmods.info/crashes/17b9edd413ecb4114d2e9b9fda52a9e5

Adahel avatar Oct 28 '18 03:10 Adahel

The problem may be the "func_174845_l" method. In the vanilla in the variable "i" it calls "getRenderColor", but in the mod is calling "colorMultiplier". The bop override the "colorMultiplier" method and is causing problems by having variations of the same block (formerly metadata). In my test when I replace "colorMultiplier" per "getRenderColor", the game stops crashing, but I do not know what the "func_174845_l" method does. Another workaround was to prevent the mod from calling "colorMultiplier" from "BlockBOPPlant":

    int i;
    //The code only runs if BOP is loaded.
    if (Loader.isModLoaded("BiomesOPlenty"))
    {
    	if (sourceState.getBlock() instanceof BlockBOPPlant)
    	{
                //The variable "blockBOPPlant" is the instance of the "BlockBOPPlant" class. I did not use this variable, but it can be useful.
    		BlockBOPPlant blockBOPPlant = (BlockBOPPlant) sourceState.getBlock();
    		i = 0;
    	}
    	else
    	{
    		i = sourceState.getBlock().colorMultiplier(this.worldObj, new BlockPos(posX, posY, posZ));
    	}
    }
	else
	{
		i = sourceState.getBlock().colorMultiplier(this.worldObj, new BlockPos(posX, posY, posZ));
	}

In the second solution the game still crash, but by another class BOP also override "colorMultiplier": "BlockBOPLeaves".

Adahel avatar Oct 28 '18 07:10 Adahel

func_174845_l takes the current position of the particle, gets the block and lastly gets the color multiplier.

func_174846_a on the other hand has one parameter and that is the BlockPos that will be used to get the color multiplier.

I don't know where that piece of code you posted is from, but I hope this helps.

TominoCZ avatar Oct 28 '18 10:10 TominoCZ

The code I posted should be the last option. It is not a solution.

Adahel avatar Oct 28 '18 15:10 Adahel

I still don't understand the issue here.

TominoCZ avatar Oct 28 '18 16:10 TominoCZ

Replace the "colorMultiplier" method per "getRenderColor" here: https://github.com/TominoCZ/FancyBlockParticles/blob/master/src_1.8.9/main/java/com/TominoCZ/FBP/particle/FBPParticleDigging.java#L190

As in minecraft vanilla: The game did not crash after that minor change, solving the problem.

Adahel avatar Oct 28 '18 16:10 Adahel

The game crash, because of the method override: https://github.com/Glitchfiend/BiomesOPlenty/blob/BOP-1.8.9-3.0.x/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java#L305 The game not crash in this method: https://github.com/Glitchfiend/BiomesOPlenty/blob/BOP-1.8.9-3.0.x/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java#L290

Adahel avatar Oct 28 '18 17:10 Adahel

The problem is definitely Block Position, it looks like it is receiving invalid values. I made an algorithm that only calls "colorMultiplier" if Block State by position = "sourceState", else "getRenderColor" is called. To test the algorithm, set "i" = 16777215 so that the particles become gray. Hope this helps.

Adahel avatar Oct 28 '18 22:10 Adahel

Thanks, this will be fixed in version 2.4.2.

TominoCZ avatar Oct 29 '18 15:10 TominoCZ