Update updateSuppressionBlock for 1.19 (#1401)

* Changed Rule: `updateSuppressionBlock` to match new update suppression

* Make it easier to use

* Carpets mixin file will be the death of me

* Renamed `WorldInterface` to `LevelInterface`
Merged LevelAccessor with LevelInterface

* Fix issues with 22w14a & resolve issues

* Add `@Unique` to Level_tickMixin.java

* Naming, brackets, and description

* Return null on invalid

* Fix remaining refactoring issues
This commit is contained in:
Fx Morin authored and GitHub committed 2022-05-17 21:21:46 +02:00
1 parent a60bc386cb
commit 9daf72b348
11 files changed
+69 -66

No files matched your search

@@ -1,11 +1,13 @@
package carpet.mixins;
import carpet.fakes.WorldInterface;
import carpet.fakes.LevelInterface;
import carpet.helpers.TickSpeed;
import carpet.utils.CarpetProfiler;
import net.minecraft.world.level.redstone.NeighborUpdater;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@@ -19,14 +21,21 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
@Mixin(Level.class)
public abstract class Level_tickMixin implements WorldInterface
public abstract class Level_tickMixin implements LevelInterface
{
@Shadow @Final public boolean isClientSide;
@Shadow @Final protected NeighborUpdater neighborUpdater;
CarpetProfiler.ProfilerToken currentSection;
CarpetProfiler.ProfilerToken entitySection;
Map<EntityType<?>, Entity> precookedMobs = new HashMap<>();
@Override
@Unique
public NeighborUpdater getNeighborUpdater() {
return this.neighborUpdater;
}
public Map<EntityType<?>, Entity> getPrecookedMobs()
{
return precookedMobs;