This repository has been archived by the owner on Sep 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
111 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/main/java/com/github/wohaopa/replaymodfixmod/MixinPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.github.wohaopa.replaymodfixmod; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinInfo; | ||
import org.spongepowered.libraries.org.objectweb.asm.tree.ClassNode; | ||
|
||
import cpw.mods.fml.relauncher.FMLLaunchHandler; | ||
|
||
public class MixinPlugin implements IMixinConfigPlugin { | ||
|
||
@Override | ||
public void onLoad(String mixinPackage) { | ||
|
||
} | ||
|
||
@Override | ||
public String getRefMapperConfig() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { | ||
|
||
} | ||
|
||
@Override | ||
public List<String> getMixins() { | ||
List<String> mixins = new ArrayList<>(); | ||
if (FMLLaunchHandler.side().isClient()) mixins.add("NetHandlerPlayClientMixin"); | ||
return mixins; | ||
} | ||
|
||
@Override | ||
public void preApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) { | ||
|
||
} | ||
|
||
@Override | ||
public void postApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) { | ||
|
||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/github/wohaopa/replaymodfixmod/ReplayModFixMod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.github.wohaopa.replaymodfixmod; | ||
|
||
import java.util.logging.LogManager; | ||
import java.util.logging.Logger; | ||
|
||
import cpw.mods.fml.common.Mod; | ||
|
||
@Mod( | ||
modid = ReplayModFixMod.MODID, | ||
name = ReplayModFixMod.NAME, | ||
version = ReplayModFixMod.VERSION, | ||
dependencies = "required-after:spongemixins;") | ||
public class ReplayModFixMod { | ||
|
||
public static final Logger LOG = LogManager.getLogManager().getLogger("ReplayModFixMod"); | ||
|
||
public static final String MODID = "replaymodfixmod"; | ||
public static final String NAME = "ReplayMod Fix Mod"; | ||
public static final String VERSION = "1.0.1"; | ||
@Mod.Instance(MODID) | ||
public static ReplayModFixMod instance; | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/github/wohaopa/replaymodfixmod/mixins/NetHandlerPlayClientMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.github.wohaopa.replaymodfixmod.mixins; | ||
|
||
import net.minecraft.client.network.NetHandlerPlayClient; | ||
import net.minecraft.network.play.server.S0CPacketSpawnPlayer; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(NetHandlerPlayClient.class) | ||
public abstract class NetHandlerPlayClientMixin { | ||
|
||
@Inject(method = "handleSpawnPlayer", at = @At("HEAD"), cancellable = true) | ||
public void inject(S0CPacketSpawnPlayer p_147237_1_, CallbackInfo ci) { | ||
if (((NetHandlerPlayClient) (Object) this).gameController.theWorld == null | ||
|| p_147237_1_.func_148948_e() == null) { | ||
ci.cancel(); | ||
System.out.println("Wrong packet: " + p_147237_1_); | ||
} | ||
System.out.println("ReplayModFixMod injected!"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
public net.minecraft.client.network.NetHandlerPlayClient field_147299_f #gameController |
This file was deleted.
Oops, something went wrong.