Changed block placement rules for clouds

This commit is contained in:
Sollace 2019-02-04 23:12:12 +02:00
parent e6c0e4c14e
commit 849ff4519a

View file

@ -1,6 +1,7 @@
package com.minelittlepony.unicopia.block; package com.minelittlepony.unicopia.block;
import com.minelittlepony.unicopia.CloudType; import com.minelittlepony.unicopia.CloudType;
import com.minelittlepony.unicopia.Predicates;
import com.minelittlepony.unicopia.UClient; import com.minelittlepony.unicopia.UClient;
import com.minelittlepony.unicopia.forgebullshit.FUF; import com.minelittlepony.unicopia.forgebullshit.FUF;
@ -30,6 +31,8 @@ public interface ICloudBlock {
return true; return true;
} }
CloudType type = getCloudMaterialType(state);
ItemStack main = player.getHeldItemMainhand(); ItemStack main = player.getHeldItemMainhand();
if (main.isEmpty()) { if (main.isEmpty()) {
main = player.getHeldItemOffhand(); main = player.getHeldItemOffhand();
@ -38,16 +41,19 @@ public interface ICloudBlock {
if (!main.isEmpty() && main.getItem() instanceof ItemBlock) { if (!main.isEmpty() && main.getItem() instanceof ItemBlock) {
Block block = ((ItemBlock)main.getItem()).getBlock(); Block block = ((ItemBlock)main.getItem()).getBlock();
if (block == null) { if (block == null || block == Blocks.AIR) {
return false; return false;
} }
if (block instanceof BlockTorch && getCloudMaterialType(state) != CloudType.NORMAL) { if (block instanceof BlockTorch) {
return false; if (Predicates.INTERACT_WITH_CLOUDS.apply(player)) {
return type == CloudType.NORMAL;
}
return type != CloudType.ENCHANTED;
} }
if (block != Blocks.AIR && !(block instanceof ICloudBlock)) { if (!(block instanceof ICloudBlock)) {
return true; return type != CloudType.ENCHANTED;
} }
} }
} }