mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 02:45:13 +00:00
Prevent paint lens from painting blocks illegal colors
This commit is contained in:
1 file changed
+2
-1
@@ -71,7 +71,8 @@ public class LensPaint extends Lens {
|
||||
EnumDyeColor placeColor = EnumDyeColor.byMetadata(storedColor == 16 ? entity.worldObj.rand.nextInt(16) : storedColor);
|
||||
IBlockState stateThere = entity.worldObj.getBlockState(coords);
|
||||
|
||||
if(stateThere.getValue(BotaniaAPI.paintableBlocks.get(block)) != placeColor) {
|
||||
if(stateThere.getValue(BotaniaAPI.paintableBlocks.get(block)) != placeColor
|
||||
&& BotaniaAPI.paintableBlocks.get(block).getAllowedValues().contains(placeColor)) {
|
||||
entity.worldObj.setBlockState(coords, stateThere.withProperty(BotaniaAPI.paintableBlocks.get(block), placeColor), 2);
|
||||
int hex = placeColor.getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
|
||||
Reference in new issue
Block a user