mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-12 16:27:45 +00:00
Allow some blocks to be colored via the forge recolourBlock method
This commit is contained in:
1 parent
0064ec320d
commit
57f58c35da
3 files changed
+28
-2
No files matched your search
@@ -6,7 +6,7 @@ import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.carving.CarvableHelper;
|
||||
|
||||
public class BlockCarvableAntiBlock extends BlockCarvable implements ICarvable {
|
||||
public class BlockCarvableAntiBlock extends BlockCarvableColor implements ICarvable {
|
||||
|
||||
public CarvableHelper carverHelper;
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cricketcraft.chisel.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockCarvableColor extends BlockCarvable {
|
||||
|
||||
public BlockCarvableColor() {
|
||||
this(Material.rock);
|
||||
}
|
||||
|
||||
public BlockCarvableColor(Material m) {
|
||||
super(m);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int color) {
|
||||
int newColor = 15 - color;
|
||||
if (world.getBlockMetadata(x, y, z) != newColor) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, newColor, 3);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import com.cricketcraft.chisel.Chisel;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockCarvableGlow extends BlockCarvable {
|
||||
public class BlockCarvableGlow extends BlockCarvableColor {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon glowTexture;
|
||||
|
||||
Reference in new issue
Block a user