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;
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;
}
}
}