From 849ff4519a535f2bcd9dd8eae81d3e2efe92d12d Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 4 Feb 2019 23:12:12 +0200 Subject: [PATCH] Changed block placement rules for clouds --- .../unicopia/block/ICloudBlock.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/block/ICloudBlock.java b/src/main/java/com/minelittlepony/unicopia/block/ICloudBlock.java index b2cf6100..c0a65277 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/ICloudBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/ICloudBlock.java @@ -1,6 +1,7 @@ package com.minelittlepony.unicopia.block; import com.minelittlepony.unicopia.CloudType; +import com.minelittlepony.unicopia.Predicates; import com.minelittlepony.unicopia.UClient; import com.minelittlepony.unicopia.forgebullshit.FUF; @@ -30,6 +31,8 @@ public interface ICloudBlock { return true; } + CloudType type = getCloudMaterialType(state); + ItemStack main = player.getHeldItemMainhand(); if (main.isEmpty()) { main = player.getHeldItemOffhand(); @@ -38,16 +41,19 @@ public interface ICloudBlock { if (!main.isEmpty() && main.getItem() instanceof ItemBlock) { Block block = ((ItemBlock)main.getItem()).getBlock(); - if (block == null) { + if (block == null || block == Blocks.AIR) { return false; } - if (block instanceof BlockTorch && getCloudMaterialType(state) != CloudType.NORMAL) { - return false; + if (block instanceof BlockTorch) { + if (Predicates.INTERACT_WITH_CLOUDS.apply(player)) { + return type == CloudType.NORMAL; + } + return type != CloudType.ENCHANTED; } - if (block != Blocks.AIR && !(block instanceof ICloudBlock)) { - return true; + if (!(block instanceof ICloudBlock)) { + return type != CloudType.ENCHANTED; } } }