generated from jaredlll08/MultiLoader-Template
-
-
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.
Update and fix mixins with examples.
- Loading branch information
1 parent
61af2fa
commit 8737dd4
Showing
14 changed files
with
169 additions
and
17 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
1 change: 0 additions & 1 deletion
1
common/src/main/java/crystalnest/cobweb_mod_template/mixin/.gitkeep
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
common/src/main/java/crystalnest/cobweb_mod_template/mixin/TitleScreenMixin.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,27 @@ | ||
package crystalnest.cobweb_mod_template.mixin; | ||
|
||
import crystalnest.cobweb_mod_template.Constants; | ||
import net.minecraft.client.gui.components.LogoRenderer; | ||
import net.minecraft.client.gui.screens.TitleScreen; | ||
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; | ||
|
||
/** | ||
* Example mixin class. | ||
*/ | ||
@Mixin(TitleScreen.class) | ||
public class TitleScreenMixin { | ||
/** | ||
* Injects at the end of the base constructor to print an example message. | ||
* | ||
* @param fading | ||
* @param logoRenderer | ||
* @param ci | ||
*/ | ||
@Inject(method = "<init>(ZLnet/minecraft/client/gui/components/LogoRenderer;)V", at = @At(value = "TAIL")) | ||
private void onInit(boolean fading, LogoRenderer logoRenderer, CallbackInfo ci) { | ||
Constants.LOGGER.info("Example mixin from " + Constants.PLATFORM.getPlatformName()); | ||
} | ||
} |
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
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
1 change: 0 additions & 1 deletion
1
fabric/src/main/java/crystalnest/cobweb_mod_template/mixin/.gitkeep
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
fabric/src/main/java/crystalnest/cobweb_mod_template/mixin/MinecraftServerMixin.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,40 @@ | ||
package crystalnest.cobweb_mod_template.mixin; | ||
|
||
import com.mojang.datafixers.DataFixer; | ||
import crystalnest.cobweb_mod_template.Constants; | ||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.server.Services; | ||
import net.minecraft.server.WorldStem; | ||
import net.minecraft.server.level.progress.ChunkProgressListenerFactory; | ||
import net.minecraft.server.packs.repository.PackRepository; | ||
import net.minecraft.world.level.storage.LevelStorageSource; | ||
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; | ||
|
||
import java.net.Proxy; | ||
|
||
/** | ||
* Example mixin class. | ||
*/ | ||
@Mixin(MinecraftServer.class) | ||
public class MinecraftServerMixin { | ||
/** | ||
* Injects at the end of the base constructor to print an example message. | ||
* | ||
* @param thread | ||
* @param levelStorageAccess | ||
* @param packRepository | ||
* @param worldStem | ||
* @param proxy | ||
* @param dataFixer | ||
* @param services | ||
* @param chunkProgressListenerFactory | ||
* @param ci | ||
*/ | ||
@Inject(method = "<init>", at = @At(value = "TAIL")) | ||
private void onInit(Thread thread, LevelStorageSource.LevelStorageAccess levelStorageAccess, PackRepository packRepository, WorldStem worldStem, Proxy proxy, DataFixer dataFixer, Services services, ChunkProgressListenerFactory chunkProgressListenerFactory, CallbackInfo ci) { | ||
Constants.LOGGER.info("Example mixin from Fabric"); | ||
} | ||
} |
6 changes: 4 additions & 2 deletions
6
fabric/src/main/resources/cobweb_mod_template.fabric.mixins.json
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
1 change: 0 additions & 1 deletion
1
forge/src/main/java/crystalnest/cobweb_mod_template/mixin/.gitkeep
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
forge/src/main/java/crystalnest/cobweb_mod_template/mixin/MinecraftServerMixin.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,40 @@ | ||
package crystalnest.cobweb_mod_template.mixin; | ||
|
||
import com.mojang.datafixers.DataFixer; | ||
import crystalnest.cobweb_mod_template.Constants; | ||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.server.Services; | ||
import net.minecraft.server.WorldStem; | ||
import net.minecraft.server.level.progress.ChunkProgressListenerFactory; | ||
import net.minecraft.server.packs.repository.PackRepository; | ||
import net.minecraft.world.level.storage.LevelStorageSource; | ||
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; | ||
|
||
import java.net.Proxy; | ||
|
||
/** | ||
* Example mixin class. | ||
*/ | ||
@Mixin(MinecraftServer.class) | ||
public class MinecraftServerMixin { | ||
/** | ||
* Injects at the end of the base constructor to print an example message. | ||
* | ||
* @param thread | ||
* @param levelStorageAccess | ||
* @param packRepository | ||
* @param worldStem | ||
* @param proxy | ||
* @param dataFixer | ||
* @param services | ||
* @param chunkProgressListenerFactory | ||
* @param ci | ||
*/ | ||
@Inject(method = "<init>", at = @At(value = "TAIL")) | ||
private void onInit(Thread thread, LevelStorageSource.LevelStorageAccess levelStorageAccess, PackRepository packRepository, WorldStem worldStem, Proxy proxy, DataFixer dataFixer, Services services, ChunkProgressListenerFactory chunkProgressListenerFactory, CallbackInfo ci) { | ||
Constants.LOGGER.info("Example mixin from Forge"); | ||
} | ||
} |
6 changes: 4 additions & 2 deletions
6
forge/src/main/resources/cobweb_mod_template.forge.mixins.json
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
1 change: 0 additions & 1 deletion
1
neoforge/src/main/java/crystalnest/cobweb_mod_template/mixin/.gitkeep
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
neoforge/src/main/java/crystalnest/cobweb_mod_template/mixin/MinecraftServerMixin.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,40 @@ | ||
package crystalnest.cobweb_mod_template.mixin; | ||
|
||
import com.mojang.datafixers.DataFixer; | ||
import crystalnest.cobweb_mod_template.Constants; | ||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.server.Services; | ||
import net.minecraft.server.WorldStem; | ||
import net.minecraft.server.level.progress.ChunkProgressListenerFactory; | ||
import net.minecraft.server.packs.repository.PackRepository; | ||
import net.minecraft.world.level.storage.LevelStorageSource; | ||
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; | ||
|
||
import java.net.Proxy; | ||
|
||
/** | ||
* Example mixin class. | ||
*/ | ||
@Mixin(MinecraftServer.class) | ||
public class MinecraftServerMixin { | ||
/** | ||
* Injects at the end of the base constructor to print an example message. | ||
* | ||
* @param thread | ||
* @param levelStorageAccess | ||
* @param packRepository | ||
* @param worldStem | ||
* @param proxy | ||
* @param dataFixer | ||
* @param services | ||
* @param chunkProgressListenerFactory | ||
* @param ci | ||
*/ | ||
@Inject(method = "<init>", at = @At(value = "TAIL")) | ||
private void onInit(Thread thread, LevelStorageSource.LevelStorageAccess levelStorageAccess, PackRepository packRepository, WorldStem worldStem, Proxy proxy, DataFixer dataFixer, Services services, ChunkProgressListenerFactory chunkProgressListenerFactory, CallbackInfo ci) { | ||
Constants.LOGGER.info("Example mixin from NeoForge"); | ||
} | ||
} |
6 changes: 4 additions & 2 deletions
6
neoforge/src/main/resources/cobweb_mod_template.neoforge.mixins.json
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