mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-12 18:56:04 +00:00
fix refmap issues
This commit is contained in:
@@ -33,7 +33,7 @@ dependencies {
|
||||
|
||||
configure<LoomGradleExtension> {
|
||||
accessWidener("src/main/resources/terra.accesswidener")
|
||||
refmapName = "terra.refmap.json"
|
||||
refmapName = "terra-refmap.json"
|
||||
}
|
||||
|
||||
val remapped = tasks.register<RemapJarTask>("remapShadedJar") {
|
||||
|
||||
@@ -41,7 +41,7 @@ public abstract class EntityMixin {
|
||||
teleport(location.getX(), location.getY(), location.getZ());
|
||||
}
|
||||
|
||||
public World getWorld() {
|
||||
public World terra$getWorld() {
|
||||
return (World) world;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.dfsek.terra.api.platform.inventory.item.ItemMeta;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.spongepowered.asm.mixin.Implements;
|
||||
import org.spongepowered.asm.mixin.Interface;
|
||||
import org.spongepowered.asm.mixin.Intrinsic;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@@ -20,6 +21,9 @@ public abstract class ItemStackMixin {
|
||||
@Shadow
|
||||
public abstract net.minecraft.item.Item getItem();
|
||||
|
||||
@Shadow
|
||||
public abstract boolean isDamageable();
|
||||
|
||||
public int terra$getAmount() {
|
||||
return getCount();
|
||||
}
|
||||
@@ -43,4 +47,9 @@ public abstract class ItemStackMixin {
|
||||
public Object terra$getHandle() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Intrinsic
|
||||
public boolean terra$isDamageable() {
|
||||
return isDamageable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.dfsek.terra.api.platform.inventory.item.Damageable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.spongepowered.asm.mixin.Implements;
|
||||
import org.spongepowered.asm.mixin.Interface;
|
||||
import org.spongepowered.asm.mixin.Intrinsic;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@@ -13,7 +14,23 @@ public abstract class ItemStackDamageableMixin {
|
||||
@Shadow
|
||||
public abstract boolean isDamaged();
|
||||
|
||||
@Shadow
|
||||
public abstract int getDamage();
|
||||
|
||||
@Shadow
|
||||
public abstract void setDamage(int damage);
|
||||
|
||||
public boolean terra$hasDamage() {
|
||||
return isDamaged();
|
||||
}
|
||||
|
||||
@Intrinsic
|
||||
public void terra$setDamage(int damage) {
|
||||
setDamage(damage);
|
||||
}
|
||||
|
||||
@Intrinsic
|
||||
public int terra$getDamage() {
|
||||
return getDamage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.world.ServerWorldAccess;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Implements;
|
||||
import org.spongepowered.asm.mixin.Interface;
|
||||
import org.spongepowered.asm.mixin.Intrinsic;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@@ -28,6 +29,10 @@ public abstract class ChunkRegionMixin {
|
||||
@Final
|
||||
private ServerWorld world;
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private long seed;
|
||||
|
||||
public int terra$getMaxHeight() {
|
||||
return ((ChunkRegion) (Object) this).getDimensionHeight();
|
||||
}
|
||||
@@ -53,6 +58,11 @@ public abstract class ChunkRegionMixin {
|
||||
return (Entity) entity;
|
||||
}
|
||||
|
||||
@Intrinsic
|
||||
public long terra$getSeed() {
|
||||
return seed;
|
||||
}
|
||||
|
||||
public int terra$getMinHeight() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -16,11 +16,16 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.ServerWorldAccess;
|
||||
import org.spongepowered.asm.mixin.Implements;
|
||||
import org.spongepowered.asm.mixin.Interface;
|
||||
import org.spongepowered.asm.mixin.Intrinsic;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(ServerWorld.class)
|
||||
@Implements(@Interface(iface = World.class, prefix = "terra$", remap = Interface.Remap.NONE))
|
||||
public abstract class ServerWorldMixin {
|
||||
@Shadow
|
||||
public abstract long getSeed();
|
||||
|
||||
public int terra$getMaxHeight() {
|
||||
return ((ServerWorld) (Object) this).getDimensionHeight();
|
||||
}
|
||||
@@ -44,6 +49,11 @@ public abstract class ServerWorldMixin {
|
||||
return (Entity) entity;
|
||||
}
|
||||
|
||||
@Intrinsic
|
||||
public long terra$getSeed() {
|
||||
return getSeed();
|
||||
}
|
||||
|
||||
public int terra$getMinHeight() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ apply(plugin = "net.minecraftforge.gradle")
|
||||
apply(plugin = "org.spongepowered.mixin")
|
||||
|
||||
configure<org.spongepowered.asm.gradle.plugins.MixinExtension> {
|
||||
add(sourceSets.main.get(), "terra.refmap.json")
|
||||
add(sourceSets.main.get(), "terra-refmap.json")
|
||||
}
|
||||
|
||||
plugins {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"required": true,
|
||||
"package": "com.dfsek.terra.forge.mixin",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"refmap": "terra.refmap.json",
|
||||
"refmap": "terra-refmap.json",
|
||||
"mixins": [
|
||||
],
|
||||
"client": [
|
||||
|
||||
Reference in New Issue
Block a user