X-Git-Url: https://deadsoftware.ru/gitweb?p=cavedroid.git;a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavedroid%2Fgame%2FGameItems.java;h=c3e020791570a456bf906f41165d8a76cb654171;hp=bd0e5bb1dcd90f2788e7b2bd15f47ac9da3fed3e;hb=793c88f81ae273b531dcdea267e1720c6878cc95;hpb=2e5cf197472693ffd66a7f1bb0bea2da98cf63e1 diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameItems.java b/core/src/ru/deadsoftware/cavedroid/game/GameItems.java index bd0e5bb..c3e0207 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/GameItems.java +++ b/core/src/ru/deadsoftware/cavedroid/game/GameItems.java @@ -35,6 +35,12 @@ public class GameItems { return getBlock(id).getMeta().equals("slab"); } + public static boolean fluidCanFlowThere(int thisId, int thatId) { + return thatId == 0 || (!getBlock(thatId).hasCollision() && !isFluid(thatId)) || + (isWater(thisId) && isWater(thatId) && thatId >= thisId) || + (isLava(thisId) && isLava(thatId) && thatId >= thisId); + } + public static Block getBlock(int id) { return blocks.getValueAt(id); }