Compare commits

...

3 commits

Author SHA1 Message Date
Ell
d8122ae7e2 update 2021-06-19 14:53:18 +02:00
Ell
ffede60fee maybe don't leave debug code in 2021-06-19 14:50:36 +02:00
Ell
e6e00191f2 unload pipes when chunks get unloaded
Closes #86
2021-06-19 14:48:47 +02:00
3 changed files with 10 additions and 1 deletions

View file

@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
version = '1.9.3' version = '1.9.4'
group = 'de.ellpeck.prettypipes' // http://maven.apache.org/guides/mini/guide-naming-conventions.html group = 'de.ellpeck.prettypipes' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'PrettyPipes' archivesBaseName = 'PrettyPipes'

View file

@ -253,6 +253,10 @@ public class PipeNetwork implements ICapabilitySerializable<CompoundNBT>, GraphL
return tile; return tile;
} }
public void uncachePipe(BlockPos pos) {
this.tileCache.remove(pos);
}
public List<Pair<BlockPos, ItemStack>> getCurrentlyCrafting(BlockPos node, ItemEquality... equalityTypes) { public List<Pair<BlockPos, ItemStack>> getCurrentlyCrafting(BlockPos node, ItemEquality... equalityTypes) {
this.startProfile("get_currently_crafting"); this.startProfile("get_currently_crafting");
List<Pair<BlockPos, ItemStack>> items = new ArrayList<>(); List<Pair<BlockPos, ItemStack>> items = new ArrayList<>();

View file

@ -89,6 +89,11 @@ public class PipeTileEntity extends TileEntity implements INamedContainerProvide
super(type); super(type);
} }
@Override
public void onChunkUnloaded() {
PipeNetwork.get(this.world).uncachePipe(this.pos);
}
@Override @Override
public CompoundNBT write(CompoundNBT compound) { public CompoundNBT write(CompoundNBT compound) {
compound.put("modules", this.modules.serializeNBT()); compound.put("modules", this.modules.serializeNBT());