Fix nether portal crash (#70)
This commit is contained in:
parent
fa9ec260ac
commit
ef8723e283
|
@ -0,0 +1,24 @@
|
|||
package io.izzel.arclight.common.mixin.core.command.impl;
|
||||
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.command.impl.GameRuleCommand;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.GameRules;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(GameRuleCommand.class)
|
||||
public class GameRuleCommandMixin {
|
||||
|
||||
@Redirect(method = "func_223485_b", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/MinecraftServer;getGameRules()Lnet/minecraft/world/GameRules;"))
|
||||
private static GameRules arclight$perWorldGameRule(MinecraftServer minecraftServer, CommandContext<CommandSource> context) {
|
||||
return context.getSource().getWorld().getGameRules();
|
||||
}
|
||||
|
||||
@Redirect(method = "func_223486_b", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/MinecraftServer;getGameRules()Lnet/minecraft/world/GameRules;"))
|
||||
private static GameRules arclight$perWorldGameRule2(MinecraftServer minecraftServer, CommandSource source) {
|
||||
return source.getWorld().getGameRules();
|
||||
}
|
||||
}
|
|
@ -112,6 +112,7 @@
|
|||
"command.arguments.EntitySelectorMixin",
|
||||
"command.arguments.EntitySelectorParserMixin",
|
||||
"command.impl.EffectCommandMixin",
|
||||
"command.impl.GameRuleCommandMixin",
|
||||
"command.impl.ReloadCommandMixin",
|
||||
"command.impl.TeleportCommandMixin",
|
||||
"command.impl.TimeCommandMixin",
|
||||
|
|
Loading…
Reference in New Issue
Block a user