9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-06 15:52:03 +00:00

解决吃食物等行为与原版方块放置行为的冲突

This commit is contained in:
XiaoMoMi
2025-10-11 01:40:40 +08:00
parent bcd3648f2d
commit 725f0dadd2
11 changed files with 82 additions and 10 deletions

View File

@@ -44,6 +44,7 @@ public final class BlockKeys {
public static final Key DECORATED_POT = Key.of("minecraft:decorated_pot");
public static final Key CHISELED_BOOKSHELF = Key.of("minecraft:chiseled_bookshelf");
public static final Key LECTERN = Key.of("minecraft:lectern");
public static final Key FARMLAND = Key.of("minecraft:farmland");
public static final Key CHEST = Key.of("minecraft:chest");
public static final Key BARREL = Key.of("minecraft:barrel");

View File

@@ -0,0 +1,9 @@
package net.momirealms.craftengine.core.block;
import net.momirealms.craftengine.core.util.Key;
public final class BlockTagKeys {
private BlockTagKeys() {}
public static final Key DIRT = Key.of("minecraft:dirt");
}

View File

@@ -66,6 +66,13 @@ public final class ItemKeys {
public static final Key MAGENTA_DYE = Key.of("minecraft:magenta_dye");
public static final Key PINK_DYE = Key.of("minecraft:pink_dye");
public static final Key CARROT = Key.of("minecraft:carrot");
public static final Key POTATO = Key.of("minecraft:potato");
public static final Key BEETROOT_SEEDS = Key.of("minecraft:beetroot_seeds");
public static final Key WHEAT_SEEDS = Key.of("minecraft:wheat_seeds");
public static final Key SWEET_BERRIES = Key.of("minecraft:sweet_berries");
public static final Key GLOW_BERRIES = Key.of("minecraft:glow_berries");
public static final Key[] AXES = new Key[] {WOODEN_AXE, STONE_AXE, IRON_AXE, GOLDEN_AXE, DIAMOND_AXE, NETHERITE_AXE};
public static final Key[] WATER_BUCKETS = new Key[] {WATER_BUCKET, COD_BUCKET, SALMON_BUCKET, TROPICAL_FISH_BUCKET, TADPOLE_BUCKET, PUFFERFISH_BUCKET, AXOLOTL_BUCKET};

View File

@@ -40,6 +40,10 @@ public class BlockPos extends Vec3i {
return new BlockPos(this.x(), this.y() + 1, this.z());
}
public BlockPos below() {
return new BlockPos(this.x(), this.y() - 1, this.z());
}
public int toSectionBlockIndex() {
return (y & 15) << 8 | (z & 15) << 4 | x & 15;
}

View File

@@ -37,6 +37,8 @@ public interface ExistingBlock {
return new WorldPosition(world(), x(), y(), z());
}
boolean is(Key tag);
World world();
Key id();