mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Items dropped by a pegasus onto cloud blocks should not fall through. This also has some... interesting behavioural quirks.
This commit is contained in:
parent
a520e799dc
commit
3d02ee6856
2 changed files with 13 additions and 1 deletions
|
@ -66,6 +66,10 @@ public enum CloudType implements IStringSerializable {
|
|||
}
|
||||
|
||||
public boolean canInteract(Entity e) {
|
||||
if (e == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this == ENCHANTED) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import net.minecraft.block.BlockTorch;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
@ -54,7 +55,14 @@ public interface ICloudBlock {
|
|||
}
|
||||
|
||||
default boolean getCanInteract(IBlockState state, Entity e) {
|
||||
return getCloudMaterialType(state).canInteract(e);
|
||||
if (getCloudMaterialType(state).canInteract(e)) {
|
||||
if (e instanceof EntityItem) {
|
||||
e.setNoGravity(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
default boolean isDense(IBlockState blockState) {
|
||||
|
|
Loading…
Reference in a new issue