Skip to content

Commit

Permalink
Only call a JavaScript renderer when the render type of the block is …
Browse files Browse the repository at this point in the history
…set to -1
  • Loading branch information
zhuowei committed Apr 26, 2014
1 parent fb31dd5 commit 686f5dc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions jni/modscript_nextgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,19 @@ void bl_RakNetInstance_connect_hook(RakNetInstance* rakNetInstance, char const*
}

void bl_TileRenderer_tesselateInWorld_hook(void* tileRenderer, Tile* tile, int x, int y, int z) {
bl_TileRenderer_instance = tileRenderer;

int blockId = tile->id;
if (bl_custom_block_renderShape[blockId] != -1) {
bl_TileRenderer_tesselateInWorld_real(tileRenderer, tile, x, y, z);
return;
}
JNIEnv *env;

int attachStatus = bl_JavaVM->GetEnv((void**) &env, JNI_VERSION_1_2);
if(attachStatus == JNI_EDETACHED) {
bl_JavaVM->AttachCurrentThread(&env, NULL);
}

bl_TileRenderer_instance = tileRenderer;

int blockId = tile->id;

// Don't allow PREVENT_DEFAULT_STATUS to be invoked, as it would nuke all block rendering in the game
jmethodID mid = env->GetStaticMethodID(bl_scriptmanager_class, "blockRendererCallback", "(IIII)V");
Expand Down

1 comment on commit 686f5dc

@ljqloveyou123
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Download these repositories:
git clone [email protected]:zhuowei/aFileChooser.git
git clone [email protected]:zhuowei/BlockLauncher-app.git
git clone https://github.com/Chainfire/libsuperuser.git

Hi great god, and do this step, the second site where open don't..What do I need to call the library, please~~~~

Please sign in to comment.