Skip to content

Commit

Permalink
fix nbt fluid interface
Browse files Browse the repository at this point in the history
Co-Authored-By: AndreySolodovnikov <[email protected]>
  • Loading branch information
aagrishankov and AndreySolodovnikov committed Dec 16, 2021
1 parent 6790289 commit 9c62182
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/scala/extracells/tileentity/TileEntityFluidInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,18 @@ public void readFromNBT(NBTTagCompound tag) {
this.inventory.readFromNBT(tag.getCompoundTag("inventory"));
if (tag.hasKey("export"))
readOutputFromNBT(tag.getCompoundTag("export"));

for (int i = 0; i < tanks.length; i++) {
if (!tag.hasKey("notShittyFluidID" + i)) {
continue;
}
Fluid fluid = FluidRegistry.getFluid(tag.getString("notShittyFluidID" + i));
if (fluid == null) {
continue;
}
int id = FluidRegistry.getFluidID(fluid);
fluidFilter[i] = id;
}
}

private void readOutputFromNBT(NBTTagCompound tag) {
Expand Down Expand Up @@ -1028,5 +1040,14 @@ public void writeToNBTWithoutExport(NBTTagCompound tag) {
NBTTagCompound inventory = new NBTTagCompound();
this.inventory.writeToNBT(inventory);
tag.setTag("inventory", inventory);

for (int i = 0; i < tanks.length; i++) {
int id = fluidFilter[i];
Fluid fluid = FluidRegistry.getFluid(id);
if (fluid == null) {
continue;
}
tag.setString("notShittyFluidID" + i, FluidRegistry.getFluidName(fluid));
}
}
}

4 comments on commit 9c62182

@Pilad
Copy link

@Pilad Pilad commented on 9c62182 Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сделали же переход с айди на имена жиж. Вот на ИИС ПР https://github.com/IdealIndustrial/EC2Unofficial/pull/10/files

@aagrishankov
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сделали же переход с айди на имена жиж. Вот на ИИС ПР https://github.com/IdealIndustrial/EC2Unofficial/pull/10/files

Тестить то кто будет?)

@Pilad
Copy link

@Pilad Pilad commented on 9c62182 Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сделали же переход с айди на имена жиж. Вот на ИИС ПР https://github.com/IdealIndustrial/EC2Unofficial/pull/10/files

Тестить то кто будет?)

Протестили , в новой версии иис оно уже есть.

@aagrishankov
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

этот комит тоже самое делает что и в иис, только кода меньше :)

Please sign in to comment.