本文整理汇总了Java中vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent类的典型用法代码示例。如果您正苦于以下问题:Java MultiblockComponent类的具体用法?Java MultiblockComponent怎么用?Java MultiblockComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MultiblockComponent类属于vazkii.botania.api.lexicon.multiblock.component包,在下文中一共展示了MultiblockComponent类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addComponent
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; //导入依赖的package包/类
/**
* Adds a multiblock component to this multiblock. The component's x y z
* coords should be pivoted to the center of the structure.
*/
public void addComponent(MultiblockComponent component) {
if(getComponentForLocation(component.getRelativePosition()) != null)
throw new IllegalArgumentException("Location in multiblock already occupied");
components.add(component);
changeAxisForNewComponent(component.getRelativePosition());
calculateCostForNewComponent(component);
addComponentToLocationCache(component);
}
开发者ID:VapourDrive,项目名称:Hammerz,代码行数:13,代码来源:Multiblock.java
示例2: copy
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; //导入依赖的package包/类
public Multiblock copy() {
Multiblock mb = new Multiblock();
for(MultiblockComponent comp : getComponents())
mb.addComponent(comp.copy());
return mb;
}
开发者ID:VapourDrive,项目名称:Hammerz,代码行数:8,代码来源:Multiblock.java
示例3: addComponent
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; //导入依赖的package包/类
/**
* Adds a multiblock component to this multiblock. The component's x y z
* coords should be pivoted to the center of the structure.
*/
public void addComponent(MultiblockComponent component) {
if(getComponentForLocation(component.relPos.posX, component.relPos.posY, component.relPos.posZ) != null)
throw new IllegalArgumentException("Location in multiblock already occupied");
components.add(component);
changeAxisForNewComponent(component.relPos.posX, component.relPos.posY, component.relPos.posZ);
calculateCostForNewComponent(component);
addComponentToLocationCache(component);
}
开发者ID:Nincodedo,项目名称:Nincrafty-Things,代码行数:13,代码来源:Multiblock.java
示例4: addComponentToLocationCache
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; //导入依赖的package包/类
/**
* Adds a single component to the location cache
*/
private void addComponentToLocationCache(MultiblockComponent comp) {
ChunkCoordinates pos = comp.getRelativePosition();
locationCache.put(Arrays.asList(
pos.posX,
pos.posY,
pos.posZ
), comp);
}
开发者ID:Nincodedo,项目名称:Nincrafty-Things,代码行数:12,代码来源:Multiblock.java
示例5: calculateCostForNewComponent
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; //导入依赖的package包/类
private void calculateCostForNewComponent(MultiblockComponent comp) {
ItemStack[] materials = comp.getMaterials();
if(materials != null)
for(ItemStack stack : materials)
addStack(stack);
}
开发者ID:VapourDrive,项目名称:Hammerz,代码行数:7,代码来源:Multiblock.java
示例6: getComponents
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; //导入依赖的package包/类
public List<MultiblockComponent> getComponents() {
return components;
}
开发者ID:VapourDrive,项目名称:Hammerz,代码行数:4,代码来源:Multiblock.java
示例7: rotate
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; //导入依赖的package包/类
/**
* Rotates this multiblock by the angle passed in. For the best results, use
* only multiples of pi/2.
*/
public void rotate(double angle) {
for(MultiblockComponent comp : getComponents())
comp.rotate(angle);
updateLocationCache();
}
开发者ID:VapourDrive,项目名称:Hammerz,代码行数:10,代码来源:Multiblock.java
示例8: updateLocationCache
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; //导入依赖的package包/类
/**
* Rebuilds the location cache
*/
public void updateLocationCache() {
locationCache.clear();
for(MultiblockComponent comp : components)
addComponentToLocationCache(comp);
}
开发者ID:VapourDrive,项目名称:Hammerz,代码行数:9,代码来源:Multiblock.java
示例9: addComponentToLocationCache
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; //导入依赖的package包/类
/**
* Adds a single component to the location cache
*/
private void addComponentToLocationCache(MultiblockComponent comp) {
BlockPos pos = comp.getRelativePosition();
locationCache.put(pos, comp);
}
开发者ID:VapourDrive,项目名称:Hammerz,代码行数:8,代码来源:Multiblock.java
示例10: getComponentForLocation
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; //导入依赖的package包/类
/**
* Gets the component for a given location
*/
public MultiblockComponent getComponentForLocation(int x, int y, int z) {
return locationCache.get(Arrays.asList(x, y, z));
}
开发者ID:Nincodedo,项目名称:Nincrafty-Things,代码行数:7,代码来源:Multiblock.java
注:本文中的vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论