mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 10:44:46 +00:00
Added plenty more documentation for the javadoc.
This commit is contained in:
1 parent
af4b467931
commit
b9266c3cc5
20 files changed
+623
-94
No files matched your search
@@ -18,7 +18,7 @@ import noppes.npcs.scripted.interfaces.*;
|
||||
import noppes.npcs.util.LRUHashMap;
|
||||
|
||||
public class ScriptBlock implements IBlock {
|
||||
private static final Map<String, ScriptBlock> blockCache = new LRUHashMap(400);
|
||||
private static final Map<String, IBlock> blockCache = new LRUHashMap(400);
|
||||
protected final IWorld world;
|
||||
protected final Block block;
|
||||
protected final BlockPos pos;
|
||||
@@ -62,19 +62,19 @@ public class ScriptBlock implements IBlock {
|
||||
return this.block.isAir(this.world.getMCWorld(), getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public ScriptBlock setBlock(String blockName) {
|
||||
public IBlock setBlock(String blockName) {
|
||||
Block block = (Block)Block.blockRegistry.getObject(new ResourceLocation(blockName));
|
||||
if(block == null) {
|
||||
return this;
|
||||
} else {
|
||||
this.world.getMCWorld().setBlock(getX(),getY(),getZ(),block);
|
||||
return new ScriptBlock(this.world.getMCWorld(), block, this.pos);
|
||||
return NpcAPI.Instance().getIBlock(world.getMCWorld(), block, new BlockPos(getX(),getY(),getZ()));
|
||||
}
|
||||
}
|
||||
|
||||
public ScriptBlock setBlock(IBlock block) {
|
||||
public IBlock setBlock(IBlock block) {
|
||||
this.world.getMCWorld().setBlock(getX(),getY(),getZ(),block.getMCBlock());
|
||||
return new ScriptBlock(this.world.getMCWorld(), block.getMCBlock(), this.pos);
|
||||
return NpcAPI.Instance().getIBlock(world.getMCWorld(), block.getMCBlock(), new BlockPos(getX(),getY(),getZ()));
|
||||
}
|
||||
|
||||
public boolean isContainer() {
|
||||
|
||||
Reference in new issue
Block a user