mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-25 18:09:27 +00:00
活板门行为测试完毕
This commit is contained in:
@@ -18,9 +18,11 @@ import net.momirealms.craftengine.core.block.properties.Property;
|
||||
import net.momirealms.craftengine.core.block.state.properties.SingleBlockHalf;
|
||||
import net.momirealms.craftengine.core.entity.player.InteractionResult;
|
||||
import net.momirealms.craftengine.core.entity.player.Player;
|
||||
import net.momirealms.craftengine.core.item.Item;
|
||||
import net.momirealms.craftengine.core.item.ItemKeys;
|
||||
import net.momirealms.craftengine.core.item.context.BlockPlaceContext;
|
||||
import net.momirealms.craftengine.core.item.context.UseOnContext;
|
||||
import net.momirealms.craftengine.core.sound.SoundData;
|
||||
import net.momirealms.craftengine.core.util.*;
|
||||
import net.momirealms.craftengine.core.world.BlockPos;
|
||||
import net.momirealms.craftengine.core.world.Vec3d;
|
||||
@@ -32,7 +34,9 @@ import org.bukkit.event.block.BlockRedstoneEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
public class TrapDoorBlockBehavior extends WaterLoggedBlockBehavior {
|
||||
@@ -43,6 +47,8 @@ public class TrapDoorBlockBehavior extends WaterLoggedBlockBehavior {
|
||||
private final Property<Boolean> openProperty;
|
||||
private final boolean canOpenWithHand;
|
||||
private final boolean canOpenByWindCharge;
|
||||
private final SoundData openSound;
|
||||
private final SoundData closeSound;
|
||||
|
||||
public TrapDoorBlockBehavior(CustomBlock block,
|
||||
@Nullable Property<Boolean> waterloggedProperty,
|
||||
@@ -51,7 +57,9 @@ public class TrapDoorBlockBehavior extends WaterLoggedBlockBehavior {
|
||||
Property<Boolean> poweredProperty,
|
||||
Property<Boolean> openProperty,
|
||||
boolean canOpenWithHand,
|
||||
boolean canOpenByWindCharge) {
|
||||
boolean canOpenByWindCharge,
|
||||
SoundData openSound,
|
||||
SoundData closeSound) {
|
||||
super(block, waterloggedProperty);
|
||||
this.halfProperty = halfProperty;
|
||||
this.facingProperty = facingProperty;
|
||||
@@ -59,6 +67,8 @@ public class TrapDoorBlockBehavior extends WaterLoggedBlockBehavior {
|
||||
this.openProperty = openProperty;
|
||||
this.canOpenWithHand = canOpenWithHand;
|
||||
this.canOpenByWindCharge = canOpenByWindCharge;
|
||||
this.openSound = openSound;
|
||||
this.closeSound = closeSound;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,8 +109,15 @@ public class TrapDoorBlockBehavior extends WaterLoggedBlockBehavior {
|
||||
if (!this.canOpenWithHand) {
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
this.toggle(state, context.getLevel(), context.getClickedPos(), context.getPlayer());
|
||||
return InteractionResult.SUCCESS;
|
||||
if (context.getItem() == null) {
|
||||
this.toggle(state, context.getLevel(), context.getClickedPos(), context.getPlayer());
|
||||
return InteractionResult.SUCCESS;
|
||||
} else if (!context.getPlayer().isSecondaryUseActive()) {
|
||||
this.toggle(state, context.getLevel(), context.getClickedPos(), context.getPlayer());
|
||||
return InteractionResult.SUCCESS_AND_CANCEL;
|
||||
} else {
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -148,13 +165,13 @@ public class TrapDoorBlockBehavior extends WaterLoggedBlockBehavior {
|
||||
hasSignal = event.getNewCurrent() > 0;
|
||||
}
|
||||
|
||||
boolean willChange = immutableBlockState.get(this.openProperty) != hasSignal;
|
||||
if (hasSignal && willChange) {
|
||||
World world = new BukkitWorld(FastNMS.INSTANCE.method$Level$getCraftWorld(level));
|
||||
boolean changed = immutableBlockState.get(this.openProperty) != hasSignal;
|
||||
if (hasSignal && changed) {
|
||||
Object abovePos = LocationUtils.above(blockPos);
|
||||
Object aboveBlockState = FastNMS.INSTANCE.method$BlockGetter$getBlockState(level, abovePos);
|
||||
if (CoreReflections.clazz$RedStoneWireBlock.isInstance(FastNMS.INSTANCE.method$BlockState$getBlock(aboveBlockState))) {
|
||||
FastNMS.INSTANCE.method$LevelWriter$setBlock(level, abovePos, MBlocks.AIR$defaultState, UpdateOption.UPDATE_ALL.flags());
|
||||
World world = new BukkitWorld(FastNMS.INSTANCE.method$Level$getCraftWorld(level));
|
||||
world.dropItemNaturally(
|
||||
new Vec3d(FastNMS.INSTANCE.field$Vec3i$x(abovePos) + 0.5, FastNMS.INSTANCE.field$Vec3i$y(abovePos) + 0.5, FastNMS.INSTANCE.field$Vec3i$z(abovePos) + 0.5),
|
||||
BukkitItemManager.instance().createWrappedItem(ItemKeys.REDSTONE, null)
|
||||
@@ -165,16 +182,16 @@ public class TrapDoorBlockBehavior extends WaterLoggedBlockBehavior {
|
||||
}
|
||||
}
|
||||
|
||||
if (willChange) {
|
||||
if (changed) {
|
||||
immutableBlockState = immutableBlockState.with(this.openProperty, hasSignal);
|
||||
// todo 播放声音
|
||||
FastNMS.INSTANCE.method$Level$getCraftWorld(level).sendGameEvent(null,
|
||||
immutableBlockState.get(this.openProperty) ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE,
|
||||
hasSignal ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE,
|
||||
new Vector(FastNMS.INSTANCE.field$Vec3i$x(blockPos), FastNMS.INSTANCE.field$Vec3i$y(blockPos), FastNMS.INSTANCE.field$Vec3i$z(blockPos))
|
||||
);
|
||||
this.playSound(LocationUtils.fromBlockPos(blockPos), world, hasSignal);
|
||||
}
|
||||
|
||||
FastNMS.INSTANCE.method$LevelWriter$setBlock(level, blockPos, immutableBlockState.customBlockState().handle(), UpdateOption.Flags.UPDATE_CLIENTS);
|
||||
FastNMS.INSTANCE.method$LevelWriter$setBlock(level, blockPos, immutableBlockState.with(this.poweredProperty, hasSignal).customBlockState().handle(), UpdateOption.Flags.UPDATE_CLIENTS);
|
||||
if (this.waterloggedProperty != null && immutableBlockState.get(this.waterloggedProperty)) {
|
||||
FastNMS.INSTANCE.method$LevelAccessor$scheduleFluidTick(level, blockPos, MFluids.WATER, 5);
|
||||
}
|
||||
@@ -183,12 +200,25 @@ public class TrapDoorBlockBehavior extends WaterLoggedBlockBehavior {
|
||||
private void toggle(ImmutableBlockState state, World world, BlockPos pos, @Nullable Player player) {
|
||||
ImmutableBlockState newState = state.cycle(this.openProperty);
|
||||
FastNMS.INSTANCE.method$LevelWriter$setBlock(world.serverWorld(), LocationUtils.toBlockPos(pos), newState.customBlockState().handle(), UpdateOption.Flags.UPDATE_CLIENTS);
|
||||
// todo 播放声音,需要补一套交互的声音系统
|
||||
boolean open = newState.get(this.openProperty);
|
||||
((org.bukkit.World) world.platformWorld()).sendGameEvent(
|
||||
player != null ? (org.bukkit.entity.Player) player.platformPlayer() : null,
|
||||
newState.get(this.openProperty) ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE,
|
||||
open ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE,
|
||||
new Vector(pos.x(), pos.y(), pos.z())
|
||||
);
|
||||
this.playSound(pos, world, open);
|
||||
}
|
||||
|
||||
private void playSound(BlockPos pos, World world, boolean open) {
|
||||
if (open) {
|
||||
if (this.openSound != null) {
|
||||
world.playBlockSound(new Vec3d(pos.x() + 0.5, pos.y() + 0.5, pos.z() + 0.5), this.openSound);
|
||||
}
|
||||
} else {
|
||||
if (this.closeSound != null) {
|
||||
world.playBlockSound(new Vec3d(pos.x() + 0.5, pos.y() + 0.5, pos.z() + 0.5), this.closeSound);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -202,7 +232,14 @@ public class TrapDoorBlockBehavior extends WaterLoggedBlockBehavior {
|
||||
Property<Boolean> powered = (Property<Boolean>) ResourceConfigUtils.requireNonNullOrThrow(block.getProperty("powered"), "warning.config.block.behavior.trapdoor.missing_powered");
|
||||
boolean canOpenWithHand = (boolean) arguments.getOrDefault("can-open-with-hand", true);
|
||||
boolean canOpenByWindCharge = (boolean) arguments.getOrDefault("can-open-by-wind-charge", true);
|
||||
return new TrapDoorBlockBehavior(block, waterlogged, half, facing, powered, open, canOpenWithHand, canOpenByWindCharge);
|
||||
Map<String, Object> sounds = (Map<String, Object>) arguments.get("sounds");
|
||||
SoundData openSound = null;
|
||||
SoundData closeSound = null;
|
||||
if (sounds != null) {
|
||||
openSound = Optional.ofNullable(sounds.get("open")).map(obj -> SoundData.create(obj, 1, 1)).orElse(null);
|
||||
closeSound = Optional.ofNullable(sounds.get("close")).map(obj -> SoundData.create(obj, 1, 1)).orElse(null);
|
||||
}
|
||||
return new TrapDoorBlockBehavior(block, waterlogged, half, facing, powered, open, canOpenWithHand, canOpenByWindCharge, openSound, closeSound);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ import java.util.Map;
|
||||
public class BucketItemBehavior extends ItemBehavior {
|
||||
public static final BucketItemBehavior INSTANCE = new BucketItemBehavior();
|
||||
public static final Factory FACTORY = new Factory();
|
||||
private static final Key ITEM_BUCKET_FILL = Key.of("item.bucket.fill");
|
||||
|
||||
// todo 需要修复点击位置相连块为waterlogged
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public InteractionResult useOnBlock(UseOnContext context) {
|
||||
|
||||
@@ -2,8 +2,11 @@ package net.momirealms.craftengine.bukkit.item.behavior;
|
||||
|
||||
import net.momirealms.craftengine.bukkit.api.CraftEngineBlocks;
|
||||
import net.momirealms.craftengine.bukkit.block.BukkitBlockManager;
|
||||
import net.momirealms.craftengine.bukkit.nms.FastNMS;
|
||||
import net.momirealms.craftengine.bukkit.plugin.BukkitCraftEngine;
|
||||
import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.MFluids;
|
||||
import net.momirealms.craftengine.bukkit.util.BlockStateUtils;
|
||||
import net.momirealms.craftengine.bukkit.util.LocationUtils;
|
||||
import net.momirealms.craftengine.bukkit.world.BukkitBlockInWorld;
|
||||
import net.momirealms.craftengine.core.block.CustomBlock;
|
||||
import net.momirealms.craftengine.core.block.ImmutableBlockState;
|
||||
@@ -28,6 +31,7 @@ public class WaterBucketItemBehavior extends ItemBehavior {
|
||||
public static final WaterBucketItemBehavior INSTANCE = new WaterBucketItemBehavior();
|
||||
public static final Factory FACTORY = new Factory();
|
||||
|
||||
// todo 需要修复不完整方块取水
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public InteractionResult useOnBlock(UseOnContext context) {
|
||||
@@ -50,9 +54,11 @@ public class WaterBucketItemBehavior extends ItemBehavior {
|
||||
block.setBlockData(BlockStateUtils.fromBlockData(nextState.vanillaBlockState().handle()), false);
|
||||
// actually we should broadcast this change
|
||||
context.getPlayer().sendPacket(BlockStateUtils.createBlockUpdatePacket(pos, state), true);
|
||||
BukkitCraftEngine.instance().scheduler().sync().runDelayed(() ->
|
||||
CraftEngineBlocks.place(location, nextState, UpdateOption.UPDATE_ALL, false), world, location.getBlockX() >> 4, location.getBlockZ() >> 4);
|
||||
|
||||
BukkitCraftEngine.instance().scheduler().sync().runDelayed(() -> {
|
||||
Object blockPos = LocationUtils.toBlockPos(pos);
|
||||
FastNMS.INSTANCE.method$LevelWriter$setBlock(FastNMS.INSTANCE.field$CraftWorld$ServerLevel(world), blockPos, nextState.customBlockState().handle(), UpdateOption.UPDATE_ALL.flags());
|
||||
FastNMS.INSTANCE.method$LevelAccessor$scheduleFluidTick(FastNMS.INSTANCE.field$CraftWorld$ServerLevel(world), blockPos, MFluids.WATER, 5);
|
||||
}, world, location.getBlockX() >> 4, location.getBlockZ() >> 4);
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -170,10 +170,14 @@ public class ItemEventListener implements Listener {
|
||||
if (immutableBlockState.behavior() instanceof AbstractBlockBehavior behavior) {
|
||||
InteractionResult result = behavior.useOnBlock(useOnContext, immutableBlockState);
|
||||
if (result == InteractionResult.SUCCESS_AND_CANCEL) {
|
||||
serverPlayer.updateLastSuccessfulInteractionTick(serverPlayer.lastSuccessfulInteractionTick());
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (result != InteractionResult.PASS) {
|
||||
if (result == InteractionResult.SUCCESS) {
|
||||
serverPlayer.updateLastSuccessfulInteractionTick(serverPlayer.lastSuccessfulInteractionTick());
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ i18n:
|
||||
item.palm_planks: "Palm Planks"
|
||||
item.palm_sapling: "Palm Sapling"
|
||||
item.palm_leaves: "Palm Leaves"
|
||||
item.palm_trapdoor: "Palm Trapdoor"
|
||||
item.netherite_anvil: "Netherite Anvil"
|
||||
item.gunpowder_block: "GunPowder Block"
|
||||
item.solid_gunpowder_block: "Solid GunPowder Block"
|
||||
@@ -77,6 +78,7 @@ i18n:
|
||||
item.palm_planks: "棕榈木板"
|
||||
item.palm_sapling: "棕榈树苗"
|
||||
item.palm_leaves: "棕榈树叶"
|
||||
item.palm_trapdoor: "棕榈活板门"
|
||||
item.netherite_anvil: "下界合金砧"
|
||||
item.gunpowder_block: "火药粉末"
|
||||
item.solid_gunpowder_block: "凝固火药块"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
items:
|
||||
default:palm_log:
|
||||
material: oak_log
|
||||
material: nether_brick
|
||||
custom-model-data: 1000
|
||||
settings:
|
||||
fuel-time: 300
|
||||
@@ -42,8 +42,8 @@ items:
|
||||
from: 0
|
||||
to: 2
|
||||
default:stripped_palm_log:
|
||||
material: stripped_oak_log
|
||||
custom-model-data: 1000
|
||||
material: nether_brick
|
||||
custom-model-data: 1001
|
||||
settings:
|
||||
fuel-time: 300
|
||||
tags:
|
||||
@@ -81,8 +81,8 @@ items:
|
||||
from: 3
|
||||
to: 5
|
||||
default:palm_wood:
|
||||
material: oak_wood
|
||||
custom-model-data: 1000
|
||||
material: nether_brick
|
||||
custom-model-data: 1002
|
||||
settings:
|
||||
fuel-time: 300
|
||||
tags:
|
||||
@@ -123,8 +123,8 @@ items:
|
||||
from: 6
|
||||
to: 8
|
||||
default:stripped_palm_wood:
|
||||
material: stripped_oak_wood
|
||||
custom-model-data: 1000
|
||||
material: nether_brick
|
||||
custom-model-data: 1003
|
||||
settings:
|
||||
fuel-time: 300
|
||||
tags:
|
||||
@@ -162,8 +162,8 @@ items:
|
||||
from: 9
|
||||
to: 11
|
||||
default:palm_planks:
|
||||
material: oak_planks
|
||||
custom-model-data: 1000
|
||||
material: nether_brick
|
||||
custom-model-data: 1004
|
||||
settings:
|
||||
fuel-time: 300
|
||||
tags:
|
||||
@@ -192,7 +192,7 @@ items:
|
||||
state: note_block:12
|
||||
default:palm_sapling:
|
||||
material: nether_brick
|
||||
custom-model-data: 1000
|
||||
custom-model-data: 1005
|
||||
settings:
|
||||
fuel-time: 100
|
||||
data:
|
||||
@@ -284,6 +284,44 @@ items:
|
||||
type: self_increase_int
|
||||
from: 0
|
||||
to: 27
|
||||
default:palm_trapdoor:
|
||||
material: nether_brick
|
||||
custom-model-data: 1006
|
||||
data:
|
||||
item-name: "<!i><i18n:item.palm_trapdoor>"
|
||||
model:
|
||||
type: "minecraft:model"
|
||||
path: "minecraft:item/custom/palm_trapdoor"
|
||||
generation:
|
||||
parent: "minecraft:block/custom/palm_trapdoor"
|
||||
behavior:
|
||||
type: block_item
|
||||
block:
|
||||
behavior:
|
||||
type: trapdoor_block
|
||||
can-open-with-hand: true
|
||||
can-open-by-wind-charge: true
|
||||
sounds:
|
||||
open: block.wooden_trapdoor.open
|
||||
close: block.wooden_trapdoor.close
|
||||
loot:
|
||||
template: "default:loot_table/self"
|
||||
settings:
|
||||
template:
|
||||
- default:sound/wood
|
||||
overrides:
|
||||
map-color: 2
|
||||
instrument: bass
|
||||
hardness: 3.0
|
||||
resistance: 3.0
|
||||
burnable: true
|
||||
states:
|
||||
template: "default:block_state/trapdoor"
|
||||
arguments:
|
||||
base_block: acacia_trapdoor
|
||||
model_bottom_path: "minecraft:block/birch_trapdoor_bottom"
|
||||
model_open_path: "minecraft:block/birch_trapdoor_open"
|
||||
model_top_path: "minecraft:block/birch_trapdoor_top"
|
||||
|
||||
recipes:
|
||||
default:palm_planks:
|
||||
|
||||
@@ -792,6 +792,7 @@ templates#block_states:
|
||||
axis=z:
|
||||
appearance: axisZ
|
||||
id: "${internal_id}"
|
||||
# leaves block
|
||||
default:block_state/leaves:
|
||||
properties:
|
||||
waterlogged:
|
||||
@@ -961,6 +962,504 @@ templates#block_states:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
# trapdoor block
|
||||
default:block_state/trapdoor:
|
||||
properties:
|
||||
waterlogged:
|
||||
type: boolean
|
||||
default: false
|
||||
open:
|
||||
type: boolean
|
||||
default: false
|
||||
powered:
|
||||
type: boolean
|
||||
default: false
|
||||
facing:
|
||||
type: horizontal_direction
|
||||
half:
|
||||
type: single_block_half
|
||||
appearances:
|
||||
facing=east,half=bottom,open=false,waterlogged=false:
|
||||
state: "${base_block}[facing=east,half=bottom,open=false,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_bottom_path}
|
||||
y: 90
|
||||
facing=east,half=bottom,open=true,waterlogged=false:
|
||||
state: "${base_block}[facing=east,half=bottom,open=true,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
y: 90
|
||||
facing=east,half=top,open=false,waterlogged=false:
|
||||
state: "${base_block}[facing=east,half=top,open=false,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_top_path}
|
||||
y: 90
|
||||
facing=east,half=top,open=true,waterlogged=false:
|
||||
state: "${base_block}[facing=east,half=top,open=true,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
x: 180
|
||||
y: 270
|
||||
facing=north,half=bottom,open=false,waterlogged=false:
|
||||
state: "${base_block}[facing=north,half=bottom,open=false,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_bottom_path}
|
||||
facing=north,half=bottom,open=true,waterlogged=false:
|
||||
state: "${base_block}[facing=north,half=bottom,open=true,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
facing=north,half=top,open=false,waterlogged=false:
|
||||
state: "${base_block}[facing=north,half=top,open=false,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_top_path}
|
||||
facing=north,half=top,open=true,waterlogged=false:
|
||||
state: "${base_block}[facing=north,half=top,open=true,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
x: 180
|
||||
y: 180
|
||||
facing=south,half=bottom,open=false,waterlogged=false:
|
||||
state: "${base_block}[facing=south,half=bottom,open=false,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_bottom_path}
|
||||
y: 180
|
||||
facing=south,half=bottom,open=true,waterlogged=false:
|
||||
state: "${base_block}[facing=south,half=bottom,open=true,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
y: 180
|
||||
facing=south,half=top,open=false,waterlogged=false:
|
||||
state: "${base_block}[facing=south,half=top,open=false,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_top_path}
|
||||
y: 180
|
||||
facing=south,half=top,open=true,waterlogged=false:
|
||||
state: "${base_block}[facing=south,half=top,open=true,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
x: 180
|
||||
y: 0
|
||||
facing=west,half=bottom,open=false,waterlogged=false:
|
||||
state: "${base_block}[facing=west,half=bottom,open=false,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_bottom_path}
|
||||
y: 270
|
||||
facing=west,half=bottom,open=true,waterlogged=false:
|
||||
state: "${base_block}[facing=west,half=bottom,open=true,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
y: 270
|
||||
facing=west,half=top,open=false,waterlogged=false:
|
||||
state: "${base_block}[facing=west,half=top,open=false,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_top_path}
|
||||
y: 270
|
||||
facing=west,half=top,open=true,waterlogged=false:
|
||||
state: "${base_block}[facing=west,half=top,open=true,powered=true,waterlogged=false]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
x: 180
|
||||
y: 90
|
||||
facing=east,half=bottom,open=false,waterlogged=true:
|
||||
state: "${base_block}[facing=east,half=bottom,open=false,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_bottom_path}
|
||||
y: 90
|
||||
facing=east,half=bottom,open=true,waterlogged=true:
|
||||
state: "${base_block}[facing=east,half=bottom,open=true,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
y: 90
|
||||
facing=east,half=top,open=false,waterlogged=true:
|
||||
state: "${base_block}[facing=east,half=top,open=false,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_top_path}
|
||||
y: 90
|
||||
facing=east,half=top,open=true,waterlogged=true:
|
||||
state: "${base_block}[facing=east,half=top,open=true,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
x: 180
|
||||
y: 270
|
||||
facing=north,half=bottom,open=false,waterlogged=true:
|
||||
state: "${base_block}[facing=north,half=bottom,open=false,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_bottom_path}
|
||||
facing=north,half=bottom,open=true,waterlogged=true:
|
||||
state: "${base_block}[facing=north,half=bottom,open=true,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
facing=north,half=top,open=false,waterlogged=true:
|
||||
state: "${base_block}[facing=north,half=top,open=false,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_top_path}
|
||||
facing=north,half=top,open=true,waterlogged=true:
|
||||
state: "${base_block}[facing=north,half=top,open=true,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
x: 180
|
||||
y: 180
|
||||
facing=south,half=bottom,open=false,waterlogged=true:
|
||||
state: "${base_block}[facing=south,half=bottom,open=false,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_bottom_path}
|
||||
y: 180
|
||||
facing=south,half=bottom,open=true,waterlogged=true:
|
||||
state: "${base_block}[facing=south,half=bottom,open=true,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
y: 180
|
||||
facing=south,half=top,open=false,waterlogged=true:
|
||||
state: "${base_block}[facing=south,half=top,open=false,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_top_path}
|
||||
y: 180
|
||||
facing=south,half=top,open=true,waterlogged=true:
|
||||
state: "${base_block}[facing=south,half=top,open=true,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
x: 180
|
||||
y: 0
|
||||
facing=west,half=bottom,open=false,waterlogged=true:
|
||||
state: "${base_block}[facing=west,half=bottom,open=false,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_bottom_path}
|
||||
y: 270
|
||||
facing=west,half=bottom,open=true,waterlogged=true:
|
||||
state: "${base_block}[facing=west,half=bottom,open=true,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
y: 270
|
||||
facing=west,half=top,open=false,waterlogged=true:
|
||||
state: "${base_block}[facing=west,half=top,open=false,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_top_path}
|
||||
y: 270
|
||||
facing=west,half=top,open=true,waterlogged=true:
|
||||
state: "${base_block}[facing=west,half=top,open=true,powered=true,waterlogged=true]"
|
||||
model:
|
||||
path: ${model_open_path}
|
||||
x: 180
|
||||
y: 90
|
||||
variants:
|
||||
facing=east,half=bottom,open=false,powered=false,waterlogged=false:
|
||||
appearance: facing=east,half=bottom,open=false,waterlogged=false
|
||||
id: 0
|
||||
facing=east,half=bottom,open=false,powered=true,waterlogged=false:
|
||||
appearance: facing=east,half=bottom,open=false,waterlogged=false
|
||||
id: 1
|
||||
facing=east,half=bottom,open=true,powered=false,waterlogged=false:
|
||||
appearance: facing=east,half=bottom,open=true,waterlogged=false
|
||||
id: 2
|
||||
facing=east,half=bottom,open=true,powered=true,waterlogged=false:
|
||||
appearance: facing=east,half=bottom,open=true,waterlogged=false
|
||||
id: 3
|
||||
facing=east,half=top,open=false,powered=false,waterlogged=false:
|
||||
appearance: facing=east,half=top,open=false,waterlogged=false
|
||||
id: 4
|
||||
facing=east,half=top,open=false,powered=true,waterlogged=false:
|
||||
appearance: facing=east,half=top,open=false,waterlogged=false
|
||||
id: 5
|
||||
facing=east,half=top,open=true,powered=false,waterlogged=false:
|
||||
appearance: facing=east,half=top,open=true,waterlogged=false
|
||||
id: 6
|
||||
facing=east,half=top,open=true,powered=true,waterlogged=false:
|
||||
appearance: facing=east,half=top,open=true,waterlogged=false
|
||||
id: 7
|
||||
facing=north,half=bottom,open=false,powered=false,waterlogged=false:
|
||||
appearance: facing=north,half=bottom,open=false,waterlogged=false
|
||||
id: 8
|
||||
facing=north,half=bottom,open=false,powered=true,waterlogged=false:
|
||||
appearance: facing=north,half=bottom,open=false,waterlogged=false
|
||||
id: 9
|
||||
facing=north,half=bottom,open=true,powered=false,waterlogged=false:
|
||||
appearance: facing=north,half=bottom,open=true,waterlogged=false
|
||||
id: 10
|
||||
facing=north,half=bottom,open=true,powered=true,waterlogged=false:
|
||||
appearance: facing=north,half=bottom,open=true,waterlogged=false
|
||||
id: 11
|
||||
facing=north,half=top,open=false,powered=false,waterlogged=false:
|
||||
appearance: facing=north,half=top,open=false,waterlogged=false
|
||||
id: 12
|
||||
facing=north,half=top,open=false,powered=true,waterlogged=false:
|
||||
appearance: facing=north,half=top,open=false,waterlogged=false
|
||||
id: 13
|
||||
facing=north,half=top,open=true,powered=false,waterlogged=false:
|
||||
appearance: facing=north,half=top,open=true,waterlogged=false
|
||||
id: 14
|
||||
facing=north,half=top,open=true,powered=true,waterlogged=false:
|
||||
appearance: facing=north,half=top,open=true,waterlogged=false
|
||||
id: 15
|
||||
facing=south,half=bottom,open=false,powered=false,waterlogged=false:
|
||||
appearance: facing=south,half=bottom,open=false,waterlogged=false
|
||||
id: 16
|
||||
facing=south,half=bottom,open=false,powered=true,waterlogged=false:
|
||||
appearance: facing=south,half=bottom,open=false,waterlogged=false
|
||||
id: 17
|
||||
facing=south,half=bottom,open=true,powered=false,waterlogged=false:
|
||||
appearance: facing=south,half=bottom,open=true,waterlogged=false
|
||||
id: 18
|
||||
facing=south,half=bottom,open=true,powered=true,waterlogged=false:
|
||||
appearance: facing=south,half=bottom,open=true,waterlogged=false
|
||||
id: 19
|
||||
facing=south,half=top,open=false,powered=false,waterlogged=false:
|
||||
appearance: facing=south,half=top,open=false,waterlogged=false
|
||||
id: 20
|
||||
facing=south,half=top,open=false,powered=true,waterlogged=false:
|
||||
appearance: facing=south,half=top,open=false,waterlogged=false
|
||||
id: 21
|
||||
facing=south,half=top,open=true,powered=false,waterlogged=false:
|
||||
appearance: facing=south,half=top,open=true,waterlogged=false
|
||||
id: 22
|
||||
facing=south,half=top,open=true,powered=true,waterlogged=false:
|
||||
appearance: facing=south,half=top,open=true,waterlogged=false
|
||||
id: 23
|
||||
facing=west,half=bottom,open=false,powered=false,waterlogged=false:
|
||||
appearance: facing=west,half=bottom,open=false,waterlogged=false
|
||||
id: 24
|
||||
facing=west,half=bottom,open=false,powered=true,waterlogged=false:
|
||||
appearance: facing=west,half=bottom,open=false,waterlogged=false
|
||||
id: 25
|
||||
facing=west,half=bottom,open=true,powered=false,waterlogged=false:
|
||||
appearance: facing=west,half=bottom,open=true,waterlogged=false
|
||||
id: 26
|
||||
facing=west,half=bottom,open=true,powered=true,waterlogged=false:
|
||||
appearance: facing=west,half=bottom,open=true,waterlogged=false
|
||||
id: 27
|
||||
facing=west,half=top,open=false,powered=false,waterlogged=false:
|
||||
appearance: facing=west,half=top,open=false,waterlogged=false
|
||||
id: 28
|
||||
facing=west,half=top,open=false,powered=true,waterlogged=false:
|
||||
appearance: facing=west,half=top,open=false,waterlogged=false
|
||||
id: 29
|
||||
facing=west,half=top,open=true,powered=false,waterlogged=false:
|
||||
appearance: facing=west,half=top,open=true,waterlogged=false
|
||||
id: 30
|
||||
facing=west,half=top,open=true,powered=true,waterlogged=false:
|
||||
appearance: facing=west,half=top,open=true,waterlogged=false
|
||||
id: 31
|
||||
facing=east,half=bottom,open=false,powered=false,waterlogged=true:
|
||||
appearance: facing=east,half=bottom,open=false,waterlogged=true
|
||||
id: 32
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=east,half=bottom,open=false,powered=true,waterlogged=true:
|
||||
appearance: facing=east,half=bottom,open=false,waterlogged=true
|
||||
id: 33
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=east,half=bottom,open=true,powered=false,waterlogged=true:
|
||||
appearance: facing=east,half=bottom,open=true,waterlogged=true
|
||||
id: 34
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=east,half=bottom,open=true,powered=true,waterlogged=true:
|
||||
appearance: facing=east,half=bottom,open=true,waterlogged=true
|
||||
id: 35
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=east,half=top,open=false,powered=false,waterlogged=true:
|
||||
appearance: facing=east,half=top,open=false,waterlogged=true
|
||||
id: 36
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=east,half=top,open=false,powered=true,waterlogged=true:
|
||||
appearance: facing=east,half=top,open=false,waterlogged=true
|
||||
id: 37
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=east,half=top,open=true,powered=false,waterlogged=true:
|
||||
appearance: facing=east,half=top,open=true,waterlogged=true
|
||||
id: 38
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=east,half=top,open=true,powered=true,waterlogged=true:
|
||||
appearance: facing=east,half=top,open=true,waterlogged=true
|
||||
id: 39
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=north,half=bottom,open=false,powered=false,waterlogged=true:
|
||||
appearance: facing=north,half=bottom,open=false,waterlogged=true
|
||||
id: 40
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=north,half=bottom,open=false,powered=true,waterlogged=true:
|
||||
appearance: facing=north,half=bottom,open=false,waterlogged=true
|
||||
id: 41
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=north,half=bottom,open=true,powered=false,waterlogged=true:
|
||||
appearance: facing=north,half=bottom,open=true,waterlogged=true
|
||||
id: 42
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=north,half=bottom,open=true,powered=true,waterlogged=true:
|
||||
appearance: facing=north,half=bottom,open=true,waterlogged=true
|
||||
id: 43
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=north,half=top,open=false,powered=false,waterlogged=true:
|
||||
appearance: facing=north,half=top,open=false,waterlogged=true
|
||||
id: 44
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=north,half=top,open=false,powered=true,waterlogged=true:
|
||||
appearance: facing=north,half=top,open=false,waterlogged=true
|
||||
id: 45
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=north,half=top,open=true,powered=false,waterlogged=true:
|
||||
appearance: facing=north,half=top,open=true,waterlogged=true
|
||||
id: 46
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=north,half=top,open=true,powered=true,waterlogged=true:
|
||||
appearance: facing=north,half=top,open=true,waterlogged=true
|
||||
id: 47
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=south,half=bottom,open=false,powered=false,waterlogged=true:
|
||||
appearance: facing=south,half=bottom,open=false,waterlogged=true
|
||||
id: 48
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=south,half=bottom,open=false,powered=true,waterlogged=true:
|
||||
appearance: facing=south,half=bottom,open=false,waterlogged=true
|
||||
id: 49
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=south,half=bottom,open=true,powered=false,waterlogged=true:
|
||||
appearance: facing=south,half=bottom,open=true,waterlogged=true
|
||||
id: 50
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=south,half=bottom,open=true,powered=true,waterlogged=true:
|
||||
appearance: facing=south,half=bottom,open=true,waterlogged=true
|
||||
id: 51
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=south,half=top,open=false,powered=false,waterlogged=true:
|
||||
appearance: facing=south,half=top,open=false,waterlogged=true
|
||||
id: 52
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=south,half=top,open=false,powered=true,waterlogged=true:
|
||||
appearance: facing=south,half=top,open=false,waterlogged=true
|
||||
id: 53
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=south,half=top,open=true,powered=false,waterlogged=true:
|
||||
appearance: facing=south,half=top,open=true,waterlogged=true
|
||||
id: 54
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=south,half=top,open=true,powered=true,waterlogged=true:
|
||||
appearance: facing=south,half=top,open=true,waterlogged=true
|
||||
id: 55
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=west,half=bottom,open=false,powered=false,waterlogged=true:
|
||||
appearance: facing=west,half=bottom,open=false,waterlogged=true
|
||||
id: 56
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=west,half=bottom,open=false,powered=true,waterlogged=true:
|
||||
appearance: facing=west,half=bottom,open=false,waterlogged=true
|
||||
id: 57
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=west,half=bottom,open=true,powered=false,waterlogged=true:
|
||||
appearance: facing=west,half=bottom,open=true,waterlogged=true
|
||||
id: 58
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=west,half=bottom,open=true,powered=true,waterlogged=true:
|
||||
appearance: facing=west,half=bottom,open=true,waterlogged=true
|
||||
id: 59
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=west,half=top,open=false,powered=false,waterlogged=true:
|
||||
appearance: facing=west,half=top,open=false,waterlogged=true
|
||||
id: 60
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=west,half=top,open=false,powered=true,waterlogged=true:
|
||||
appearance: facing=west,half=top,open=false,waterlogged=true
|
||||
id: 61
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
facing=west,half=top,open=true,powered=false,waterlogged=true:
|
||||
appearance: facing=west,half=top,open=true,waterlogged=true
|
||||
id: 62
|
||||
settings:
|
||||
fluid-state: water
|
||||
facing=west,half=top,open=true,powered=true,waterlogged=true:
|
||||
appearance: facing=west,half=top,open=true,waterlogged=true
|
||||
id: 63
|
||||
settings:
|
||||
resistance: 1200.0
|
||||
burnable: false
|
||||
fluid-state: water
|
||||
|
||||
# recipes
|
||||
templates#recipes:
|
||||
|
||||
@@ -17,8 +17,8 @@ public class Properties {
|
||||
public static final Key INT = Key.of("craftengine:int");
|
||||
public static final Key STRING = Key.of("craftengine:string");
|
||||
public static final Key AXIS = Key.of("craftengine:axis");
|
||||
public static final Key HORIZONTAL_DIRECTION = Key.of("craftengine:4-direction");
|
||||
public static final Key DIRECTION = Key.of("craftengine:6-direction");
|
||||
public static final Key HORIZONTAL_DIRECTION = Key.of("craftengine:horizontal_direction");
|
||||
public static final Key DIRECTION = Key.of("craftengine:direction");
|
||||
public static final Key SINGLE_BLOCK_HALF = Key.of("craftengine:single_block_half");
|
||||
public static final Key DOUBLE_BLOCK_HALF = Key.of("craftengine:double_block_half");
|
||||
public static final Key HINGE = Key.of("craftengine:hinge");
|
||||
@@ -29,7 +29,9 @@ public class Properties {
|
||||
register(STRING, StringProperty.FACTORY);
|
||||
register(AXIS, new EnumProperty.Factory<>(Direction.Axis.class));
|
||||
register(DIRECTION, new EnumProperty.Factory<>(Direction.class));
|
||||
register(Key.of("craftengine:6-direction"), new EnumProperty.Factory<>(Direction.class));
|
||||
register(HORIZONTAL_DIRECTION, new EnumProperty.Factory<>(HorizontalDirection.class));
|
||||
register(Key.of("craftengine:4-direction"), new EnumProperty.Factory<>(HorizontalDirection.class));
|
||||
register(SINGLE_BLOCK_HALF, new EnumProperty.Factory<>(SingleBlockHalf.class));
|
||||
register(DOUBLE_BLOCK_HALF, new EnumProperty.Factory<>(DoubleBlockHalf.class));
|
||||
register(HINGE, new EnumProperty.Factory<>(DoorHinge.class));
|
||||
|
||||
Reference in New Issue
Block a user