本文整理汇总了Java中org.bukkit.generator.ChunkGenerator.ChunkData类的典型用法代码示例。如果您正苦于以下问题:Java ChunkData类的具体用法?Java ChunkData怎么用?Java ChunkData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChunkData类属于org.bukkit.generator.ChunkGenerator包,在下文中一共展示了ChunkData类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: execute
import org.bukkit.generator.ChunkGenerator.ChunkData; //导入依赖的package包/类
@Override
protected void execute(Event event) {
int x1 = 0;
int y1 = y1Expression.getSingle(event).intValue();
int z1 = 0;
int x2 = 15;
int y2 = y1;
int z2 = 15;
switch (matchedPattern) {
case 0:
x1 = MathUtil.intMod(x1Expression.getSingle(event).intValue(), 16);
z1 = MathUtil.intMod(z1Expression.getSingle(event).intValue(), 16);
x2 = MathUtil.intMod(x2Expression.getSingle(event).intValue(), 16);
z2 = MathUtil.intMod(z2Expression.getSingle(event).intValue(), 16);
break;
case 2:
y2 = y2Expression.getSingle(event).intValue();
}
ChunkData chunkData = chunkDataExpression.getSingle(event);
ItemStack itemStack = itemStackExpression.getSingle(event);
MaterialData materialData = itemStack.getData();
chunkData.setRegion(Math.min(x1, x2), Math.min(y1, y2), Math.min(z1, z2), Math.max(x1, x2) + 1, Math.max(y1, y2) + 1, Math.max(z1, z2) + 1, materialData);
}
开发者ID:MundoSK,项目名称:MundoSK,代码行数:24,代码来源:EffSetRegionInChunkData.java
示例2: get
import org.bukkit.generator.ChunkGenerator.ChunkData; //导入依赖的package包/类
@Override
protected ItemStack[] get(Event event) {
Integer x = MathUtil.intMod(xExpression.getSingle(event).intValue(), 16);
Integer y = yExpression.getSingle(event).intValue();
Integer z = MathUtil.intMod(zExpression.getSingle(event).intValue(), 16);
ChunkData chunkData = chunkDataExpression.getSingle(event);
MaterialData materialData = chunkData.getTypeAndData(x, y, z);
ItemStack result = new ItemStack(materialData.getItemType());
result.setData(materialData);
return new ItemStack[]{result};
}
开发者ID:MundoSK,项目名称:MundoSK,代码行数:12,代码来源:ExprMaterialInChunkData.java
示例3: init
import org.bukkit.generator.ChunkGenerator.ChunkData; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
xExpression = (Expression<Number>) expressions[0];
yExpression = (Expression<Number>) expressions[1];
zExpression = (Expression<Number>) expressions[2];
chunkDataExpression = (Expression<ChunkData>) expressions[3];
return true;
}
开发者ID:MundoSK,项目名称:MundoSK,代码行数:9,代码来源:ExprMaterialInChunkData.java
示例4: change
import org.bukkit.generator.ChunkGenerator.ChunkData; //导入依赖的package包/类
public void change(Event event, Object[] delta, Changer.ChangeMode mode){
Integer x = MathUtil.intMod(xExpression.getSingle(event).intValue(), 16);
Integer y = yExpression.getSingle(event).intValue();
Integer z = MathUtil.intMod(zExpression.getSingle(event).intValue(), 16);
ChunkData chunkData = chunkDataExpression.getSingle(event);
ItemStack itemStack = (ItemStack) delta[0];
MaterialData materialData = itemStack.getData();
chunkData.setBlock(x, y, z, materialData);
}
开发者ID:MundoSK,项目名称:MundoSK,代码行数:10,代码来源:ExprMaterialInChunkData.java
示例5: init
import org.bukkit.generator.ChunkGenerator.ChunkData; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
matchedPattern = i;
switch (matchedPattern) {
case 0:
x1Expression = (Expression<Number>) expressions[0];
y1Expression = (Expression<Number>) expressions[1];
z1Expression = (Expression<Number>) expressions[2];
x2Expression = (Expression<Number>) expressions[3];
y2Expression = (Expression<Number>) expressions[4];
z2Expression = (Expression<Number>) expressions[5];
chunkDataExpression = (Expression<ChunkData>) expressions[6];
itemStackExpression = (Expression<ItemStack>) expressions[7];
break;
case 1:
y1Expression = (Expression<Number>) expressions[0];
chunkDataExpression = (Expression<ChunkData>) expressions[1];
itemStackExpression = (Expression<ItemStack>) expressions[2];
break;
case 2:
y1Expression = (Expression<Number>) expressions[0];
y2Expression = (Expression<Number>) expressions[1];
chunkDataExpression = (Expression<ChunkData>) expressions[2];
itemStackExpression = (Expression<ItemStack>) expressions[3];
}
return true;
}
开发者ID:MundoSK,项目名称:MundoSK,代码行数:28,代码来源:EffSetRegionInChunkData.java
示例6: createChunkData
import org.bukkit.generator.ChunkGenerator.ChunkData; //导入依赖的package包/类
@Override
public ChunkData createChunkData(World world)
{
// TODO Auto-generated method stub
throw new UnimplementedOperationException();
}
开发者ID:seeseemelk,项目名称:MockBukkit,代码行数:7,代码来源:ServerMock.java
示例7: createChunkData
import org.bukkit.generator.ChunkGenerator.ChunkData; //导入依赖的package包/类
@Override
public ChunkData createChunkData(org.bukkit.World arg0) {
// TODO Auto-generated method stub
return null;
}
开发者ID:netherrack,项目名称:netherrack,代码行数:6,代码来源:NetherServer.java
示例8: createChunkData
import org.bukkit.generator.ChunkGenerator.ChunkData; //导入依赖的package包/类
@Override
public ChunkData createChunkData(World world) {
throw new UnsupportedOperationException();
}
开发者ID:DevotedMC,项目名称:ExilePearl,代码行数:5,代码来源:TestServer.java
示例9: createChunkData
import org.bukkit.generator.ChunkGenerator.ChunkData; //导入依赖的package包/类
@Override
public ChunkData createChunkData(World arg0) {
throw Pokkit.unsupported();
}
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:6,代码来源:CraftServer.java
注:本文中的org.bukkit.generator.ChunkGenerator.ChunkData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论