• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ForgeDummyContainer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraftforge.common.ForgeDummyContainer的典型用法代码示例。如果您正苦于以下问题:Java ForgeDummyContainer类的具体用法?Java ForgeDummyContainer怎么用?Java ForgeDummyContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ForgeDummyContainer类属于net.minecraftforge.common包,在下文中一共展示了ForgeDummyContainer类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setBlockID

import net.minecraftforge.common.ForgeDummyContainer; //导入依赖的package包/类
public Fluid setBlockID(int blockID)
{
    if (this.blockID == -1 || this.blockID == blockID)
    {
        this.blockID = blockID;
    }
    else if (!ForgeDummyContainer.forceDuplicateFluidBlockCrash)
    {
        FMLLog.warning("A mod has attempted to assign BlockID " + blockID + " to the Fluid '" + fluidName + "' but this Fluid has already been linked to BlockID "
                + this.blockID + ". Configure your mods to prevent this from happening.");
    }
    else
    {
        FMLLog.severe("A mod has attempted to assign BlockID " + blockID + " to the Fluid '" + fluidName + "' but this Fluid has already been linked to BlockID "
                + this.blockID + ". Configure your mods to prevent this from happening.");
        throw new LoaderException(new RuntimeException("A mod has attempted to assign BlockID " + blockID + " to the Fluid '" + fluidName
                + "' but this Fluid has already been linked to BlockID " + this.blockID + ". Configure your mods to prevent this from happening."));
    }
    return this;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:21,代码来源:Fluid.java


示例2: getStartInventorySide

import net.minecraftforge.common.ForgeDummyContainer; //导入依赖的package包/类
/***********************************************************************************
 * This function is here for compatibilities sake, Modders should Check for
 * Sided before ContainerWorldly, Vanilla Minecraft does not follow the
 * sided standard that Modding has for a while.
 * 
 * In vanilla:
 * 
 * Top: Ores Sides: Fuel Bottom: Output
 * 
 * Standard Modding: Top: Ores Sides: Output Bottom: Fuel
 * 
 * The Modding one is designed after the GUI, the vanilla one is designed
 * because its intended use is for the hopper, which logically would take
 * things in from the top.
 * 
 * This will possibly be removed in future updates, and make vanilla the
 * definitive standard.
 */

@Override
public int getStartInventorySide(ForgeDirection side){
	if(ForgeDummyContainer.legacyFurnaceSides){
		if(side==ForgeDirection.DOWN)
			return 1;
		if(side==ForgeDirection.UP)
			return 0;
		return 2;
	}
	else{
		if(side==ForgeDirection.DOWN)
			return 2;
		if(side==ForgeDirection.UP)
			return 0;
		return 1;
	}
}
 
开发者ID:Danis98,项目名称:Veniocraft,代码行数:37,代码来源:TileEntityEnrichmentChamber.java


示例3: applyEntityAttributes

import net.minecraftforge.common.ForgeDummyContainer; //导入依赖的package包/类
protected void applyEntityAttributes()
{
    super.applyEntityAttributes();
    this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(20.0D);
    this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.23000000417232513D);
    this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(3.0D);
    this.getAttributeMap().func_111150_b(field_110186_bp).setAttribute(this.rand.nextDouble() * ForgeDummyContainer.zombieSummonBaseChance);
}
 
开发者ID:MinecraftModArchive,项目名称:Runes-And-Silver,代码行数:9,代码来源:EntityEskimoZombie.java


示例4: getSkyBlendColour

