Skip to content

Commit

Permalink
- 兼容某些模组的沟槽反射。
Browse files Browse the repository at this point in the history
  • Loading branch information
KasumiNova committed Oct 8, 2024
1 parent 298eded commit ef416e7
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ public class MixinNBTBase implements StellarPooledNBT {
private boolean stellar_core$pooled = false;

@Override
public NBTBase stellar_core$getPooledNBT() {
return (NBTBase) (Object) this;
@SuppressWarnings("RedundantCast")
public Object stellar_core$getPooledNBT() {
return (Object) this;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public abstract class MixinNBTTagByte extends NBTBase implements StellarPooledNBT {

@Override
public NBTBase stellar_core$getPooledNBT() {
public Object stellar_core$getPooledNBT() {
return NBTTagPrimitivePool.getTagByte((NBTTagByte) (Object) this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void setTag(String key, NBTBase value) {
if (value == null) {
throw new IllegalArgumentException("Invalid null NBT value with key " + key);
}
this.tagMap.put(key, ((StellarPooledNBT) value).stellar_core$getPooledNBT());
this.tagMap.put(key, (NBTBase) ((StellarPooledNBT) value).stellar_core$getPooledNBT());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public abstract class MixinNBTTagDouble implements StellarPooledNBT {

@Override
public NBTBase stellar_core$getPooledNBT() {
public Object stellar_core$getPooledNBT() {
return NBTTagPrimitivePool.getTagDouble((NBTTagDouble) (Object) this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public abstract class MixinNBTTagFloat implements StellarPooledNBT {

@Override
public NBTBase stellar_core$getPooledNBT() {
public Object stellar_core$getPooledNBT() {
return NBTTagPrimitivePool.getTagFloat((NBTTagFloat) (Object) this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public abstract class MixinNBTTagInt implements StellarPooledNBT {

@Override
public NBTBase stellar_core$getPooledNBT() {
public Object stellar_core$getPooledNBT() {
return NBTTagPrimitivePool.getTagInt((NBTTagInt) (Object) this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public abstract class MixinNBTTagLong implements StellarPooledNBT {

@Override
public NBTBase stellar_core$getPooledNBT() {
public Object stellar_core$getPooledNBT() {
return NBTTagPrimitivePool.getTagLong((NBTTagLong) (Object) this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public abstract class MixinNBTTagShort implements StellarPooledNBT {

@Override
public NBTBase stellar_core$getPooledNBT() {
public Object stellar_core$getPooledNBT() {
return NBTTagPrimitivePool.getTagShort((NBTTagShort) (Object) this);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package github.kasuminova.stellarcore.mixin.util;

import net.minecraft.nbt.NBTBase;

public interface StellarPooledNBT {

NBTBase stellar_core$getPooledNBT();
Object stellar_core$getPooledNBT();

boolean stellar_core$isPooled();

Expand Down

0 comments on commit ef416e7

Please # to comment.