Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
17d6981
backport 1.21.1 commit 85aeb87:Fixed not being able to open doors out…
Deepseasaltyfish Nov 28, 2025
15cd7e6
backport 1.21.1 commit 390b086,4036887
Deepseasaltyfish Nov 28, 2025
64608b4
backport 1.21.1 commit deb917c
Deepseasaltyfish Nov 30, 2025
ee68380
backport 1.21.1 commit b0b357d
Deepseasaltyfish Nov 30, 2025
d2388b5
backport 1.21.1 commit 59f6151
Deepseasaltyfish Nov 30, 2025
ae82723
backport 1.21.1 commit 97f6e19
Deepseasaltyfish Nov 30, 2025
1e524d2
backport 1.21.1 commit b193981
Deepseasaltyfish Dec 1, 2025
6028f7b
backport 1.21.1 commit 8953e33
Deepseasaltyfish Dec 1, 2025
64aeaa9
backport 1.21.1 commit 2359493
Deepseasaltyfish Dec 1, 2025
e256f85
backport 1.21.1 commit 143d355
Deepseasaltyfish Dec 1, 2025
440b9cc
backport 1.21.1 commit d378bdc
Deepseasaltyfish Dec 1, 2025
6d0cdd9
backport 1.21.1 commit 31c197d
Deepseasaltyfish Dec 1, 2025
f05e433
backport 1.21.1 commit 818448a
Deepseasaltyfish Dec 1, 2025
97968d4
backport 1.21.1 commit 1b3c461
Deepseasaltyfish Dec 1, 2025
1cbe3f9
backport 1.21.1 commit c576c2b
Deepseasaltyfish Dec 1, 2025
9c80b66
backport 1.21.1 commit c9e612e
Deepseasaltyfish Dec 1, 2025
cd8d634
backport 1.21.1 commit b9128ba
Deepseasaltyfish Dec 1, 2025
a5cb1f2
backport 1.21.1 commit 6b876bc
Deepseasaltyfish Dec 1, 2025
00d9b98
backport 1.21.1 commit 0f1973d
Deepseasaltyfish Dec 1, 2025
96e05c3
backport 1.21.1 commit e0a7573
Deepseasaltyfish Dec 1, 2025
4ec7143
backport 1.21.1 commit bef2747 and added Equation
Deepseasaltyfish Dec 1, 2025
6b2f38a
backport 1.21.1 commit bae6d7a
Deepseasaltyfish Dec 1, 2025
43d478b
backport 1.21.1 commit 66f7374
Deepseasaltyfish Dec 1, 2025
589f3ab
backport 1.21.1 commit ba1b87d
Deepseasaltyfish Dec 1, 2025
0a6e1d7
backport 1.21.1 commit 85a9747
Deepseasaltyfish Dec 1, 2025
a0855d4
backport 1.21.1 commit 4519ccb
Deepseasaltyfish Dec 1, 2025
b013f20
backport 1.21.1 commit 347d491
Deepseasaltyfish Dec 1, 2025
809ec3d
backport 1.21.1 commit 7c9cae6
Deepseasaltyfish Dec 1, 2025
cecfb13
backport 1.21.1 commit 13fec73
Deepseasaltyfish Dec 1, 2025
c042a71
backport 1.21.1 commit ab9a325
Deepseasaltyfish Dec 1, 2025
3c0f11c
backport 1.21.1 commit daa5f75
Deepseasaltyfish Dec 1, 2025
09915ff
backport 1.21.1 commit 651f314
Deepseasaltyfish Dec 1, 2025
300c0bb
backport 1.21.1 commit db6b075
Deepseasaltyfish Dec 1, 2025
b0d25e2
backport 1.21.1 commit b9d8e6b
Deepseasaltyfish Dec 1, 2025
36abf07
backport 1.21.1 commit 02e31b4
Deepseasaltyfish Dec 1, 2025
1ad410b
backport 1.21.1 commit ddab5c8
Deepseasaltyfish Dec 1, 2025
56d9a94
backport 1.21.1 commit 15f5c2b
Deepseasaltyfish Dec 1, 2025
5444fa4
introduce zh_cn.json
Deepseasaltyfish Dec 1, 2025
484c666
update zh_cn.json
Deepseasaltyfish Dec 2, 2025
6fe82e7
catch wrong ID from 1.12.2 and convert to default state
Deepseasaltyfish Dec 3, 2025
32acae1
fix hybrid server crash due to empty value of BETiles.tiles
Deepseasaltyfish Dec 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ public void load(LevelEvent.Load event) {

for (int i = 0; i < handlers.size(); i++)
handlers.get(i).load((Level) event.getLevel());

awareHandlers.forEach(x -> x.unload());

}