import net.minecraftforge.common.ForgeDummyContainer; //导入依赖的package包/类
public static int getSkyBlendColour(World world, int playerX, int playerZ)
{
    if (playerX == skyX && playerZ == skyZ && skyInit)
    {
        return skyRGBMultiplier;
    }
    skyInit = true;
    
    int distance = Minecraft.getMinecraft().gameSettings.fancyGraphics ? ForgeDummyContainer.blendRanges[Minecraft.getMinecraft().gameSettings.renderDistance] : 0;
    
    int r = 0;
    int g = 0;
    int b = 0;

    int divider = 0;
    for (int x = -distance; x <= distance; ++x)
    {
        for (int z = -distance; z <= distance; ++z)
        {
            BiomeGenBase biome = world.getBiomeGenForCoords(playerX + x, playerZ + z);
            int colour = biome.getSkyColorByTemp(biome.getFloatTemperature());
            r += (colour & 0xFF0000) >> 16;
            g += (colour & 0x00FF00) >> 8;
            b += colour & 0x0000FF;
            divider++;
        }
    }

    int multiplier = (r / divider & 255) << 16 | (g / divider & 255) << 8 | b / divider & 255;

    skyX = playerX;
    skyZ = playerZ;
    skyRGBMultiplier = multiplier;
    return skyRGBMultiplier;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:36,代码来源:ForgeHooksClient.java


示例5: applyEntityAttributes

import net.minecraftforge.common.ForgeDummyContainer; //导入依赖的package包/类
protected void applyEntityAttributes()
{
    super.applyEntityAttributes();
    this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D);
    this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.23000000417232513D);
    this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(3.0D);
    this.getAttributeMap().func_111150_b(field_110186_bp).setAttribute(this.rand.nextDouble() * ForgeDummyContainer.zombieSummonBaseChance);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:9,代码来源:EntityZombie.java


示例6: applyEntityAttributes

import net.minecraftforge.common.ForgeDummyContainer; //导入依赖的package包/类
protected void applyEntityAttributes()
{
	super.applyEntityAttributes();
	this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D);
	this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.23000000417232513D);
	this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(3.0D);
	this.getAttributeMap().func_111150_b(field_110186_bp).setAttribute(this.rand.nextDouble() * ForgeDummyContainer.zombieSummonBaseChance);
}
 
开发者ID:Ubiquitous-Spice,项目名称:Modjam-3,代码行数:9,代码来源:EntitySwarmZombie.java


示例7: ForgeNetworkHandler

import net.minecraftforge.common.ForgeDummyContainer; //导入依赖的package包/类
public ForgeNetworkHandler(ForgeDummyContainer container)
{
    super(container,container.getClass().getAnnotation(NetworkMod.class));
    configureNetworkMod(container);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:6,代码来源:ForgeNetworkHandler.java


示例8: onSpawnWithEgg

import net.minecraftforge.common.ForgeDummyContainer; //导入依赖的package包/类
public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
{
    Object par1EntityLivingData1 = super.onSpawnWithEgg(par1EntityLivingData);
    float f = this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ);
    this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * f);

    if (par1EntityLivingData1 == null)
    {
        par1EntityLivingData1 = new EntityZombieGroupData(this, this.worldObj.rand.nextFloat() < ForgeDummyContainer.zombieBabyChance, this.worldObj.rand.nextFloat() < 0.05F, (EntityZombieINNER1)null);
    }

    if (par1EntityLivingData1 instanceof EntityZombieGroupData)
    {
        EntityZombieGroupData entityzombiegroupdata = (EntityZombieGroupData)par1EntityLivingData1;

        if (entityzombiegroupdata.field_142046_b)
        {
            this.setVillager(true);
        }

        if (entityzombiegroupdata.field_142048_a)
        {
            this.setChild(true);
        }
    }

    this.addRandomArmor();
    this.enchantEquipment();

    if (this.getCurrentItemOrArmor(4) == null)
    {
        Calendar calendar = this.worldObj.getCurrentDate();

        if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F)
        {
            this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin));
            this.equipmentDropChances[4] = 0.0F;
        }
    }

    this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0));
    this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", this.rand.nextDouble() * 1.5D, 2));

    if (this.rand.nextFloat() < f * 0.05F)
    {
        this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0));
        this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2));
    }

    return (EntityLivingData)par1EntityLivingData1;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:52,代码来源:EntityZombie.java


示例9: Packet52MultiBlockChange

