コード例 #1
0
 public void preRenderHeld(IModel model, IBlockState blockState, Block block) {
   colorMap = null;
   isSmooth = false;
   List<BlockStateMatcher> maps = ColorizeBlock.findColorMaps(block);
   if (maps != null) {
     for (BlockStateMatcher matcher : maps) {
       if (matcher.matchBlockState(blockState)) {
         colorMap = ColorizeBlock.getThreadLocal(matcher);
         break;
       }
     }
   }
 }
コード例 #2
0
 // public static methods requested by MamiyaOtaru for VoxelMap
 public static int getColorMultiplier(
     IBlockAccess blockAccess, IBlockState blockState, Position position, int defaultColor) {
   List<BlockStateMatcher> maps = ColorizeBlock.findColorMaps(blockState.getBlock());
   if (maps != null) {
     for (BlockStateMatcher matcher : maps) {
       if (matcher.matchBlockState(blockState)) {
         IColorMap colorMap = ColorizeBlock.getThreadLocal(matcher);
         return colorMap.getColorMultiplier(
             blockAccess, position.getI(), position.getJ(), position.getK());
       }
     }
   }
   return defaultColor;
 }
コード例 #3
0
 public static void reset() {
   try {
     grassBlock = BlockAPI.getFixedBlock("minecraft:grass");
     mycelBlock = BlockAPI.getFixedBlock("minecraft:mycelium");
     ColorizeBlock.reset();
   } catch (Throwable e) {
     e.printStackTrace();
   }
 }
コード例 #4
0
 public void preRender(
     IBlockAccess blockAccess,
     IModel model,
     IBlockState blockState,
     Position position,
     Block block,
     boolean useAO) {
   colorMap = null;
   useCM = RenderPassAPI.instance.useColorMultiplierThisPass(block);
   if (useCM) {
     List<BlockStateMatcher> maps = ColorizeBlock.findColorMaps(block);
     if (maps != null) {
       for (BlockStateMatcher matcher : maps) {
         if (matcher.matchBlockState(blockState)) {
           colorMap = ColorizeBlock.getThreadLocal(matcher);
           break;
         }
       }
     }
   }
   isSmooth = false;
 }