Added fox for eldritch lock

This commit is contained in:
makeo committed 2015-11-09 21:43:38 +01:00
1 parent a5639d6c3f
commit e87d89a0af
2 files changed
+43

No files matched your search

@@ -0,0 +1,34 @@
package makeo.gadomancy.common.blocks.tiles;
import makeo.gadomancy.common.utils.world.TCMazeHandler;
import thaumcraft.common.lib.world.dim.CellLoc;
import thaumcraft.common.lib.world.dim.MazeHandler;
import thaumcraft.common.tiles.TileEldritchLock;
import java.util.concurrent.ConcurrentHashMap;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
* GNU LESSER GENERAL PUBLIC LICENSE
* for more read the LICENSE file
* <p/>
* Created by makeo @ 09.11.2015 21:20
*/
public class TileOverrideEldritchLock extends TileEldritchLock {
@Override
public void updateEntity() {
if (!this.worldObj.isRemote) {
if (this.count != -1) {
if (this.count + 1 > 100) {
ConcurrentHashMap<CellLoc, Short> old = MazeHandler.labyrinth;
MazeHandler.labyrinth = TCMazeHandler.labyrinthCopy;
super.updateEntity();
MazeHandler.labyrinth = old;
return;
}
}
}
super.updateEntity();
}
}
@@ -1,5 +1,6 @@
package makeo.gadomancy.common.utils.world;
import makeo.gadomancy.common.blocks.tiles.TileOverrideEldritchLock;
import makeo.gadomancy.common.utils.world.fake.FakeWorldTCGeneration;
import net.minecraft.block.Block;
import net.minecraft.entity.EnumCreatureType;
@@ -64,6 +65,14 @@ public class ChunkProviderTCOuter implements IChunkProvider {
for(Integer[] pos : buf.tiles) {
TileEntity te = buf.blockData[pos[3]].createTileEntity(worldObj, buf.metaBuffer[pos[3]]);
if(te != null) {
if(te instanceof TileEldritchLock) {
NBTTagCompound compound = new NBTTagCompound();
te.writeToNBT(compound);
TileEntity newTe = new TileOverrideEldritchLock();
newTe.readFromNBT(compound);
te = newTe;
}
worldObj.addTileEntity(te);
chunk.func_150812_a(pos[0] & 15, pos[1], pos[2] & 15, te);
te.blockMetadata = buf.metaBuffer[pos[3]];