예제 #1
0
 public static void registerAll() {
   for (ModBlocks block : ModBlocks.values()) {
     Block b = block.get();
     b.setLightLevel(1.0f);
     GameRegistry.registerBlock(b, block.getName());
   }
 }
예제 #2
0
 public BlockHandler setValues(float... sets) {
   switch (sets.length) {
     case 2:
       block.setLightLevel(sets[1]);
     case 1:
       block.setHardness(sets[0]);
       break;
   }
   return this;
 }
예제 #3
0
 /**
  * It is not recommended that you mess with lightValue yourself
  *
  * <p>Sets the lighting colors for a given block.
  *
  * @param block The block to set color on
  * @param r Red intensity, 0.0f to 1.0f. Resolution is 4 bits.
  * @param g Green intensity, 0.0f to 1.0f. Resolution is 4 bits.
  * @param b Blue intensity, 0.0f to 1.0f. Resolution is 4 bits.
  * @param lightValue The Minecraft brightness to set for the block, 0.0f to 1.0f.
  * @return Reference to the block passed in.
  */
 @Deprecated
 public static Block setBlockColorRGB(Block block, float r, float g, float b, float lightValue) {
   block.setLightLevel(((float) makeRGBLightValue(r, g, b, lightValue)) / 15F);
   return block;
 }
예제 #4
0
 /**
  * Sets the lighting colors for a given block. Vanilla brightness is recomputed.
  *
  * @param block The block to set color on
  * @param r Red intensity, 0.0f to 1.0f. Resolution is 4 bits.
  * @param g Green intensity, 0.0f to 1.0f. Resolution is 4 bits.
  * @param b Blue intensity, 0.0f to 1.0f. Resolution is 4 bits.
  * @return Reference to the block passed in.
  */
 public static Block setBlockColorRGB(Block block, float r, float g, float b) {
   block.setLightLevel(((float) makeRGBLightValue(r, g, b)) / 15F);
   return block;
 }