本文整理汇总了Java中thaumcraft.common.config.Config类的典型用法代码示例。如果您正苦于以下问题:Java Config类的具体用法?Java Config怎么用?Java Config使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Config类属于thaumcraft.common.config包,在下文中一共展示了Config类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: taintplosion
import thaumcraft.common.config.Config; //导入依赖的package包/类
public static void taintplosion(World world, int x, int y, int z, boolean taintBiome, int chanceToTaint, float str, int size, int blocksAffected) {
if(chanceToTaint < 1) chanceToTaint = 1;
world.createExplosion(null, x + 0.5D, y + 0.5D, z + 0.5D, str, false);
for (int a = 0; a < blocksAffected; a++) {
int xx = x + world.rand.nextInt(size) - world.rand.nextInt(size);
int yy = y + world.rand.nextInt(size) - world.rand.nextInt(size);
int zz = z + world.rand.nextInt(size) - world.rand.nextInt(size);
if (world.isAirBlock(xx, yy, zz)) {
if (yy < y) {
world.setBlock(xx, yy, zz, ConfigBlocks.blockFluxGoo, 8, 3);
} else {
world.setBlock(xx, yy, zz, ConfigBlocks.blockFluxGas, 8, 3);
}
}
if(!Config.genTaint) continue;
if(taintBiome && world.rand.nextInt(chanceToTaint) == 0) {
Utils.setBiomeAt(world, xx, zz, ThaumcraftWorldGenerator.biomeTaint);
}
}
}
示例2: cleanseBiomeAroundTile
import thaumcraft.common.config.Config; //导入依赖的package包/类
public static void cleanseBiomeAroundTile(TileEntity tile) {
if (!tile.getWorldObj().isRemote && tile.getWorldObj().rand.nextInt(35) == 0) {
int x = tile.getWorldObj().rand.nextInt(5) - 2;
int z = tile.getWorldObj().rand.nextInt(5) - 2;
int tileBiome = tile.getWorldObj().getBiomeGenForCoords(x + tile.xCoord, z + tile.zCoord).biomeID;
if (tileBiome == Config.biomeTaintID || tileBiome == Config.biomeEerieID || tileBiome == Config.biomeMagicalForestID) {
BiomeGenBase[] biomesForGeneration = null;
biomesForGeneration = tile.getWorldObj().getWorldChunkManager().loadBlockGeneratorData(biomesForGeneration, x + tile.xCoord, z + tile.zCoord, 1, 1);
if (biomesForGeneration != null && biomesForGeneration.length > 0 && biomesForGeneration[0] != null) {
BiomeGenBase biome = biomesForGeneration[0];
Utils.setBiomeAt(tile.getWorldObj(), x + tile.xCoord, z + tile.zCoord, biome);
}
}
}
}
示例3: shouldExecute
import thaumcraft.common.config.Config; //导入依赖的package包/类
@Override
public boolean shouldExecute() {
if (golem.ticksExisted % Config.golemDelay > 0) {
return false;
}
currentMarker = getNextMarker();
if(!hasValidTool()) {
if(isInHomeRange()) {
return true;
}
return false;
}
return currentMarker != null;
}
示例4: postInit
import thaumcraft.common.config.Config; //导入依赖的package包/类
public static void postInit() {
ResearchItem researchJar = PseudoResearchItem.create("JARLABEL", -3, -7).registerResearchItem();
RecipeVisualStickyJar visualRecipe = new RecipeVisualStickyJar();
ResearchPage page = new ResearchPage(visualRecipe);
researchStickyJar = new StickyJarResearchItem("STICKYJAR", -5, -5, 2,
new AspectList().add(Aspect.SLIME, 8).add(Aspect.EARTH, 8))
.setParents(researchJar.key).setConcealed()
.setPages(new ResearchPage("gadomancy.research_page.STICKYJAR.1"), page).registerResearchItem();
if(researchBlockProtector != null) {
researchBlockProtector.setParents(researchStickyJar.key);
}
String[] parents = Config.allowMirrors ? new String[] { researchJar.key, "MIRRORESSENTIA" } : new String[] { researchJar.key };
researchRemoteJar = new SimpleResearchItem("REMOTEJAR", -4, -3, 3,
RegisteredRecipes.recipeRemoteJar.getRecipeOutput(),
new AspectList().add(Aspect.WATER, 4).add(Aspect.MECHANISM, 8).add(Aspect.EARTH, 4).add(Aspect.ORDER, 8))
.setParents(parents).setConcealed()
.setPages(new ResearchPage("gadomancy.research_page.REMOTEJAR.1"), new ResearchPage(RegisteredRecipes.recipeRemoteJar), new ResearchPage("gadomancy.research_page.REMOTEJAR.2")).registerResearchItem();
//Aura researches
AuraResearchManager.registerAuraResearches();
}
示例5: hasBeaconEffect
import thaumcraft.common.config.Config; //导入依赖的package包/类
public boolean hasBeaconEffect(EntityLivingBase user){
if(user != null){
PotionEffect[] effects = (PotionEffect[])user.getActivePotionEffects().toArray(new PotionEffect[]{});
if(ignorePotions.size() == 0 && 0 < effects.length)
{
this.ignorePotions.add(Config.potionVisExhaustID);
this.ignorePotions.add(Config.potionInfVisExhaustID);
this.ignorePotions.add(Config.potionBlurredID);
this.ignorePotions.add(Config.potionThaumarhiaID);
this.ignorePotions.add(Config.potionTaintPoisonID);
this.ignorePotions.add(Config.potionUnHungerID);
this.ignorePotions.add(Config.potionSunScornedID);
this.ignorePotions.add(Config.potionWarpWardID);
this.ignorePotions.add(Config.potionDeathGazeID);
}
for(PotionEffect effect : effects){
if(!this.ignorePotions.contains(effect.getPotionID()) && effect.getIsAmbient()){
return true;
}
}
}
return false;
}
示例6: onItemRightClick
import thaumcraft.common.config.Config; //导入依赖的package包/类
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if (Config.researchDifficulty != -1 && stack.getItemDamage() >= 100) {
if (!world.isRemote) {
Aspect aspect;
short amount;
for(Iterator count = Aspect.getPrimalAspects().iterator(); count.hasNext(); PacketHandler.INSTANCE.sendTo(new PacketAspectPool(aspect.getTag(), Short.valueOf(amount), Short.valueOf(Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), aspect))), (EntityPlayerMP)player))
{
aspect = (Aspect)count.next();
amount = (short)(world.rand.nextInt(4) + 4);
Thaumcraft.proxy.playerKnowledge.addAspectPool(player.getCommandSenderName(), aspect, amount);
ResearchManager.scheduleSave(player);
}
}
player.swingItem();
return new ItemStack(ConfigItems.itemInkwell, 1, 100);
} else
return stack;
}
示例7: onUpdate
import thaumcraft.common.config.Config; //导入依赖的package包/类
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isSelected) {
if(world.isRemote)
return;
if(Config.researchDifficulty == -1 && entity.ticksExisted % 200 == 0 && (entity instanceof EntityPlayer)){
EntityPlayer player = (EntityPlayer)entity;
Aspect aspect = (Aspect)Aspect.getPrimalAspects().get(world.rand.nextInt(6));
short amount = (short)(world.rand.nextInt(4) + 1);
Thaumcraft.proxy.playerKnowledge.addAspectPool(player.getCommandSenderName(), aspect, amount);
PacketHandler.INSTANCE.sendTo(new PacketAspectPool(aspect.getTag(), amount, Short.valueOf(Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), aspect))), (EntityPlayerMP) player);
ResearchManager.scheduleSave(player);
stack.setItemDamage(stack.getItemDamage() + 1);
if(stack.getItemDamage() >= stack.getMaxDamage())
((EntityPlayer)entity).inventory.setInventorySlotContents(slot, null);
}
}
示例8: renderTileEntityAt
import thaumcraft.common.config.Config; //导入依赖的package包/类
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
if(te.getWorldObj().provider.dimensionId == ModConfig.dimOuterId) {
int old = Config.dimensionOuterId;
Config.dimensionOuterId = ModConfig.dimOuterId;
super.renderTileEntityAt(te, x, y, z, f);
Config.dimensionOuterId = old;
} else {
super.renderTileEntityAt(te, x, y, z, f);
}
}
示例9: doBlockEffect
import thaumcraft.common.config.Config; //导入依赖的package包/类
@Override
public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {
if(!Config.genTaint) return;
int x = selectedBlock.posX;
int y = selectedBlock.posY;
int z = selectedBlock.posZ;
BlockTaintFibres.spreadFibres(world, x, y, z);
if(world.rand.nextInt(12) == 0) {
Utils.setBiomeAt(world, x, z, ThaumcraftWorldGenerator.biomeTaint);
world.addBlockEvent(x, y, z, world.getBlock(x, y, z), 1, 0);
}
}
示例10: BlockWitor
import thaumcraft.common.config.Config; //导入依赖的package包/类
protected BlockWitor() {
super(Config.airyMaterial);
setBlockName(BlockLib.BLOCK_WITOR_NAME);
setStepSound(Block.soundTypeCloth);
setCreativeTab(TWarden.tabTWarden);
setBlockBounds(0.3F, 0.3F, 0.3F, 0.7F, 0.7F, 0.7F);
}
示例11: drawScreen
import thaumcraft.common.config.Config; //导入依赖的package包/类
/**
* Draws all screen elements, specifically calling on TC to draw the aspects
* of whatever the mouse is over.
*/
@Override
public void drawScreen( final int mouseX, final int mouseY, final float mouseBtn )
{
// Call super
super.drawScreen( mouseX, mouseY, mouseBtn );
// Show TC aspects for items in the ME network.
if( ( this.meAspectBridge != null ) && ( !Config.showTags == Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) ) )
{
this.meAspectBridge.renderAspects( this, this.player );
}
}
示例12: registerPseudoParents
import thaumcraft.common.config.Config; //导入依赖的package包/类
@Override
protected void registerPseudoParents()
{
if( Config.wardedStone )
{
PseudoResearchTypes.WARDED.registerPsudeoResearch();
}
PseudoResearchTypes.DISTILESSENTIA.registerPsudeoResearch();
}
示例13: registerPseudoParents
import thaumcraft.common.config.Config; //导入依赖的package包/类
@Override
protected void registerPseudoParents()
{
PseudoResearchTypes.INFUSION.registerPsudeoResearch();
if( Config.allowMirrors )
{
PseudoResearchTypes.MIRROR.registerPsudeoResearch();
}
else
{
PseudoResearchTypes.JAR.registerPsudeoResearch();
}
}
示例14: registerResearch
import thaumcraft.common.config.Config; //导入依赖的package包/类
@Override
protected void registerResearch()
{
// Set the research aspects
AspectList infusionProviderList = new AspectList();
infusionProviderList.add( Aspect.MECHANISM, 3 );
infusionProviderList.add( Aspect.MAGIC, 3 );
infusionProviderList.add( Aspect.EXCHANGE, 7 );
infusionProviderList.add( Aspect.MOTION, 7 );
infusionProviderList.add( Aspect.SENSES, 5 );
// Set the icon
ItemStack infusionProviderIcon = new ItemStack( BlockEnum.INFUSION_PROVIDER.getBlock(), 1 );
// Set the pages
ResearchPage[] infusionProviderPages = new ResearchPage[] { new ResearchPage( ResearchTypes.INFUSION_PROVIDER.getPageName( 1 ) ),
new ResearchPage( RecipeRegistry.BLOCK_INFUSION_PROVIDER ) };
// Are mirrors allowed?
String researchKeyMirrorOrJar = ( Config.allowMirrors ? "MIRROR" : "JARLABEL" );
String pseudoKeyMirrorOrJar = ( Config.allowMirrors ? PseudoResearchTypes.MIRROR.getKey() : PseudoResearchTypes.JAR.getKey() );
// Create the infusion provider research
ResearchTypes.INFUSION_PROVIDER.createResearchItem( infusionProviderList, ResearchRegistry.COMPLEXITY_LARGE, infusionProviderIcon,
infusionProviderPages );
ResearchTypes.INFUSION_PROVIDER.researchItem.setParents( this.getFirstValidParentKey( false ), pseudoKeyMirrorOrJar,
PseudoResearchTypes.INFUSION.getKey() );
ResearchTypes.INFUSION_PROVIDER.researchItem.setParentsHidden( researchKeyMirrorOrJar, "INFUSION" );
ResearchTypes.INFUSION_PROVIDER.researchItem.setConcealed().setSpecial();
ResearchTypes.INFUSION_PROVIDER.researchItem.registerResearchItem();
}
示例15: populateTCItems
import thaumcraft.common.config.Config; //导入依赖的package包/类
private void populateTCItems()
{
// Shards
this.AirShard = new ItemStack( ConfigItems.itemShard, 1, 0 );
this.FireShard = new ItemStack( ConfigItems.itemShard, 1, 1 );
this.WaterShard = new ItemStack( ConfigItems.itemShard, 1, 2 );
this.EarthShard = new ItemStack( ConfigItems.itemShard, 1, 3 );
this.OrderShard = new ItemStack( ConfigItems.itemShard, 1, 4 );
this.EntropyShard = new ItemStack( ConfigItems.itemShard, 1, 5 );
this.BallanceShard = new ItemStack( ConfigItems.itemShard, 1, 6 );
// Resources
this.Nitor = new ItemStack( ConfigItems.itemResource, 1, 1 );
this.ThaumiumIngot = new ItemStack( ConfigItems.itemResource, 1, 2 );
this.VisFilter = new ItemStack( ConfigItems.itemResource, 1, 8 );
this.SalisMundus = new ItemStack( ConfigItems.itemResource, 1, 14 );
// Blocks
this.WardedJar = new ItemStack( ConfigBlocks.blockJar, 1, 0 );
this.ArcaneWorkTable = new ItemStack( ConfigBlocks.blockTable, 1, 15 );
this.FilterTube = new ItemStack( ConfigBlocks.blockTube, 1, 3 );
this.WardedGlass = this.getItemOrAlt( Config.wardedStone, new ItemStack( ConfigBlocks.blockCosmeticOpaque, 1, 2 ), this.VanillaGlass );
this.EssentiaMirror = (ItemStack)this.getItemOrAlt( Config.allowMirrors, new ItemStack( ConfigBlocks.blockMirror, 1, 6 ), this.WardedJar );
// Items
this.Thaumometer = new ItemStack( ConfigItems.itemThaumometer );
this.Thaumonomicon = new ItemStack( ConfigItems.itemThaumonomicon );
this.EtheralEssence = new ItemStack( ConfigItems.itemWispEssence );
this.ZombieBrain = new ItemStack( ConfigItems.itemZombieBrain );
this.QuickSilverDrop = new ItemStack( ConfigItems.itemNugget, 1, 5 );
}