Skip to content

Commit

Permalink
Switch to new remapping system
Browse files Browse the repository at this point in the history
Disable several settings by default that are affected by `@Intrinsic` Injection issue
  • Loading branch information
2No2Name committed Oct 28, 2024
1 parent 11892b8 commit ec624a3
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 42 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ val FABRIC_API_VERSION by extra { "0.106.1+1.21.2" }
val PARCHMENT_VERSION by extra { null }

// https://semver.org/
val MOD_VERSION by extra { "0.14.0-alpha.1" }
val MOD_VERSION by extra { "0.14.1" }

allprojects {
apply(plugin = "java")
Expand Down
1 change: 1 addition & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ sourceSets {
loom {
mixin {
defaultRefmapName = "lithium.refmap.json"
useLegacyMixinAp = false
}

accessWidenerPath = file("src/main/resources/lithium.accesswidener")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
@MixinConfigDependency(dependencyPath = "mixin.util.block_entity_retrieval"),
@MixinConfigDependency(dependencyPath = "mixin.util.inventory_change_listening"),
@MixinConfigDependency(dependencyPath = "mixin.util.item_component_and_count_tracking")
}
},
enabled = false //TODO fix Intrinsic issue then re-enable
)
package net.caffeinemc.mods.lithium.mixin.block.hopper;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@MixinConfigOption(
description = "Block updates skip notifying mobs that won't react to the block update anyways",
depends = @MixinConfigDependency(dependencyPath = "mixin.util.data_storage")
depends = @MixinConfigDependency(dependencyPath = "mixin.util.data_storage"),
enabled = false //TODO fix Intrinsic issue then re-enable
)
package net.caffeinemc.mods.lithium.mixin.entity.inactive_navigations;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@MixinConfigOption(
description = "Reduces the sine table size to reduce memory usage and increase access speed. Broken in 1.21.2 and 1.21.3.",
enabled = false
)
@MixinConfigOption(description = "Reduces the sine table size to reduce memory usage and increase access speed")
package net.caffeinemc.mods.lithium.mixin.math.sine_lut;

import net.caffeinemc.gradle.MixinConfigOption;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package net.caffeinemc.mods.lithium.mixin.minimal_nonvanilla.world.expiring_chunk_tickets;

import com.llamalad7.mixinextras.sugar.Local;
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectIterator;
import net.caffeinemc.mods.lithium.common.util.collections.ChunkTicketSortedArraySet;
import net.minecraft.server.level.DistanceManager;
import net.minecraft.server.level.Ticket;
Expand Down Expand Up @@ -116,13 +116,13 @@ private boolean retCanNoneExpire(SortedArraySet<Ticket<?>> tickets) {
return canNoneExpire(tickets);
}

