【发布时间】:2017-02-08 01:00:33
【问题描述】:
当我加载服务器时,控制台在启用插件时只给出这个错误。
TObjectHash 类型的封闭实例在范围内是不可访问的
然后是对 spigot 插件的引用
在 net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [spigot.jar:git-PaperSpigot-a925999]
这个 TObjectHash 来自 trove 存储库,文件中的以下代码是这样的:
package gnu.trove.impl.hash;
import gnu.trove.impl.hash.TObjectHash;
import gnu.trove.strategy.HashingStrategy;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
public abstract class TCustomObjectHash < T >
extends TObjectHash < T > {
static final long serialVersionUID = 8766048185963756400L;
protected HashingStrategy <? super T > strategy;
public TCustomObjectHash() {}
public TCustomObjectHash(HashingStrategy <? super T > strategy) {
this.strategy = strategy;
}
public TCustomObjectHash(HashingStrategy <? super T > strategy, int initialCapacity) {
super(initialCapacity);
this.strategy = strategy;
}
public TCustomObjectHash(HashingStrategy <? super T > strategy, int initialCapacity, float loadFactor) {
super(initialCapacity, loadFactor);
this.strategy = strategy;
}
@Override
protected int hash(Object obj) {
return this.strategy.computeHashCode(obj);
}
@Override
protected boolean equals(Object one, Object two) {
return two != REMOVED && this.strategy.equals(one, two);
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeByte(0);
TObjectHash.super.writeExternal(out);
out.writeObject(this.strategy);
}
@Override
public void readExternal(ObjectInput in ) throws IOException, ClassNotFoundException { in .readByte();
TObjectHash.super.readExternal( in );
this.strategy = (HashingStrategy) in .readObject();
}
}
我在这里错过了什么?
【问题讨论】:
-
注意!这不是 JavaScript!是Java。 Java 之于 Javascript 就像汽车之于地毯。
-
这是你写的插件吗?如果是这样,您必须提供一些插件代码。
标签: java plugins error-handling minecraft bukkit