X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavedroid%2Fgame%2FGameItems.java;h=370f1b0081367e6d601100cf7b630576f1091fcd;hb=1c004c0ce7e183e773b5b486295c25e39732e899;hp=7cf525263a52dec4c252f87d6e91129b45ada223;hpb=476b65903ad1082a1847eb2a8076ab1039358790;p=cavedroid.git diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameItems.java b/core/src/ru/deadsoftware/cavedroid/game/GameItems.java index 7cf5252..370f1b0 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/GameItems.java +++ b/core/src/ru/deadsoftware/cavedroid/game/GameItems.java @@ -14,6 +14,7 @@ import ru.deadsoftware.cavedroid.misc.Assets; import ru.deadsoftware.cavedroid.misc.utils.AssetLoader; import ru.deadsoftware.cavedroid.misc.utils.SpriteOrigin; +import java.io.FileInputStream; import java.util.*; public class GameItems { @@ -54,12 +55,6 @@ public class GameItems { return getBlock(id) instanceof Block.Slab; } - public static boolean fluidCanFlowThere(int thisId, int thatId) { - return thatId == 0 || (!getBlock(thatId).hasCollision() && !isFluid(thatId)) || - (isWater(thisId) && isWater(thatId) && thisId < thatId) || - (isLava(thisId) && isLava(thatId) && thisId < thatId); - } - public static Block getBlock(int id) { return blocks.getValueAt(id); } @@ -147,6 +142,7 @@ public class GameItems { int id = Assets.getIntFromJson(block, "id", count); int dropCount = Assets.getIntFromJson(block, "drop_count", 1); String fullBlock = Assets.getStringFromJson(block, "full_block", null); + int state = Assets.getIntFromJson(block, "state", 0); blocksIds.put(key, id); if (count >= id) { @@ -177,8 +173,8 @@ public class GameItems { ); Block newBlock = switch (meta) { - case "water" -> new Block.Water(params, 5); - case "lava" -> new Block.Lava(params, 5); + case "water" -> new Block.Water(params, state); + case "lava" -> new Block.Lava(params, state); case "slab" -> new Block.Slab(params, fullBlock); default -> new Block.Normal(params); };