Свалки у дорог: бочки серые/синие/красные и ящики еды как блоки, лут по детерминированным таблицам, синие на кольце дают продвинутые фрагменты

This commit is contained in:
sasheg dev
2026-10-23 07:50:22 +03:00
parent 07ed4ce02d
commit 5b81db7c39
8 changed files with 602 additions and 3 deletions
@@ -33,9 +33,17 @@ public final class Blocks {
/** The surface of the high and cold places. */
public static final byte SNOW = 9;
/** A barrel that may be broken for what is in it. */
public static final byte BARREL = 10;
public static final byte BARREL_BLUE = 11;
public static final byte BARREL_RED = 12;
/** A wooden box of food, standing with the barrels. */
public static final byte CRATE = 13;
/** Lowest and highest legal block id. */
public static final byte MIN = AIR;
public static final byte MAX = SNOW;
public static final byte MAX = CRATE;
private Blocks() {
}
@@ -52,6 +60,10 @@ public final class Blocks {
case LEAVES: return "leaves";
case ASPHALT: return "asphalt";
case SNOW: return "snow";
case BARREL: return "barrel";
case BARREL_BLUE: return "barrel_blue";
case BARREL_RED: return "barrel_red";
case CRATE: return "crate";
default: return "unknown(" + id + ")";
}
}
@@ -66,6 +78,18 @@ public final class Blocks {
return id == AIR || id == WATER;
}
/**
* True when breaking it gives what is inside instead of nothing.
*
* The barrels and the crates are the loot of the roads: a broken one
* empties its content into the hands of whoever broke it, whatever the
* game mode says.
*/
public static boolean isLootable(byte id) {
return id == BARREL || id == BARREL_BLUE || id == BARREL_RED
|| id == CRATE;
}
public static boolean isValid(byte id) {
return id >= MIN && id <= MAX;
}
@@ -178,8 +178,9 @@ public final class ItemRegistry {
define(ItemType.of(HIGH_QUALITY_METAL, "High Quality Metal").rid("hqm"));
define(ItemType.of(SULFUR, "Sulfur Ore").rid("sulfur_ore"));
define(ItemType.of(SCRAP, "Scrap").rid("scrap"));
// The fragments of the blueprints. The remake does not know them: they
// come out of the loot crates, and the crates are still to come.
// The fragments of the blueprints. They come out of the blue barrels
// of the junk piles on the roads, and the advanced ones out of the
// barrels on the ring road.
define(ItemType.of(BASIC_FRAGMENT, "Basic Blueprint Fragment"));
define(ItemType.of(ADVANCED_FRAGMENT, "Advanced Blueprint Fragment"));
define(ItemType.of(METAL_PIPE, "Metal Pipe").rid("metalpipe"));