import net.minecraftforge.common.ForgeDummyContainer; //导入依赖的package包/类
public Packet52MultiBlockChange(int par1, int par2, short[] par3ArrayOfShort, int par4, World par5World)
{
    this.isChunkDataPacket = true;
    this.xPosition = par1;
    this.zPosition = par2;
    this.size = par4;
    int l = 4 * par4;
    Chunk chunk = par5World.getChunkFromChunkCoords(par1, par2);

    try
    {
        if (par4 >= ForgeDummyContainer.clumpingThreshold)
        {
            if (field_73449_e.length < l)
            {
                field_73449_e = new byte[l];
            }
        }
        else
        {
            ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(l);
            DataOutputStream dataoutputstream = new DataOutputStream(bytearrayoutputstream);

            for (int i1 = 0; i1 < par4; ++i1)
            {
                int j1 = par3ArrayOfShort[i1] >> 12 & 15;
                int k1 = par3ArrayOfShort[i1] >> 8 & 15;
                int l1 = par3ArrayOfShort[i1] & 255;
                dataoutputstream.writeShort(par3ArrayOfShort[i1]);
                dataoutputstream.writeShort((short)((chunk.getBlockID(j1, l1, k1) & 4095) << 4 | chunk.getBlockMetadata(j1, l1, k1) & 15));
            }

            this.metadataArray = bytearrayoutputstream.toByteArray();

            if (this.metadataArray.length != l)
            {
                throw new RuntimeException("Expected length " + l + " doesn\'t match received length " + this.metadataArray.length);
            }
        }
    }
    catch (IOException ioexception)
    {
        this.field_98193_m.logSevereException("Couldn\'t create chunk packet", ioexception);
        this.metadataArray = null;
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:47,代码来源:Packet52MultiBlockChange.java


示例10: sendChunkUpdate

import net.minecraftforge.common.ForgeDummyContainer; //导入依赖的package包/类
public void sendChunkUpdate()
{
    if (this.numberOfTilesToUpdate != 0)
    {
        int i;
        int j;
        int k;

        if (this.numberOfTilesToUpdate == 1)
        {
            i = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[0] >> 12 & 15);
            j = this.locationOfBlockChange[0] & 255;
            k = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[0] >> 8 & 15);
            this.sendToAllPlayersWatchingChunk(new Packet53BlockChange(i, j, k, PlayerManager.getWorldServer(this.thePlayerManager)));

            if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(i, j, k))
            {
                this.sendTileToAllPlayersWatchingChunk(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(i, j, k));
            }
        }
        else
        {
            int l;

            if (this.numberOfTilesToUpdate >= ForgeDummyContainer.clumpingThreshold)
            {
                i = this.chunkLocation.chunkXPos * 16;
                j = this.chunkLocation.chunkZPos * 16;
                this.sendToAllPlayersWatchingChunk(new Packet51MapChunk(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.flagsYAreasToUpdate));

                /* Forge: Grabs ALL tile entities is costly on a modded server, only send needed ones
                for (k = 0; k < 16; ++k)
                {
                    if ((this.flagsYAreasToUpdate & 1 << k) != 0)
                    {
                        l = k << 4;
                        List list = PlayerManager.getWorldServer(this.thePlayerManager).getAllTileEntityInBox(i, l, j, i + 16, l + 16, j + 16);

                        for (int i1 = 0; i1 < list.size(); ++i1)
                        {
                            this.sendTileToAllPlayersWatchingChunk((TileEntity)list.get(i1));
                        }
                    }
                }
                */
            }
            else
            {
                this.sendToAllPlayersWatchingChunk(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.locationOfBlockChange, this.numberOfTilesToUpdate, PlayerManager.getWorldServer(this.thePlayerManager)));
            }

            { //Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small
                for (i = 0; i < this.numberOfTilesToUpdate; ++i)
                {
                    j = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[i] >> 12 & 15);
                    k = this.locationOfBlockChange[i] & 255;
                    l = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[i] >> 8 & 15);

                    if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(j, k, l))
                    {
                        this.sendTileToAllPlayersWatchingChunk(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(j, k, l));
                    }
                }
            }
        }

        this.numberOfTilesToUpdate = 0;
        this.flagsYAreasToUpdate = 0;
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:71,代码来源:PlayerInstance.java



注:本文中的net.minecraftforge.common.ForgeDummyContainer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Fixtures类代码示例发布时间:2022-05-23
下一篇:
Java SMTPReply类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap