Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 尝试在Minecraft Forge 1.16中创建TileEntity时出错_Java_Minecraft_Minecraft Forge - Fatal编程技术网

Java 尝试在Minecraft Forge 1.16中创建TileEntity时出错

Java 尝试在Minecraft Forge 1.16中创建TileEntity时出错,java,minecraft,minecraft-forge,Java,Minecraft,Minecraft Forge,我收到以下错误: /home/briggs/Documents/code/mc-mods/briggsfirstmod/src/main/java/us/henlo/mods/briggsfirstmod/common/tile/SecondBlockTile.java:40: error: method does not override or implement a method from a supertype @Override ^ /home/briggs/Documents/

我收到以下错误:

/home/briggs/Documents/code/mc-mods/briggsfirstmod/src/main/java/us/henlo/mods/briggsfirstmod/common/tile/SecondBlockTile.java:40: error: method does not override or implement a method from a supertype
  @Override
  ^
/home/briggs/Documents/code/mc-mods/briggsfirstmod/src/main/java/us/henlo/mods/briggsfirstmod/common/tile/SecondBlockTile.java:42: error: cannot find symbol
    super.read(parent);
         ^
  symbol: method read(CompoundNBT)
该文件看起来像:

包us.henlo.mods.briggsfirstmod.common.tile;
导入javax.annotation.Nullable;
导入net.minecraft.entity.player.PlayerEntity;
导入net.minecraft.entity.player.PlayerInventory;
导入net.minecraft.inventory.container.container;
导入net.minecraft.inventory.container.INamedContainerProvider;
进口net.minecraft.nbt.CompoundNBT;
导入net.minecraft.network.NetworkManager;
导入net.minecraft.network.play.server.supdatetileEntityPackage;
导入net.minecraft.tileentity.tileentity;
导入net.minecraft.util.text.ITextComponent;
导入net.minecraft.util.text.TranslationTextComponent;
导入us.henlo.mods.briggsfirstmod.common.InitThing;
公共类SecondBlockTile扩展直到在MedContainerProvider中实现为止{
私人最终目录;
公共第二块砖(){
super(inithing.secondBlockTile);
this.contents=ChestContents.createForTileEntity(108,this::canPlayerAccess,this::markDirty);
}
公共布尔值canPlayerAccess(PlayerEntity pe){
if(this.world.getTileEntity(this.pos)!=this)
返回false;
其他的
返回true;
}
@凌驾
公共CompoundNBT写入(CompoundNBT父级){
super.write(父级);
CompoundNBT invNBT=this.contents.serializeNBT();
母公司。投入(“内容”,invNBT);
返回父母;
}
@凌驾
公共无效读取(复合父级){
超级阅读(家长);
CompoundNBT invNBT=parent.getcomponent(“内容”);
this.contents.deserializeNBT(invNBT);
if(this.contents.getSizeInventory()!=108)
抛出新的IllegalArgumentException(“损坏的NBT:插槽数不匹配!”);
}
@凌驾
@可空
public supdateTileEntityPackage GetUpdatePackage(){
CompoundNBT nbt=新的CompoundNBT();
这个。写(nbt);
返回新的SupdateTileEntityPackage(this.pos,81461,nbt);
}
@凌驾
公共无效数据包(NetworkManager网络,SupdateTileEntityPackage pkt){
this.read(pkt.getnbtcompond());
}
@凌驾
public CompoundNBT getUpdateTag(){
CompoundNBT nbt=新的CompoundNBT();
这个。写(nbt);
返回nbt;
}
@凌驾
public void handleUpdateTag(复合标签){
这个.读(标签);
}
@凌驾
公共ITextComponent getDisplayName(){
返回新的TranslationTextComponent(“container.briggsfirstmod.secondblock”);
}
@凌驾
@可空
公共容器createMenu(int-winId、PlayerInventory、PlayerEntity){
}
}
我知道其中有一些未完成的代码,但问题是
net.minecraft.tileentity.tileentity.read(CompoundNBT)
似乎不存在,尽管我一直在关注/阅读所有教程和其他mod源代码

如果这个问题仍然存在,我不知道如何继续1.16的mod开发


任何帮助都将不胜感激。

根据TileEntity类声明,TileEntity#read()的参数列表应该被读取(BlockState,CompoundNBT nbt),因此我将首先更改它,看看是否有帮助。