mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Changed block placement rules for clouds
This commit is contained in:
parent
e6c0e4c14e
commit
849ff4519a
1 changed files with 11 additions and 5 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue