-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes Sinytra/Connector#415
- Loading branch information
Showing
14 changed files
with
203 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
plugins { | ||
id("dev.architectury.loom") | ||
} | ||
|
||
val versionMc: String by rootProject | ||
val versionForge: String by rootProject | ||
|
||
loom { | ||
forge { | ||
mixinConfig("mixins.connectorextras_continuity_compat.json") | ||
} | ||
mixin { | ||
defaultRefmapName.set("refmap.connectorextras_continuity_compat.json") | ||
} | ||
} | ||
|
||
dependencies { | ||
mappings(loom.officialMojangMappings()) | ||
forge(group = "net.minecraftforge", name = "forge", version = "$versionMc-$versionForge") | ||
|
||
implementation(project(path = ":intermediary-deobf", configuration = "modRuntimeClasspathMainMapped")) | ||
} |
19 changes: 19 additions & 0 deletions
19
...at/src/main/java/dev/su5ed/sinytra/connectorextras/continuitycompat/ContinuityCompat.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,19 @@ | ||
package dev.su5ed.sinytra.connectorextras.continuitycompat; | ||
|
||
import net.minecraftforge.eventbus.api.IEventBus; | ||
import net.minecraftforge.fml.ModList; | ||
import net.minecraftforge.fml.common.Mod; | ||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; | ||
|
||
@Mod(ContinuityCompat.MODID) | ||
public class ContinuityCompat { | ||
public static final String MODID = "connectorextras_continuity_compat"; | ||
public static final String CONTINUITY_MODID = "continuity"; | ||
|
||
public ContinuityCompat() { | ||
if (ModList.get().isLoaded(CONTINUITY_MODID)) { | ||
IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); | ||
bus.addListener(ContinuityCompatSetup::onClientSetup); | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
.../java/dev/su5ed/sinytra/connectorextras/continuitycompat/ContinuityCompatMixinPlugin.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,42 @@ | ||
package dev.su5ed.sinytra.connectorextras.continuitycompat; | ||
|
||
import com.google.common.base.Suppliers; | ||
import net.minecraftforge.fml.loading.LoadingModList; | ||
import org.objectweb.asm.tree.ClassNode; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinInfo; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.function.Supplier; | ||
|
||
public class ContinuityCompatMixinPlugin implements IMixinConfigPlugin { | ||
private static final Supplier<Boolean> CONTINUITY_LOADED = Suppliers.memoize(() -> LoadingModList.get().getModFileById(ContinuityCompat.CONTINUITY_MODID) != null); | ||
|
||
@Override | ||
public void onLoad(String mixinPackage) {} | ||
|
||
@Override | ||
public String getRefMapperConfig() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { | ||
return CONTINUITY_LOADED.get(); | ||
} | ||
|
||
@Override | ||
public List<String> getMixins() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {} | ||
|
||
@Override | ||
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {} | ||
|
||
@Override | ||
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {} | ||
} |
13 changes: 13 additions & 0 deletions
13
...c/main/java/dev/su5ed/sinytra/connectorextras/continuitycompat/ContinuityCompatSetup.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,13 @@ | ||
package dev.su5ed.sinytra.connectorextras.continuitycompat; | ||
|
||
import dev.su5ed.sinytra.connectorextras.continuitycompat.mixin.ModelWrappingHandlerAccessor; | ||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; | ||
|
||
public class ContinuityCompatSetup { | ||
|
||
public static void onClientSetup(FMLClientSetupEvent event) { | ||
ModelWrappingHandlerAccessor.setBLOCK_STATE_MODEL_IDS(ModelWrappingHandlerAccessor.callCreateBlockStateModelIdMap()); | ||
} | ||
|
||
private ContinuityCompatSetup() {} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ev/su5ed/sinytra/connectorextras/continuitycompat/mixin/ModelWrappingHandlerAccessor.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,24 @@ | ||
package dev.su5ed.sinytra.connectorextras.continuitycompat.mixin; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import me.pepperbell.continuity.client.resource.ModelWrappingHandler; | ||
import net.minecraft.client.resources.model.ModelResourceLocation; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Mutable; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
import org.spongepowered.asm.mixin.gen.Invoker; | ||
|
||
@Mixin(ModelWrappingHandler.class) | ||
public interface ModelWrappingHandlerAccessor { | ||
@Accessor | ||
@Mutable | ||
static void setBLOCK_STATE_MODEL_IDS(ImmutableMap<ModelResourceLocation, BlockState> map) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Invoker | ||
static ImmutableMap<ModelResourceLocation, BlockState> callCreateBlockStateModelIdMap() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...a/dev/su5ed/sinytra/connectorextras/continuitycompat/mixin/ModelWrappingHandlerMixin.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,17 @@ | ||
package dev.su5ed.sinytra.connectorextras.continuitycompat.mixin; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import me.pepperbell.continuity.client.resource.ModelWrappingHandler; | ||
import net.minecraft.client.resources.model.ModelResourceLocation; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(ModelWrappingHandler.class) | ||
public class ModelWrappingHandlerMixin { | ||
@Redirect(method = "<clinit>", at = @At(value = "INVOKE", target = "Lme/pepperbell/continuity/client/resource/ModelWrappingHandler;createBlockStateModelIdMap()Lcom/google/common/collect/ImmutableMap;")) | ||
private static ImmutableMap<ModelResourceLocation, BlockState> onClinit() { | ||
return ImmutableMap.of(); | ||
} | ||
} |
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 @@ | ||
modLoader="javafml" | ||
loaderVersion="[47,)" | ||
license="MIT" | ||
issueTrackerURL="https://github.com/Sinytra/ConnectorExtras/issues" | ||
|
||
[[mods]] | ||
modId="connectorextras_continuity_compat" | ||
version="${file.jarVersion}" | ||
displayName="Connector Extras Continuity Compat" | ||
authors="Su5eD" | ||
displayURL="https://github.com/Sinytra/ConnectorExtras" | ||
description=''' | ||
Fixes Continuity's connected textures for modded blocks | ||
''' | ||
displayTest = 'IGNORE_ALL_VERSION' | ||
[[dependencies.connectorextras_continuity_compat]] | ||
modId="forge" | ||
mandatory=true | ||
versionRange="[47,)" | ||
ordering="NONE" | ||
side="BOTH" | ||
[[dependencies.connectorextras_continuity_compat]] | ||
modId="minecraft" | ||
mandatory=true | ||
versionRange="[1.20.1,1.21)" | ||
ordering="NONE" | ||
side="BOTH" |
11 changes: 11 additions & 0 deletions
11
continuity-compat/src/main/resources/mixins.connectorextras_continuity_compat.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_16", | ||
"required": true, | ||
"package": "dev.su5ed.sinytra.connectorextras.continuitycompat.mixin", | ||
"plugin": "dev.su5ed.sinytra.connectorextras.continuitycompat.ContinuityCompatMixinPlugin", | ||
"client": [ | ||
"ModelWrappingHandlerAccessor", | ||
"ModelWrappingHandlerMixin" | ||
] | ||
} |
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,6 @@ | ||
{ | ||
"pack": { | ||
"description": "The default data for connectorextras_continuity_compat", | ||
"pack_format": 15 | ||
} | ||
} |
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
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