mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-12 07:17:31 +00:00
make MFQM way faster to load
This commit is contained in:
1 file changed
+16
@@ -3,9 +3,15 @@ package com.falsepattern.endlessids.mixin.mixins.common.mfqm;
|
||||
import MoreFunQuicksandMod.main.MFQM;
|
||||
import com.falsepattern.endlessids.constants.ExtendedConstants;
|
||||
import com.falsepattern.endlessids.constants.VanillaConstants;
|
||||
import lombok.val;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
@Mixin(value = MFQM.class,
|
||||
remap = false)
|
||||
@@ -25,4 +31,14 @@ public abstract class MFQMMixin {
|
||||
private int extendIDs(int constant) {
|
||||
return ExtendedConstants.maxBlockID;
|
||||
}
|
||||
|
||||
@Redirect(method = "postInit",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/block/Block;getBlockById(I)Lnet/minecraft/block/Block;",
|
||||
remap = true),
|
||||
require = 1)
|
||||
private Block getBlockByIDNullable(int id) {
|
||||
val block = Block.getBlockById(id);
|
||||
return block == Blocks.air ? null : block;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user