Skip to content

Commit

Permalink
don't remap for some (it's bad)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysdh540 committed Sep 29, 2023
1 parent 33a6272 commit 3938ddc
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 30 deletions.
10 changes: 3 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ subprojects { p ->
}

dependencies {
annotationProcessor compileOnly("com.github.LlamaLad7:MixinExtras:${rootProject.mixin_extras}")
annotationProcessor implementation("com.github.LlamaLad7:MixinExtras:${rootProject.mixin_extras}")
if(isForge) { // dont include on fabric
include "com.github.LlamaLad7:MixinExtras:${rootProject.mixin_extras}"
}
Expand Down Expand Up @@ -185,7 +185,6 @@ subprojects { p ->

processResources {
def properties = [
aw : access_widener,
version : mod_version,
minecraft_version: minecraft_version,
forge : forge.split("\\.")[0],
Expand All @@ -195,11 +194,9 @@ subprojects { p ->
create_fabric : create_fabric,
]

inputs.properties properties
exclude '**/*.aw'

filesMatching("architectury.common.json") {
expand properties
}
inputs.properties properties

filesMatching("fabric.mod.json") {
expand properties
Expand Down Expand Up @@ -337,7 +334,6 @@ def makeAccessWidener() {
versionAccessWidenerFile.createNewFile()
versionAccessWidenerFile.text = "accessWidener v2 named"
}
rootProject.ext.set("access_widener", "${rootProject.access_widener_version}.createunlimited.aw")
}

// Defines the mixins
Expand Down
3 changes: 0 additions & 3 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ architectury {
}

repositories {
maven { url "https://maven.shedaniel.me/" }
maven { url = "https://api.modrinth.com/maven" } // LazyDFU
maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu
maven { url = "https://mvn.devos.one/snapshots/" } // Create Fabric, Porting Lib, Forge Tags, Milk Lib, Registrate Fabric
maven { url = "https://cursemaven.com" } // Forge Config API Port
maven { url = "https://maven.cafeteria.dev/releases" } // Fake Player API
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.rdh.createunlimited;

//import com.llamalad7.mixinextras.MixinExtrasBootstrap;
import com.llamalad7.mixinextras.MixinExtrasBootstrap;

import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
Expand All @@ -12,7 +12,7 @@
public class CUMixinConfig implements IMixinConfigPlugin {
@Override
public void onLoad(String mixinPackage) {
// MixinExtrasBootstrap.init();
MixinExtrasBootstrap.init();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.spongepowered.asm.mixin.injection.At;


@Mixin(CarriageContraption.class)
@Mixin(value = CarriageContraption.class)
@SuppressWarnings("unused")
public abstract class CarriageContraptionMixin {
@ModifyExpressionValue(method = "assemble", at = @At(value = "INVOKE", target = "Ljava/util/Map;size()I", ordinal = 0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(CopycatBlock.class)
@Mixin(value = CopycatBlock.class)
@SuppressWarnings("unused")
public abstract class CopycatBlockMixin {
@ModifyExpressionValue(method = "getAcceptedBlockState", at = @At(value = "INVOKE", target = "Lcom/simibubi/create/content/decoration/copycat/CopycatBlock;isAcceptedRegardless(Lnet/minecraft/world/level/block/state/BlockState;)Z"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
import static dev.rdh.createunlimited.Util.doubleRange;
import static dev.rdh.createunlimited.Util.singleRange;

@Mixin(ExtendoGripItem.class)
@Mixin(value = ExtendoGripItem.class, remap = false)
@SuppressWarnings("UnresolvedMixinReference")
public abstract class ExtendoGripItemMixin {

@Redirect(method = {
"holdingExtendoGripIncreasesRange(Lnet/minecraft/world/entity/LivingEntity;)V", // fabric
"holdingExtendoGripIncreasesRange(Lnet/minecraft/class_1309;)V", // fabric obf
"holdingExtendoGripIncreasesRange(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V" // forge
}, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;rangeModifier:Ljava/util/function/Supplier;"))
private static Supplier<Multimap<Attribute, AttributeModifier>> mainSingle() {
Expand All @@ -30,6 +31,7 @@ private static Supplier<Multimap<Attribute, AttributeModifier>> mainSingle() {

@Redirect(method = {
"holdingExtendoGripIncreasesRange(Lnet/minecraft/world/entity/LivingEntity;)V", // fabric
"holdingExtendoGripIncreasesRange(Lnet/minecraft/class_1309;)V", // fabric obf
"holdingExtendoGripIncreasesRange(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V" // forge
}, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;doubleRangeModifier:Ljava/util/function/Supplier;"))
private static Supplier<Multimap<Attribute, AttributeModifier>> mainDouble() {
Expand All @@ -38,6 +40,7 @@ private static Supplier<Multimap<Attribute, AttributeModifier>> mainDouble() {

@Redirect(method = {
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/nbt/CompoundTag;)V", // fabric
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraft/class_1297;Lnet/minecraft/class_2487;)V", // fabric obf
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V" // forge
}, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;rangeModifier:Ljava/util/function/Supplier;"))
private static Supplier<Multimap<Attribute, AttributeModifier>> joinSingle() {
Expand All @@ -46,6 +49,7 @@ private static Supplier<Multimap<Attribute, AttributeModifier>> joinSingle() {

@Redirect(method = {
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/nbt/CompoundTag;)V", // fabric
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraft/class_1297;Lnet/minecraft/class_2487;)V", // fabric obf
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V" // forge
}, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;doubleRangeModifier:Ljava/util/function/Supplier;"))
private static Supplier<Multimap<Attribute, AttributeModifier>> joinDouble() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
/**
* code for client-side modification
*/
@Mixin(SuperGlueSelectionHandler.class)
@Mixin(value = SuperGlueSelectionHandler.class, remap = false)
public abstract class SuperGlueSectionHandlerMixin {
@ModifyConstant(method = "tick", constant = @Constant(doubleValue = 24), remap = false)
@ModifyConstant(method = "tick", constant = @Constant(doubleValue = 24))
private double modifyMaxSuperGlueDistance(double original) {
return CUConfigs.server().maxGlueConnectionRange.get();
}

// @Redirect(method = "tick", at = @At(value = "INVOKE", target = "Ljava/util/Set;contains(Ljava/lang/Object;)Z"), remap = false)
// @Redirect(method = "tick", at = @At(value = "INVOKE", target = "Ljava/util/Set;contains(Ljava/lang/Object;)Z"))
// private boolean modifyNeedsConnected(Set<BlockPos> instance, Object o) {
// return instance.contains((BlockPos) o) || !CUConfigs.server().physicalBlockConnection.get();
// }
//
// @Redirect(method = "onMouseInput", at = @At(value = "INVOKE", target = "Ljava/util/Set;contains(Ljava/lang/Object;)Z"), remap = false)
// @Redirect(method = "onMouseInput", at = @At(value = "INVOKE", target = "Ljava/util/Set;contains(Ljava/lang/Object;)Z"))
// private boolean modifyNeedsConnectedClick(Set<BlockPos> instance, Object o) {
// return instance.contains((BlockPos) o) || !CUConfigs.server().physicalBlockConnection.get();
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
/**
* code for server-side modification
*/
@Mixin(SuperGlueSelectionPacket.class)
@Mixin(value = SuperGlueSelectionPacket.class, remap = false)
public abstract class SuperGlueSelectionPacketMixin {
@ModifyConstant(method = "lambda$handle$0", constant = @Constant(doubleValue = 25), remap = false)
@ModifyConstant(method = "lambda$handle$0", constant = @Constant(doubleValue = 25))
private double modifyMaxSuperGlueDistance(double original) {
return CUConfigs.server().maxGlueConnectionRange.get();
}

//todo make this work
// @Redirect(method = "lambda$handle$0", at = @At(value = "INVOKE", target = "Ljava/util/Set;contains(Ljava/lang/Object;)Z", remap = false), remap = false)
// @Redirect(method = "lambda$handle$0", at = @At(value = "INVOKE", target = "Ljava/util/Set;contains(Ljava/lang/Object;)Z"))
// private boolean modifyNeedsConnected(Set<BlockPos> instance, Object o) {
// return instance.contains((BlockPos) o) || !CUConfigs.server().physicalBlockConnection.get();
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.*;

@Mixin(TrackEdge.class)
@Mixin(value = TrackEdge.class, remap = false)
public abstract class TrackEdgeMixin {
@ModifyConstant(method = "canTravelTo", constant = @Constant(doubleValue = 0.875), remap = false)
@ModifyConstant(method = "canTravelTo", constant = @Constant(doubleValue = 0.875))
private double canTravelTo(double original) {
return CUConfigs.server().extendedDriving.get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(Train.class)
@Mixin(value = Train.class, remap = false)
public abstract class TrainMixin {
@ModifyConstant(method = "tick", constant = @Constant(doubleValue = 4), remap = false)
@ModifyConstant(method = "tick", constant = @Constant(doubleValue = 4))
private double modifyMaxStress(double original) {
double a = CUConfigs.server().maxAllowedStress.get();
return (a == -1) ? Double.MAX_VALUE : a;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(TrainRelocator.class)
@Mixin(value = TrainRelocator.class, remap = false)
public abstract class TrainRelocatorMixin {
@ModifyConstant(method = "onClicked", constant = @Constant(doubleValue = 24), remap = false)
@ModifyConstant(method = "onClicked", constant = @Constant(doubleValue = 24))
private static double modifyMaxTrainRelocatingDistance(double original) {
return CUConfigs.server().maxTrainRelocationDistance.get();
}

@ModifyConstant(method = "clientTick", constant = @Constant(doubleValue = 24), remap = false)
@ModifyConstant(method = "clientTick", constant = @Constant(doubleValue = 24))
private static double modifyMaxTrainRelocatingDistanceClient(double original) {
return CUConfigs.server().maxTrainRelocationDistance.get();
}
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/resources/architectury.common.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "accessWidener": "$aw" }
{ "accessWidener": "createunlimited.accesswidener" }
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false
org.gradle.parallel=true
org.gradle.caching=true

fabric.loom.disableProjectDependentMods = true
fabric.loom.multiProjectOptimisation = true

# gradle plugin versions
arch_plugin_version=3.4.146
Expand Down

0 comments on commit 3938ddc

Please sign in to comment.