Skip to content

Commit ba39e82

Browse files
committed
Update to 1.21.10
1 parent aa1b797 commit ba39e82

File tree

6 files changed

+21
-17
lines changed

6 files changed

+21
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ _LithiumVersion_ is automatically replaced with the lithium version, e.g. 0.14.5
44
Everything above the line is ignored and not included in the changelog. Everything below will be in the
55
changelog on GitHub, Modrinth and CurseForge.
66
----------
7-
Lithium _LithiumVersion_ for Minecraft _MCVersion_ fixes a visual issue.
7+
Lithium _LithiumVersion_ is the first release for Minecraft _MCVersion_.
88

99
Make sure to take a backup of your world before using the mod and please report any bugs and mod compatibility issues at the [issue tracker](https://github.com/CaffeineMC/lithium-fabric/issues). You can check the [description of each optimization](https://github.com/CaffeineMC/lithium/blob/_ReleaseTag_/lithium-mixin-config.md) and how to disable it when encountering a problem.
1010

11-
## Fixes
12-
- Fix explosion optimization reducing visual explosion size

build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ plugins {
77

88
// Fabric: https://fabricmc.net/develop/
99
// Neoforge: https://neoforged.net/
10-
val MINECRAFT_VERSION by extra { "1.21.9" } //MUST manually update fabric.mod.json and neoforge.mods.toml
11-
val NEOFORGE_VERSION by extra { "21.9.0-beta" }
10+
val MINECRAFT_VERSION by extra { "1.21.10" } //MUST manually update fabric.mod.json and neoforge.mods.toml
11+
val NEOFORGE_VERSION by extra { "21.10.1-beta" }
1212
val FABRIC_LOADER_VERSION by extra { "0.17.2" }
13-
val FABRIC_API_VERSION by extra { "0.133.14+1.21.9" }
13+
val FABRIC_API_VERSION by extra { "0.134.1+1.21.10" }
1414

1515
// This value can be set to null to disable Parchment.
1616
val PARCHMENT_VERSION by extra { null }
1717

1818
// https://semver.org/
19-
val MOD_VERSION by extra { "0.19.1" }
19+
val MOD_VERSION by extra { "0.20.0" }
2020

2121
allprojects {
2222
apply(plugin = "java")

fabric/src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"accessWidener": "lithium.accesswidener",
2929
"depends": {
3030
"fabricloader": ">=0.15.1",
31-
"minecraft" : "1.21.9"
31+
"minecraft" : "1.21.10"
3232
},
3333
"breaks": {
3434
"optifabric": "*"

neoforge/src/main/java/net/caffeinemc/mods/lithium/neoforge/NeoForgeModCompat.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import net.minecraft.world.level.block.entity.HopperBlockEntity;
88
import net.minecraft.world.level.block.state.BlockState;
99
import net.neoforged.neoforge.capabilities.Capabilities;
10-
import net.neoforged.neoforge.items.IItemHandler;
10+
import net.neoforged.neoforge.transfer.ResourceHandler;
11+
import net.neoforged.neoforge.transfer.item.ItemResource;
12+
import org.jetbrains.annotations.Nullable;
1113

1214
import java.util.Objects;
1315

@@ -18,7 +20,7 @@ public boolean canHopperInteractWithApiBlockInventory(HopperBlockEntity hopperBl
1820
Direction direction = extracting ? Direction.UP : hopperState.getValue(HopperBlock.FACING);
1921
BlockPos targetPos = hopperBlockEntity.getBlockPos().relative(direction);
2022

21-
IItemHandler target = Objects.requireNonNull(hopperBlockEntity.getLevel()).getCapability(Capabilities.ItemHandler.BLOCK, targetPos, null, null, direction.getOpposite());
23+
@Nullable ResourceHandler<ItemResource> target = Objects.requireNonNull(hopperBlockEntity.getLevel()).getCapability(Capabilities.Item.BLOCK, targetPos, null, null, direction.getOpposite());
2224
return target != null;
2325
}
2426
}

neoforge/src/main/java/net/caffeinemc/mods/lithium/neoforge/mixin/block/hopper/HopperBlockEntityMixin.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import net.minecraft.world.level.block.entity.HopperBlockEntity;
1010
import net.minecraft.world.level.block.state.BlockState;
1111
import net.neoforged.neoforge.capabilities.Capabilities;
12-
import net.neoforged.neoforge.items.ContainerOrHandler;
13-
import net.neoforged.neoforge.items.VanillaInventoryCodeHooks;
12+
import net.neoforged.neoforge.transfer.item.ContainerOrHandler;
13+
import net.neoforged.neoforge.transfer.item.VanillaInventoryCodeHooks;
1414
import org.jetbrains.annotations.Nullable;
1515
import org.spongepowered.asm.mixin.Mixin;
1616
import org.spongepowered.asm.mixin.Shadow;
@@ -26,7 +26,7 @@ public abstract class HopperBlockEntityMixin {
2626

2727
@Redirect(
2828
method = "getSourceContainerOrHandler",
29-
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/entity/HopperBlockEntity;getContainerOrHandlerAt(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;DDDLnet/minecraft/core/Direction;)Lnet/neoforged/neoforge/items/ContainerOrHandler;")
29+
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/entity/HopperBlockEntity;getContainerOrHandlerAt(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;DDDLnet/minecraft/core/Direction;)Lnet/neoforged/neoforge/transfer/item/ContainerOrHandler;")
3030
)
3131
private static ContainerOrHandler getSourceContainerOrHandler(Level level, BlockPos blockPos, BlockState blockState, double x, double y, double z, Direction direction, @Local(argsOnly = true) Hopper hopper) {
3232
if (!(hopper instanceof HopperBlockEntityMixin hopperBlockEntity)) {
@@ -37,38 +37,41 @@ private static ContainerOrHandler getSourceContainerOrHandler(Level level, Block
3737

3838
@Redirect(
3939
method = "ejectItems",
40-
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/entity/HopperBlockEntity;getContainerOrHandlerAt(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/core/Direction;)Lnet/neoforged/neoforge/items/ContainerOrHandler;")
40+
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/entity/HopperBlockEntity;getContainerOrHandlerAt(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/core/Direction;)Lnet/neoforged/neoforge/transfer/item/ContainerOrHandler;")
4141
)
4242
private static ContainerOrHandler getContainerOrHandlerAt(Level level, BlockPos pos, Direction direction, @Local(argsOnly = true) HopperBlockEntity hopperBlockEntity) {
4343
return ((HopperBlockEntityMixin) (Object) hopperBlockEntity).lithium$getContainerOrHandlerAt(level, pos, direction);
4444
}
4545

46+
@Unique
4647
public ContainerOrHandler lithium$getContainerOrHandlerAt(Level level, BlockPos pos, Direction side) {
4748
return this.lithium$getContainerOrHandlerAt(
4849
level, pos, (double) pos.getX() + 0.5, (double) pos.getY() + 0.5, (double) pos.getZ() + 0.5, side
4950
);
5051
}
5152

53+
@Unique
5254
private ContainerOrHandler lithium$getContainerOrHandlerAt(Level level, BlockPos pos, double x, double y, double z, @javax.annotation.Nullable Direction side) {
5355
Container container = this.lithium$getInsertBlockInventory(level);
5456
if (container != null) {
5557
return new ContainerOrHandler(container, null);
5658
}
5759
BlockState state = level.getBlockState(pos);
58-
var blockItemHandler = level.getCapability(Capabilities.ItemHandler.BLOCK, pos, state, null, side);
60+
var blockItemHandler = level.getCapability(Capabilities.Item.BLOCK, pos, state, null, side);
5961
if (blockItemHandler != null) {
6062
return new ContainerOrHandler(null, blockItemHandler);
6163
}
6264
return VanillaInventoryCodeHooks.getEntityContainerOrHandler(level, x, y, z, side);
6365
}
6466

6567

68+
@Unique
6669
private ContainerOrHandler lithium$getExtractContainerOrHandler(Level level, BlockPos pos, BlockState state, double x, double y, double z, @Nullable Direction side) {
6770
Container container = this.lithium$getExtractBlockInventory(level, pos, state);
6871
if (container != null) {
6972
return new ContainerOrHandler(container, null);
7073
}
71-
var blockItemHandler = level.getCapability(Capabilities.ItemHandler.BLOCK, pos, state, null, side);
74+
var blockItemHandler = level.getCapability(Capabilities.Item.BLOCK, pos, state, null, side);
7275
if (blockItemHandler != null) {
7376
return new ContainerOrHandler(null, blockItemHandler);
7477
}
@@ -82,6 +85,7 @@ private static ContainerOrHandler getContainerOrHandlerAt(Level level, BlockPos
8285
}
8386

8487
//Implemented in common HopperBlockEntityMixin
88+
@Unique
8589
public Container lithium$getExtractBlockInventory(Level world, BlockPos extractBlockPos, BlockState extractBlockState) {
8690
throw new AssertionError();
8791
}

neoforge/src/main/resources/META-INF/neoforge.mods.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Lithium is a free and open-source optimization mod for Minecraft which makes a w
2323
[[dependencies.lithium]]
2424
modId = "minecraft"
2525
type = "required"
26-
versionRange = "1.21.9"
26+
versionRange = "1.21.10"
2727
ordering = "NONE"
2828
side = "BOTH"
2929

0 commit comments

Comments
 (0)