@Inject(method = "purgeStaleTickets()V", locals = LocalCapture.CAPTURE_FAILHARD,
@Inject(method = "purgeStaleTickets()V",
at = @At(
value = "INVOKE", shift = At.Shift.BEFORE,
value = "INVOKE",
target = "Lnet/minecraft/util/SortedArraySet;isEmpty()Z"
)
)
private void removeIfEmpty(CallbackInfo ci, ObjectIterator<?> objectIterator, Long2ObjectMap.Entry<SortedArraySet<Ticket<?>>> entry) {
private void removeIfEmpty(CallbackInfo ci, @Local Long2ObjectMap.Entry<SortedArraySet<Ticket<?>>> entry) {
SortedArraySet<Ticket<?>> ticketsAtPos = entry.getValue();
if (ticketsAtPos.isEmpty()) {
this.tickets.remove(entry.getLongKey(), ticketsAtPos);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@MixinConfigOption(description = "Only check positions with expiring tickets during ticket expiration." +
" Can cause reordering of chunks unloading. The chunk unloading order in vanilla is predictable, but depends" +
" on the hash of the chunk position of the tickets and the hashes of the other chunk tickets, and the order" +
" of creation of the chunk tickets when hash collisions occur. No known contraptions depend on the unload order.")
" of creation of the chunk tickets when hash collisions occur. No known contraptions depend on the unload order.",
enabled = false // TODO fix injection failure on fabric outside dev env
)
package net.caffeinemc.mods.lithium.mixin.minimal_nonvanilla.world.expiring_chunk_tickets;
import net.caffeinemc.gradle.MixinConfigOption;
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@MixinConfigOption(description = "Entity shape contexts initialize rarely used fields only on first use")
@MixinConfigOption(description = "Entity shape contexts initialize rarely used fields only on first use",
enabled = false //TODO fix Intrinsic issue then re-enable
)
package net.caffeinemc.mods.lithium.mixin.shapes.lazy_shape_context;

import net.caffeinemc.gradle.MixinConfigOption;
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@MixinConfigOption(description = "Certain BlockEntity Inventories emit updates to their listeners when their stack list is changed or the inventory becomes invalid")
@MixinConfigOption(description = "Certain BlockEntity Inventories emit updates to their listeners when their stack list is changed or the inventory becomes invalid",
enabled = false //TODO fix Intrinsic issue then re-enable
)
package net.caffeinemc.mods.lithium.mixin.util.inventory_change_listening;

import net.caffeinemc.gradle.MixinConfigOption;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
description = "BlockEntity Inventories update their listeners when a comparator is placed near them",
depends = {
@MixinConfigDependency(dependencyPath = "mixin.util.block_entity_retrieval")
}
},
enabled = false //TODO fix Intrinsic issue then re-enable
)
package net.caffeinemc.mods.lithium.mixin.util.inventory_comparator_tracking;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@MixinConfigOption(description = "BlockEntity sleeping for inactive brewing stands")
@MixinConfigOption(description = "BlockEntity sleeping for inactive brewing stands",
enabled = false //TODO fix Intrinsic issue then re-enable
)
package net.caffeinemc.mods.lithium.mixin.world.block_entity_ticking.sleeping.brewing_stand;

import net.caffeinemc.gradle.MixinConfigOption;
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@MixinConfigOption(description = "BlockEntity sleeping for inactive furnaces")
@MixinConfigOption(description = "BlockEntity sleeping for inactive furnaces",
enabled = false //TODO fix Intrinsic issue then re-enable
)
package net.caffeinemc.mods.lithium.mixin.world.block_entity_ticking.sleeping.furnace;

import net.caffeinemc.gradle.MixinConfigOption;
5 changes: 3 additions & 2 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ loom {
if (project(":common").file("src/main/resources/lithium.accesswidener").exists())
accessWidenerPath.set(project(":common").file("src/main/resources/lithium.accesswidener"))

@Suppress("UnstableApiUsage")
mixin { defaultRefmapName.set("lithium-fabric.refmap.json") }
mixin {
useLegacyMixinAp = false
}

runs {
create("fabricClient") {
Expand Down
3 changes: 2 additions & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
]
},
"mixins": [
"lithium.mixins.json", "lithium-fabric.mixins.json"
"lithium.mixins.json",
"lithium-fabric.mixins.json"
],
"accessWidener": "lithium.accesswidener",
"depends": {
Expand Down
29 changes: 18 additions & 11 deletions lithium-fabric-mixin-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ FluidStates store directly whether they are empty
Fluid optimizations

### `mixin.block.fluid.flow`

(default: `true`)
Fluid flow optimization

### `mixin.block.hopper`
(default: `true`)

(default: `false`)
Reduces hopper lag using caching, notification systems and BlockEntity sleeping
Requirements:
- `mixin.util.entity_movement_tracking=true`
Expand Down Expand Up @@ -317,7 +317,8 @@ Skip checking whether an entity is inside powder snow for movement speed slowdow
Access entities faster when accessing a relatively small number of entity sections

### `mixin.entity.inactive_navigations`
(default: `true`)

(default: `false`)
Block updates skip notifying mobs that won't react to the block update anyways
Requirements:
- `mixin.util.data_storage=true`
Expand Down Expand Up @@ -406,8 +407,8 @@ Avoid indirection and inline several functions in Direction, Axis and Box code

### `mixin.math.sine_lut`

(default: `false`)
Reduces the sine table size to reduce memory usage and increase access speed. Broken in 1.21.2 and 1.21.3.
(default: `true`)
Reduces the sine table size to reduce memory usage and increase access speed


### `mixin.minimal_nonvanilla`
Expand Down Expand Up @@ -437,7 +438,8 @@ Requirements:
- `mixin.world.block_entity_ticking=true`

### `mixin.minimal_nonvanilla.world.expiring_chunk_tickets`
(default: `true`)

(default: `false`)
Only check positions with expiring tickets during ticket expiration. Can cause reordering of chunks unloading. The chunk unloading order in vanilla is predictable, but depends on the hash of the chunk position of the tickets and the hashes of the other chunk tickets, and the order of creation of the chunk tickets when hash collisions occur. No known contraptions depend on the unload order.

### `mixin.shapes`
Expand All @@ -449,7 +451,8 @@ Various VoxelShape optimizations
Use a faster collection for the full cube test cache

### `mixin.shapes.lazy_shape_context`
(default: `true`)

(default: `false`)
Entity shape contexts initialize rarely used fields only on first use

### `mixin.shapes.optimized_matching`
Expand Down Expand Up @@ -515,11 +518,13 @@ Requirements:
Entity sections store their position

### `mixin.util.inventory_change_listening`
(default: `true`)

(default: `false`)
Certain BlockEntity Inventories emit updates to their listeners when their stack list is changed or the inventory becomes invalid

### `mixin.util.inventory_comparator_tracking`
(default: `true`)

(default: `false`)
BlockEntity Inventories update their listeners when a comparator is placed near them
Requirements:
- `mixin.util.block_entity_retrieval=true`
Expand All @@ -545,7 +550,8 @@ Various BlockEntity ticking optimizations
Allows BlockEntities to sleep, meaning they are no longer ticked until woken up, e.g. by updates to their inventory or block state

### `mixin.world.block_entity_ticking.sleeping.brewing_stand`
(default: `true`)

(default: `false`)
BlockEntity sleeping for inactive brewing stands

### `mixin.world.block_entity_ticking.sleeping.campfire`
Expand All @@ -561,7 +567,8 @@ BlockEntity sleeping for inactive lit campfires
BlockEntity sleeping for inactive unlit campfires

### `mixin.world.block_entity_ticking.sleeping.furnace`
(default: `true`)

(default: `false`)
BlockEntity sleeping for inactive furnaces

### `mixin.world.block_entity_ticking.sleeping.hopper`
Expand Down
29 changes: 18 additions & 11 deletions lithium-neoforge-mixin-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ FluidStates store directly whether they are empty
Fluid optimizations

### `mixin.block.fluid.flow`

(default: `true`)
Fluid flow optimization

### `mixin.block.hopper`
(default: `true`)

(default: `false`)
Reduces hopper lag using caching, notification systems and BlockEntity sleeping
Requirements:
- `mixin.util.entity_movement_tracking=true`
Expand Down Expand Up @@ -300,7 +300,8 @@ Skip checking whether an entity is inside powder snow for movement speed slowdow
Access entities faster when accessing a relatively small number of entity sections

### `mixin.entity.inactive_navigations`
(default: `true`)

(default: `false`)
Block updates skip notifying mobs that won't react to the block update anyways
Requirements:
- `mixin.util.data_storage=true`
Expand Down Expand Up @@ -383,8 +384,8 @@ Avoid indirection and inline several functions in Direction, Axis and Box code

### `mixin.math.sine_lut`

(default: `false`)
Reduces the sine table size to reduce memory usage and increase access speed. Broken in 1.21.2 and 1.21.3.
(default: `true`)
Reduces the sine table size to reduce memory usage and increase access speed


### `mixin.minimal_nonvanilla`
Expand Down Expand Up @@ -414,7 +415,8 @@ Requirements:
- `mixin.world.block_entity_ticking=true`

### `mixin.minimal_nonvanilla.world.expiring_chunk_tickets`
(default: `true`)

(default: `false`)
Only check positions with expiring tickets during ticket expiration. Can cause reordering of chunks unloading. The chunk unloading order in vanilla is predictable, but depends on the hash of the chunk position of the tickets and the hashes of the other chunk tickets, and the order of creation of the chunk tickets when hash collisions occur. No known contraptions depend on the unload order.

### `mixin.shapes`
Expand All @@ -426,7 +428,8 @@ Various VoxelShape optimizations
Use a faster collection for the full cube test cache

### `mixin.shapes.lazy_shape_context`
(default: `true`)

(default: `false`)
Entity shape contexts initialize rarely used fields only on first use

### `mixin.shapes.optimized_matching`
Expand Down Expand Up @@ -496,11 +499,13 @@ Requirements:
Entity sections store their position

### `mixin.util.inventory_change_listening`
(default: `true`)

(default: `false`)
Certain BlockEntity Inventories emit updates to their listeners when their stack list is changed or the inventory becomes invalid

### `mixin.util.inventory_comparator_tracking`
(default: `true`)

(default: `false`)
BlockEntity Inventories update their listeners when a comparator is placed near them
Requirements:
- `mixin.util.block_entity_retrieval=true`
Expand All @@ -526,7 +531,8 @@ Various BlockEntity ticking optimizations
Allows BlockEntities to sleep, meaning they are no longer ticked until woken up, e.g. by updates to their inventory or block state

### `mixin.world.block_entity_ticking.sleeping.brewing_stand`
(default: `true`)

(default: `false`)
BlockEntity sleeping for inactive brewing stands

### `mixin.world.block_entity_ticking.sleeping.campfire`
Expand All @@ -542,7 +548,8 @@ BlockEntity sleeping for inactive lit campfires
BlockEntity sleeping for inactive unlit campfires

### `mixin.world.block_entity_ticking.sleeping.furnace`
(default: `true`)

(default: `false`)
BlockEntity sleeping for inactive furnaces

### `mixin.world.block_entity_ticking.sleeping.hopper`
Expand Down

0 comments on commit ec624a3

Please sign in to comment.