【问题标题】:No enclosing instance of the type TObjectHash<T> is accessible in scope. Spigot pluginTObjectHash<T> 类型的封闭实例在范围内是不可访问的。插口插件
【发布时间】: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


【解决方案1】:
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-04-02
  • 1970-01-01
  • 2012-09-10
  • 2013-09-12
相关资源
最近更新 更多