From 8090c13cde2d61a0330f1e262de7526318a0965d Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 15 Mar 2013 20:18:11 +0000 Subject: Huge performance boost in blockhandlers, they have direct access to chunk data when blockchecking. Also fixed vines' placement. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1278 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Vine.h | 69 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 35 insertions(+), 34 deletions(-) (limited to 'source/Vine.h') diff --git a/source/Vine.h b/source/Vine.h index 77fc554d7..7abf3992b 100644 --- a/source/Vine.h +++ b/source/Vine.h @@ -1,41 +1,42 @@ + #pragma once -class cVine // tolua_export -{ // tolua_export + + + + +// tolua_begin +class cVine +{ public: - static NIBBLETYPE DirectionToMetaData( char a_Direction ) // tolua_export - { // tolua_export - switch (a_Direction) + static NIBBLETYPE DirectionToMetaData(char a_BlockFace) + { + switch (a_BlockFace) { - case 0x2: - return 0x1; - case 0x3: - return 0x4; - case 0x4: - return 0x8; - case 0x5: - return 0x2; - default: - return 0x0; - }; - } // tolua_export - - static char MetaDataToDirection(NIBBLETYPE a_MetaData ) // tolua_export - { // tolua_export + case BLOCK_FACE_NORTH: return 0x1; + case BLOCK_FACE_SOUTH: return 0x4; + case BLOCK_FACE_WEST: return 0x8; + case BLOCK_FACE_EAST: return 0x2; + default: return 0x0; + } + } + + + static char MetaDataToDirection(NIBBLETYPE a_MetaData) + { switch(a_MetaData) { - case 0x1: - return 0x2; - case 0x4: - return 0x3; - case 0x8: - return 0x4; - case 0x2: - return 0x5; - default: - return 0x1; - }; - } // tolua_export - -}; // tolua_export + case 0x1: return BLOCK_FACE_NORTH; + case 0x4: return BLOCK_FACE_SOUTH; + case 0x8: return BLOCK_FACE_WEST; + case 0x2: return BLOCK_FACE_EAST; + default: return BLOCK_FACE_TOP; + } + } +} ; +// tolua_end + + + + -- cgit v1.2.3