public void unload(ClientPlayerNetworkEvent.LoggingOut event) {
for (int i = 0; i < handlers.size(); i++)
handlers.get(i).unload();

awareHandlers.forEach(x -> x.unload());
}

private static record LevelHandlerClient<T extends LevelHandler>(Function<Level, T> factory, Consumer<T> consumer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static synchronized void initThreads(int count) {

while (QUEUE.size() > 0)
QUEUE.poll().be.render.resetRenderingState();
QUEUE.clear(); // Make sure all levels and sections are reset
}
THREADS = new ArrayList<>();
for (int i = 0; i < count; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,17 @@ else if (blockEntity == null && shouldConvert) {
return b;
return null;
}
public static void fireBlockBreakEvent(Level level, BlockPos pos, Player player) throws AreaProtected {

public static boolean fireBlockBreakEvent(Level level, BlockPos pos, Player player) {
if (level.isClientSide)
return;
return true;
BreakEvent event = new BlockEvent.BreakEvent(level, pos, level.getBlockState(pos), player);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled()) {
sendBlockResetToClient(level, player, pos);
throw new AreaProtected();
return false;
}
return true;
}

private static Method loadWorldEditEvent() {
Expand Down Expand Up @@ -435,24 +436,23 @@ public static List<ItemStack> getInventories(Player player) {
}

private static boolean isBlockValid(Block block) {
if (block instanceof EntityBlock || block instanceof SlabBlock)
return false;
if (LittleBlockRegistry.isSpecialBlock(block))
return true;
return block instanceof GlassBlock || block instanceof StainedGlassBlock || block instanceof HalfTransparentBlock || block instanceof LeavesBlock;
}

private static boolean isBlockInvalid(Block block) {
if (block instanceof EntityBlock || block instanceof SlabBlock)
return true;
var location = block.builtInRegistryHolder().unwrapKey().get().location();
return location.getNamespace().equals("framedblocks");
}

public static boolean isBlockValid(BlockState state) {
if (isBlockValid(state.getBlock()))
return true;
if (isBlockInvalid(state.getBlock()))
return false;

if (isBlockValid(state.getBlock()))
return true;
if (state.isSolid() && state.isCollisionShapeFullBlock(EmptyBlockGetter.INSTANCE, BlockPos.ZERO))
return true;
if (ChiselsAndBitsManager.isChiselsAndBitsStructure(state))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import team.creative.littletiles.LittleTiles;
import team.creative.littletiles.common.block.entity.BETiles;
import team.creative.littletiles.common.config.LittleBuildingConfig;
import team.creative.littletiles.common.config.LittleTilesConfig;
import team.creative.littletiles.common.config.LittleTilesConfig.NotAllowedToEditException;
import team.creative.littletiles.common.entity.LittleEntity;
import team.creative.littletiles.common.grid.LittleGrid;
Expand Down Expand Up @@ -95,6 +96,7 @@ else if (LittleAction.isBlockValid(state) && LittleAction.canConvertBlock(player
sendBlockResetToClient(level, player, pos);
throw e;
}
boolean areaProtected = false;

for (Iterator<Entry<BlockPos, ArrayList<LittleBox>>> iterator = boxesMap.entrySet().iterator(); iterator.hasNext();) {
Entry<BlockPos, ArrayList<LittleBox>> entry = iterator.next();
Expand All @@ -105,13 +107,19 @@ else if (LittleAction.isBlockValid(state) && LittleAction.canConvertBlock(player
sendBlockResetToClient(level, player, pos);
continue;
}
if (requiresBreak() && !fireBlockBreakEvent(level, pos, player)) {
areaProtected = true;
continue;
}

action(level, player, pos, state, entry.getValue(), boxes.grid);
}

actionDone(level, player);

level.playSound(null, player, SoundEvents.ITEM_FRAME_ADD_ITEM, SoundSource.BLOCKS, 1, 1);
if (areaProtected)
throw new LittleTilesConfig.AreaProtected();
return true;
}

Expand All @@ -132,5 +140,8 @@ public boolean wasSuccessful(Boolean result) {
public Boolean failed() {
return false;
}


public boolean requiresBreak() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import team.creative.littletiles.client.action.LittleActionHandlerClient;
import team.creative.littletiles.common.block.entity.BETiles;
import team.creative.littletiles.common.block.little.tile.LittleTileContext;
import team.creative.littletiles.common.config.LittleTilesConfig;
import team.creative.littletiles.common.entity.LittleEntity;

public abstract class LittleActionInteract<T> extends LittleAction<T> {
Expand Down Expand Up @@ -102,9 +103,9 @@ public T action(Player player) throws LittleActionException {
transformedCoordinates = true;
}
}
if (requiresBreakEvent())
fireBlockBreakEvent(level, blockPos, player);

if (requiresBreakEvent() && !fireBlockBreakEvent(level, blockPos, player))
throw new LittleTilesConfig.AreaProtected();

BlockEntity blockEntity = level.getBlockEntity(blockPos);
if (blockEntity instanceof BETiles be) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,13 @@ protected int[] getIdentifier(LittleBox box) {
public void saveAdditional(CompoundTag nbt) {
super.saveAdditional(nbt);
grid.set(nbt);
nbt.put("content", tiles.save(new LittleServerFace(this)));

//add null value when tiles is null,this will cause NPE in some hybrid server
if (tiles == null) {
nbt.put("content", new CompoundTag());
} else {
nbt.put("content", tiles.save(new LittleServerFace(this)));
}
sideCache.write(nbt);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ public void convertTo(LittleGrid to) {
}

public LittleGroup copyExceptChildren() {
LittleGroup group = new LittleGroup(structure, Collections.EMPTY_LIST);
LittleGroup group = new LittleGroup(structure != null ? structure.copy() : null, Collections.EMPTY_LIST);
for (Entry<String, LittleGroup> extension : children.extensionEntries())
group.children.addExtension(extension.getKey(), extension.getValue().copy());
group.addAll(grid, new FunctionIterator<>(this, x -> x.copy()));
Expand All @@ -383,7 +383,7 @@ public LittleGroup copy() {
List<LittleGroup> newChildren = new ArrayList<>();
for (LittleGroup group : children.children())
newChildren.add(group.copy());
LittleGroup group = new LittleGroup(structure, newChildren);
LittleGroup group = new LittleGroup(structure != null ? structure.copy() : null, newChildren);
for (Entry<String, LittleGroup> extension : children.extensionEntries())
group.children.addExtension(extension.getKey(), extension.getValue().copy());
group.addAll(grid, new FunctionIterator<>(this, x -> x.copy()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,14 @@ public LittleStructure setStructureNBT(CompoundTag nbt) {
}
return (LittleStructure) cache;
}


@Override
public LittleStructure getStructureUncached() throws CorruptedConnectionException, NotYetConnectedException {
if (!isMain()) // Make sure not to remove the structure
cache = null;
return getStructure();
}

@Override
public LittleStructure getStructure() throws CorruptedConnectionException, NotYetConnectedException {
if (isMain())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.nbt.Tag;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.registries.ForgeRegistries;
import team.creative.creativecore.common.util.math.base.Axis;
import team.creative.creativecore.common.util.math.base.Facing;
import team.creative.creativecore.common.util.math.vec.Vec1d;
Expand Down Expand Up @@ -78,7 +79,34 @@ public static LittleTile createTile(CompoundTag nbt) {
int color = -1;
if (nbt.contains("color"))
color = nbt.getInt("color");
return new LittleTile(BLOCK_MAP.getOrDefault(name, name), color, Collections.EMPTY_LIST);

String newId = resolveBlockState(name);
return new LittleTile(newId, color, Collections.EMPTY_LIST);
}

private static String resolveBlockState(String name) {
String mapped = BLOCK_MAP.get(name);
if (mapped != null) return mapped;

LittleTiles.LOGGER.warn("Block not in 1.12.2.txt, trying to extract name: {}", name);
String base = extractBaseId(name); // minecraft:bone_block:1:1:1 → minecraft:bone_block
ResourceLocation loc = ResourceLocation.tryParse(base);
if (loc != null && ForgeRegistries.BLOCKS.containsKey(loc)) {
return loc.toString(); // block ID, no meta data
}

// missing
LittleTiles.LOGGER.warn("fail to extract name, will use missing/magenta texture: {}", name);
return name;
}

//ignore data after the second ":"
private static String extractBaseId(String name) {
LittleTiles.LOGGER.warn("converting:"+name);
int cut = name.indexOf(':');
if (cut == -1) return name;
int next = name.indexOf(':', cut + 1);
return next == -1 ? name : name.substring(0, next);
}

public static LittleGroup load(CompoundTag nbt) throws LittleConvertException {
Expand Down Expand Up @@ -126,8 +154,10 @@ public static LittleGroup loadGroup(CompoundTag nbt, LittleGrid grid) throws Lit

private static void convertDoorBaseData(CompoundTag oldData, CompoundTag newData) {
convertStructureDataBase(oldData, newData);

newData.put("state", oldData.get("state"));

var state = oldData.get("state");
if (state != null)
newData.put("state", state);

newData.putBoolean("actP", oldData.getBoolean("activateParent"));
newData.putBoolean("hand", !oldData.getBoolean("disableRightClick"));
Expand Down Expand Up @@ -393,10 +423,18 @@ public static CompoundTag convertStructureData(CompoundTag nbt) throws LittleCon
converted.putString("id", "door");
yield converted;
}
default -> throw new LittleConvertException("Cannot convert " + nbt.getString("id") + " yet");
default -> throw new LittleMissingStructureException("Cannot convert " + nbt.getString("id") + " yet");
};
}


public static class LittleMissingStructureException extends LittleConvertException {

public LittleMissingStructureException(String name) {
super(name);
}

}

public static CompoundTag convert(CompoundTag nbt) throws LittleConvertException {
return LittleGroup.save(load(nbt));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,4 +512,14 @@ public boolean addFreshEntity(Entity entity) {
}
return false;
}

@Override
public int getMinBuildHeight() {
return parentLevel.getMinBuildHeight();
}

@Override
public int getHeight() {
return parentLevel.getHeight();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,10 @@ protected ValueCurve<Vec1d> parse(Iterable<GuiTimelineKey<Double>> keys, ValueIn
public AnimationTimeline generateTimeline(int duration, ValueInterpolation interpolation) {
List<AnimationEventEntry> events = new ArrayList<>();
for (GuiChildTimelineChannel channel : childChannels)
for (GuiTimelineKey<ChildDoorEvent> key : channel.keys())
if (key.tick <= duration)
events.add(new AnimationEventEntry(key.tick, key.value));
if (channel != null)
for (GuiTimelineKey<ChildDoorEvent> key : channel.keys())
if (key.tick <= duration)
events.add(new AnimationEventEntry(key.tick, key.value));

for (GuiSoundTimelineChannel channel : soundChannels)
for (GuiTimelineKey<PlaySoundEvent> key : channel.keys())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import team.creative.creativecore.common.util.type.itr.FilterIterator;
import team.creative.creativecore.common.util.type.itr.FilterListIterator;
import team.creative.creativecore.common.util.type.itr.NestedIterator;
import team.creative.littletiles.LittleTiles;
import team.creative.littletiles.common.gui.signal.dialog.GuiDialogSignal;
import team.creative.littletiles.common.gui.signal.node.GuiSignalNode;
import team.creative.littletiles.common.gui.signal.node.GuiSignalNodeInput;
Expand Down Expand Up @@ -308,7 +309,7 @@ public void mouseReleased(Rect rect, double x, double y, int button) {

public void setOutput(int cell, GuiSignalComponent output) {
if (this.output != null)
removeNode(this.output);
this.output.remove(); //removeNode(this.output);
this.output = new GuiSignalNodeOutput(output);
setToFreeCell(cell, this.output);
raiseEvent(new GuiControlChangedEvent(this));
Expand All @@ -331,6 +332,7 @@ public void setCondition(SignalInputCondition condition, GuiDialogSignal signal)
output.connect(connection);
return;
} catch (ParseException e) {
LittleTiles.LOGGER.catching(e);
reset();
}
setOutput(4, output.component);
Expand Down Expand Up @@ -499,6 +501,7 @@ public void set(GuiSignalNode node, int col, int row) {
public void reset() {
controls.clear();
grid.clear();
output.remove();
dragged = null;
selected = null;;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import team.creative.littletiles.common.gui.signal.GuiSignalComponent;
import team.creative.littletiles.common.gui.signal.GuiSignalController;
import team.creative.littletiles.common.gui.signal.IConditionConfiguration;
import team.creative.littletiles.common.structure.signal.component.SignalComponentType;
import team.creative.littletiles.common.structure.signal.input.SignalInputCondition;
import team.creative.littletiles.common.structure.signal.logic.SignalLogicOperator;
import team.creative.littletiles.common.structure.signal.logic.SignalMode;
Expand All @@ -35,7 +36,7 @@ public class GuiDialogSignal extends GuiLayer {
public List<GuiSignalComponent> inputs;

public GuiDialogSignal() {
super("gui.dialog.signal", 320, 200);
super("gui.dialog.signal", 420, 300);
flow = GuiFlow.STACK_Y;
registerEventChanged(this::changed);
}
Expand Down Expand Up @@ -137,7 +138,7 @@ public GuiSignalComponent getInput(SignalTarget target) throws ParseException {
for (GuiSignalComponent component : inputs)
if (component.name().equals(target.writeBase()))
return component;
throw new ParseException("input not found", 0);
return new GuiSignalComponent("lost?", target.write(), 1, SignalComponentType.INVALID, false, 0);
}

public void modeChanged() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void update() {
int delay = modeConfig.delay;
if (condition != null)
delay = Math.max(delay, (int) Math.ceil(condition.calculateDelay()));
mode.setTitle(Component.translatable(modeConfig.getMode().translateKey).append(" ").append(Component.translatable("gui.delay")).append(": " + delay));
mode.setTitle(modeConfig.description(delay));
}

public SignalOutputHandler getHandler(ISignalComponent component, LittleStructure structure) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ public class GuiDialogSignalInput extends GuiLayer {
public int bandwidth;

public GuiDialogSignalInput() {
super("gui.dialog.signal.input", 100, 100);
super("gui.dialog.signal.input", 200, 100);
flow = GuiFlow.STACK_Y;
registerEventChanged(this::changed);
}

public void init(GuiSignalNodeInput input) {
Expand Down Expand Up @@ -126,7 +127,7 @@ public void save(GuiSignalNodeInput input, GuiParent panel) {
}

});
upper.add(new GuiTabButtonMapped<GuiSignalInputOperator>("type", input.operator, new TextMapBuilder<GuiSignalInputOperator>().addComponent(modes, x -> x.translatable())));
add(new GuiTabButtonMapped<GuiSignalInputOperator>("type", input.operator, new TextMapBuilder<GuiSignalInputOperator>().addComponent(modes, x -> x.translatable())));
add(new GuiScrollY("config").setExpandable());

GuiLeftRightBox bottom = new GuiLeftRightBox();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class GuiDialogSignalVirtualInput extends GuiLayer {
public GuiVirtualInputIndexConfiguration[] config;

public GuiDialogSignalVirtualInput() {
super("gui.dialog.signal.virtual_input", 130, 100);
super("gui.dialog.signal.virtual_input", 230, 200);
flow = GuiFlow.STACK_Y;
registerEventChanged(this::changed);
}
Expand Down
Loading