WorldEdit

This commit is contained in:
FalsePattern committed 2022-03-22 13:17:19 +01:00
1 parent a6420b7580
commit 14a6897297
6 files changed
+50 -44

No files matched your search

@@ -0,0 +1,36 @@
package com.falsepattern.endlessids.mixin.mixins.common.worldedit;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.sk89q.worldedit.blocks.BaseBlock;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(BaseBlock.class)
public abstract class BaseBlockMixin {
private int idExtended;
/**
* @author FalsePattern
* @reason ID limit extension
*/
@Overwrite
protected final void internalSetId(int id) {
if (id > ExtendedConstants.maxBlockID) {
throw new IllegalArgumentException("Can't have a block ID above " + ExtendedConstants.maxBlockID + " (" + id + " given)");
} else if (id < 0) {
throw new IllegalArgumentException("Can't have a block ID below 0");
} else {
this.idExtended = id;
}
}
/**
* @author FalsePattern
* @reason ID limit extension
*/
@Overwrite
public int getId() {
return idExtended;
}
}
@@ -50,8 +50,11 @@ public enum Mixin {
//END DragonAPI->common
//BEGIN MFQM->common
MFQMMixin(builder(Side.COMMON).target(TargetedMod.MFQM).mixin("mfqm.MFQMMixin")),
MFQMDataWatcherMixin(builder(Side.COMMON).target(TargetedMod.MFQM).condition(() -> IEConfig.extendDataWatcher).mixin("mfqm.MFQMDataWatcherMixin"))
MFQMDataWatcherMixin(builder(Side.COMMON).target(TargetedMod.MFQM).condition(() -> IEConfig.extendDataWatcher).mixin("mfqm.MFQMDataWatcherMixin")),
//END MFQM->common
//BEGIN WorldEdit->common
BaseBlockMixin(builder(Side.COMMON).target(TargetedMod.WORLDEDIT).mixin("worldedit.BaseBlockMixin")),
//END WorldEdit->common
;
public final String mixin;
@@ -11,7 +11,9 @@ public enum TargetedMod {
UBC("Underground Biomes Constructs", "undergroundbiomesconstructs-", "", false),
COFHLIB("CoFH Lib", "cofhlib-", "", false),
DRAGONAPI("DragonAPI", "dragonapi", "", false),
MFQM("More Fun Quicksand Mod", "morefunquicksandmod-", "", false);
MFQM("More Fun Quicksand Mod", "morefunquicksandmod-", "", false),
WORLDEDIT("WorldEdit", "worldedit-", "", false),
;
public final String modName;
public final String jarNamePrefixLowercase;