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

Java EntityHelper类代码示例

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

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



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

示例1: onPlayerLogin

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event)
{
    NBTTagCompound tag = EntityHelper.getPlayerPersistentData(event.player, "GuiltTripSave");
    int size = tag.getInteger("size");
    for(int i = 0; i < size; i++)
    {
        ArrayList<KillInfo> kills = GuiltTrip.eventHandlerServer.playerKills.get(event.player.getName());
        if(kills == null)
        {
            kills = new ArrayList<>();
            GuiltTrip.eventHandlerServer.playerKills.put(event.player.getName(), kills);
        }

        kills.add(KillInfo.createKillInfoFromTag(tag.getCompoundTag("kill_" + i)));
    }
    GuiltTrip.eventHandlerServer.updatePlayersOnKill(event.player.getName(), null);
    GuiltTrip.eventHandlerServer.updatePlayersOnKill(null, event.player.getName());
}
 
开发者ID:iChun,项目名称:GuiltTrip,代码行数:20,代码来源:EventHandlerServer.java


示例2: handlePerspective

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType)
{
    currentPerspective = cameraTransformType;

    Pair<? extends IBakedModel, Matrix4f> pair = modelBase.handlePerspective(cameraTransformType, selfPair);

    if(modelBase.useVanillaCameraTransform())
    {
        boolean isLeft = isLeftHand(cameraTransformType);
        if(isItemDualHanded && isFirstPerson(currentPerspective) && lastEntity instanceof EntityPlayer && ItemRenderingHelper.dualHandedAnimationRight > 0)
        {
            float prog = (float)Math.sin(MathHelper.clamp((isLeft ? EntityHelper.interpolateValues(ItemRenderingHelper.prevDualHandedAnimationLeft, ItemRenderingHelper.dualHandedAnimationLeft, iChunUtil.eventHandlerClient.renderTick) : EntityHelper.interpolateValues(ItemRenderingHelper.prevDualHandedAnimationRight, ItemRenderingHelper.dualHandedAnimationRight, iChunUtil.eventHandlerClient.renderTick)) / (float)ItemRenderingHelper.dualHandedAnimationTime, 0F, 1F) * Math.PI / 4F);
            GlStateManager.rotate(30F * prog, -1F, 0F, 0F);
            GlStateManager.translate(0F, -0.1F * prog, 0.3F * prog);
            GlStateManager.rotate((isLeft ? -35F : 35F) * prog, 0F, 1F, 0F);
        }

        ItemCameraTransforms.applyTransformSide(this.getItemCameraTransforms().getTransform(cameraTransformType), isLeft);
    }
    return pair;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:23,代码来源:ModelBaseWrapper.java


示例3: getRollFactor

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
public static float getRollFactor(int level, float partialTick)
{
    if(level <= 0)
    {
        return EntityHelper.interpolateValues(WorldPortals.eventHandlerClient.prevCameraRoll, WorldPortals.eventHandlerClient.cameraRoll, partialTick);
    }
    else if(level <= rollFactor.size())
    {
        float roll = EntityHelper.interpolateValues(WorldPortals.eventHandlerClient.prevCameraRoll, WorldPortals.eventHandlerClient.cameraRoll, partialTick);
        for(int i = level - 1; i >= 0 ; i--)
        {
            roll += rollFactor.get(i);
        }
        return roll;
    }
    return 0F;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:18,代码来源:WorldPortalRenderer.java


示例4: terminate

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
public void terminate()
{
    if(isAgainstWall())
    {
        for(Entity ent : lastScanEntities)
        {
            if(ent.getEntityBoundingBox().intersects(portalInsides))
            {
                EnumFacing faceOn = getFaceOn();
                EntityHelper.putEntityWithinAABB(ent, flatPlane.offset(faceOn.getFrontOffsetX() * 0.5D, faceOn.getFrontOffsetY() * 0.5D, faceOn.getFrontOffsetZ() * 0.5D));
                ent.setPosition(ent.posX, ent.posY, ent.posZ);
            }
            WorldPortals.eventHandler.removeMonitoredEntity(ent, this);
        }
    }
    if(hasPair())
    {
        pair.setPair(null);
        setPair(null);
    }
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:22,代码来源:WorldPortal.java


示例5: onItemRightClick

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
@Override
    public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand)
    {
//        player.setActiveHand(hand);
        if(ItemHandler.getUsableDualHandedItem(player) == player.getHeldItem(hand) && (player.capabilities.isCreativeMode || EntityHelper.consumeInventoryItem(player.inventory, Torched.itemTorchFirework, 1, 1)))
        {
            Torched.proxy.nudgeHand(player);
            if(!world.isRemote)
            {
                EntityHelper.playSoundAtEntity(player, Torched.soundRPT, SoundCategory.PLAYERS, 1.0F, 0.9F + (player.getRNG().nextFloat() * 2F - 1F) * 0.075F);
                player.world.spawnEntity(new EntityTorchFirework(player.world, player));
            }
        }
        return new ActionResult(EnumActionResult.PASS, player.getHeldItem(hand));
    }
 
开发者ID:iChun,项目名称:Torched,代码行数:16,代码来源:ItemTorchLauncher.java


示例6: shootTorch

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
public void shootTorch(EntityPlayer player)
{
    playerDelay.put(player.getName(), 5);
    ItemStack is = ItemHandler.getUsableDualHandedItem(player);
    if(player.capabilities.isCreativeMode || is.getItem() instanceof ItemTorchGun && is.getItemDamage() < is.getMaxDamage() && EntityHelper.consumeInventoryItem(player.inventory, Item.getItemFromBlock(Blocks.TORCH)))
    {
        if(!player.capabilities.isCreativeMode)
        {
            is.setItemDamage(is.getItemDamage() + 1);
            player.inventory.markDirty();
        }
        EntityHelper.playSoundAtEntity(player, Torched.soundTube, SoundCategory.PLAYERS, 0.5F, 0.85F + (player.getRNG().nextFloat() * 2F - 1F) * 0.075F);
        player.world.spawnEntity(new EntityTorch(player.world, player));
    }
}
 
开发者ID:iChun,项目名称:Torched,代码行数:16,代码来源:EventHandlerServer.java


示例7: doRender

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
@Override
public void doRender(EntityGib gib, double par2, double par4, double par6, float par8, float par9)
{
    GlStateManager.disableCull();
    GlStateManager.pushMatrix();
    bindEntityTexture(gib);
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GlStateManager.color(1.0F, 1.0F, 1.0F, MathHelper.clamp(gib.groundTime >= MobDismemberment.config.gibGroundTime ? 1.0F - (gib.groundTime - MobDismemberment.config.gibGroundTime + par9) / 20F : 1.0F, 0F, 1F));
    GlStateManager.alphaFunc(GL11.GL_GREATER, 0.003921569F);

    GlStateManager.translate(par2, par4, par6);

    GlStateManager.translate(0.0F, gib.type == 0 ? 4F / 16F : gib.type <= 2 && gib.parent instanceof EntitySkeleton ? 1F / 16F : 2F / 16F, 0.0F);

    GlStateManager.rotate(EntityHelper.interpolateRotation(gib.prevRotationYaw, gib.rotationYaw, par9), 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(EntityHelper.interpolateRotation(gib.prevRotationPitch, gib.rotationPitch, par9), -1.0F, 0.0F, 0.0F);

    GlStateManager.translate(0.0F, 24F / 16F - gib.height * 0.5F, 0.0F);

    GlStateManager.scale(-1.0F, -1.0F, 1.0F);

    modelGib.render(gib, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

    GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
    GlStateManager.disableBlend();
    GlStateManager.popMatrix();
    GlStateManager.enableCull();
}
 
开发者ID:iChun,项目名称:Mob-Dismemberment,代码行数:30,代码来源:RenderGib.java


示例8: doRender

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
@Override
public void doRender(EntityGib gib, double par2, double par4, double par6, float par8, float par9)
{
    if(!gib.attached)
    {
        GlStateManager.disableCull();
        GlStateManager.pushMatrix();
        bindEntityTexture(gib);
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GlStateManager.color(1.0F, 1.0F, 1.0F, MathHelper.clamp(gib.groundTime >= MobAmputation.config.gibGroundTime ? 1.0F - (gib.groundTime - MobAmputation.config.gibGroundTime + par9) / 20F : 1.0F, 0F, 1F));
        GlStateManager.alphaFunc(GL11.GL_GREATER, 0.003921569F);

        GlStateManager.translate(par2, par4, par6);

        GlStateManager.translate(0.0F, gib.type == 0 ? 4F / 16F : gib.type <= 2 && gib.parent instanceof EntitySkeleton ? 1F / 16F : 2F / 16F, 0.0F);

        GlStateManager.rotate(EntityHelper.interpolateRotation(gib.prevRotationYaw, gib.rotationYaw, par9), 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate(EntityHelper.interpolateRotation(gib.prevRotationPitch, gib.rotationPitch, par9), -1.0F, 0.0F, 0.0F);

        GlStateManager.translate(0.0F, 24F / 16F - gib.height * 0.5F, 0.0F);

        GlStateManager.scale(-1.0F, -1.0F, 1.0F);

        modelGib.render(gib, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

        GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
        GlStateManager.disableBlend();
        GlStateManager.popMatrix();
        GlStateManager.enableCull();
    }
}
 
开发者ID:iChun,项目名称:Mob-Amputation,代码行数:33,代码来源:RenderGib.java


示例9: attachGibs

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
public void attachGibs(World world, EntityLivingBase living)
{
    EntityHelper.setSize(living.getClass(), living, 0.4F, 1.5F);
    living.setPosition(living.posX, living.posY, living.posZ);
    EntityGib[] gibs = new EntityGib[3];
    for(int i = 0; i <= 2; i++)
    {
        gibs[i] = new EntityGib(world, living, i);
        world.spawnEntity(gibs[i]);
    }
    amputationMap.put(living, gibs);
}
 
开发者ID:iChun,项目名称:Mob-Amputation,代码行数:13,代码来源:EventHandlerClient.java


示例10: onClientTick

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event)
{
    if(event.phase == TickEvent.Phase.END)
    {
        Minecraft mc = Minecraft.getMinecraft();
        if(mc.world != null && !mc.isGamePaused())
        {
            prevYaw = currentYaw;
            prevPitch = currentPitch;
            currentYaw = EntityHelper.updateRotation(currentYaw, targetYaw, 10F);
            currentPitch = EntityHelper.updateRotation(currentPitch, targetPitch, 10F);
            if(pullTime > 0)
            {
                if(!(pressState.contains(mc.player.getName()) && pullTime == 7))
                {
                    pullTime--;
                }
                idleTime = 0;
                prevYaw = prevPitch = currentYaw = currentPitch = targetYaw = targetPitch = 0F;
            }
            else
            {
                idleTime++;
                if(idleTime > 60) //3 second idle.
                {
                    if(mc.world.rand.nextFloat() < 0.008F)
                    {
                        targetYaw = mc.world.rand.nextFloat() * 90F - 45F;
                        targetPitch = mc.world.rand.nextFloat() * 60F - 30F;
                    }
                }
            }
        }
    }
}
 
开发者ID:iChun,项目名称:BeeBarker,代码行数:37,代码来源:EventHandlerClient.java


示例11: onLeftClickEntity

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
@Override
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
{
    if(player.world.isRemote)
    {
        iChunUtil.proxy.nudgeHand(-50F);
    }
    EntityHelper.playSoundAtEntity(entity, SoundEvents.ENTITY_GENERIC_EAT, SoundCategory.NEUTRAL, 0.6F, (entity.world.rand.nextFloat() - entity.world.rand.nextFloat()) * 0.2F + 1F);
    return false;
}
 
开发者ID:iChun,项目名称:BeeBarker,代码行数:11,代码来源:ItemBeeBarker.java


示例12: execute

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
@Override
public void execute(Side side, EntityPlayer player)
{
    if(pressed)
    {
        ItemStack is = ItemHandler.getUsableDualHandedItem(player);
        if(is.getItem() == BeeBarker.itemBeeBarker && is.getTagCompound() != null && is.getTagCompound().hasKey(ItemBeeBarker.WOLF_DATA_STRING))
        {
            if(BeeBarker.config.easterEgg == 1 && ((NBTTagCompound)is.getTagCompound().getTag(ItemBeeBarker.WOLF_DATA_STRING)).hasKey("CustomName") && ((NBTTagCompound)is.getTagCompound().getTag(ItemBeeBarker.WOLF_DATA_STRING)).getString("CustomName").equals("iChun"))
            {
                if(!BarkHelper.pressState.contains(player.getName()))
                {
                    BarkHelper.pressState.add(player.getName());
                    EntityHelper.playSoundAtEntity(player, SoundEvents.ENTITY_WOLF_GROWL, SoundCategory.PLAYERS, 0.4F, 1.0F);
                    BeeBarker.channel.sendToAll(new PacketKeyState(player.getName(), true));
                }
            }
            else
            {
                BarkHelper.bark(player);
            }
        }
    }
    else
    {
        BarkHelper.removePressState(player.getName());
    }
}
 
开发者ID:iChun,项目名称:BeeBarker,代码行数:29,代码来源:PacketBark.java


示例13: createKillInfoFromEntity

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
public static KillInfo createKillInfoFromEntity(EntityLivingBase living)
{
    NBTTagCompound tag = new NBTTagCompound();
    if(living instanceof EntityPlayer || living.writeToNBTOptional(tag))
    {
        KillInfo info = new KillInfo();
        if(living instanceof EntityPlayer)
        {
            NBTTagCompound persistent = EntityHelper.getPlayerPersistentData((EntityPlayer)living);
            NBTTagCompound tempTag = persistent.getCompoundTag("GuiltTripSave");
            persistent.setTag("GuiltTripSave", new NBTTagCompound());

            living.writeToNBT(tag);
            tag = tag.copy();

            persistent.setTag("GuiltTripSave", tempTag);
            info.playerName = living.getName();
        }
        tag.setShort("HurtTime", (short)0);
        tag.setShort("DeathTime", (short)0);
        tag.setFloat("HealF", 1);
        tag.setShort("Health", (short)1);

        info.tag = tag;
        return info;
    }
    return null;
}
 
开发者ID:iChun,项目名称:GuiltTrip,代码行数:29,代码来源:KillInfo.java


示例14: drawMap

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
public void drawMap(Minecraft mc, ScaledResolution reso, int x, int y, int width, int height, float aScale, float partialTicks)
{
    double posX = x + width * (float)Blocksteps.config.camPosX / 100F;
    double posY = y + height * (float)Blocksteps.config.camPosY / 100F;

    EntityLivingBase ent = mc.thePlayer;
    GlStateManager.enableColorMaterial();
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)posX, (float)posY, 300.0F);
    if(fullscreen)
    {
        GlStateManager.translate(EntityHelper.interpolateValues(prevOffsetX, offsetX, partialTicks), EntityHelper.interpolateValues(prevOffsetY, offsetY, partialTicks), 0F);
    }
    GlStateManager.scale(-aScale, aScale, aScale);
    GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);

    GlStateManager.rotate(EntityHelper.interpolateRotation(prevAngleX, angleX, partialTicks), 1.0F, 0.0F, 0.0F);
    GlStateManager.rotate(EntityHelper.interpolateRotation(prevAngleY, angleY, partialTicks), 0.0F, 1.0F, 0.0F);

    GlStateManager.translate(0, -mc.thePlayer.getEyeHeight(), 0F);

    boolean hideGui = mc.gameSettings.hideGUI;
    mc.gameSettings.hideGUI = Blocksteps.config.hideNamePlates == 1;
    renderWorld(mc, partialTicks);
    mc.gameSettings.hideGUI = hideGui;

    GlStateManager.enableLighting();
    GlStateManager.enableNormalize();

    GlStateManager.popMatrix();
    RenderHelper.disableStandardItemLighting();
}
 
开发者ID:iChun,项目名称:Blocksteps,代码行数:33,代码来源:EventHandlerClient.java


示例15: readFromNBT

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound tag)
{
    super.readFromNBT(tag);
    hasBase = tag.getBoolean("hasBase");
    head = tag.getInteger("head");
    hasStand = tag.getBoolean("hasStand");
    isOnFloor = tag.getBoolean("isOnFloor");
    orientation = tag.getInteger("orientation");
    sideOn = tag.getInteger("sideOn");

    if(head == 4)
    {
        if(tag.hasKey("headName") && !tag.getString("headName").isEmpty())
        {
            this.gameProfile = EntityHelper.getGameProfile(tag.getString("headName"));
        }
        else if (tag.hasKey("headNameProfile", 10))
        {
            this.gameProfile = NBTUtil.readGameProfileFromNBT(tag.getCompoundTag("headNameProfile"));
        }
    }

    hatName = tag.getString("hatName");
    colourR = tag.getInteger("colourR");
    colourG = tag.getInteger("colourG");
    colourB = tag.getInteger("colourB");
    alpha = tag.getInteger("alpha");

    if(alpha == 0)
    {
        alpha = 255;
    }

    info = new HatInfoClient(hatName, colourR, colourG, colourB, alpha);
}
 
开发者ID:iChun,项目名称:Hats,代码行数:37,代码来源:TileEntityHatStand.java


示例16: preInit

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
@Override
public void preInit()
{
    super.preInit();
    ResourceHelper.init();
    RendererHelper.init();

    File file = new File(ResourceHelper.getConfigFolder(), "ichunutil_keybinds.cfg");
    ConfigHandler.configKeybind = new Configuration(file);
    ConfigHandler.configKeybind.load();

    List cms = Splitter.on("\\n").splitToList(I18n.translateToLocal("ichunutil.config.cat.keybind.comment"));
    String cm = "";
    for(int ll = 0; ll < cms.size(); ll++)
    {
        cm = cm + cms.get(ll);
        if(ll != cms.size() - 1)
        {
            cm = cm + "\n";
        }
    }
    ConfigHandler.configKeybind.addCustomCategoryComment("keybinds", cm);

    EntityHelper.injectMinecraftPlayerGameProfile();

    iChunUtil.eventHandlerClient = new EventHandlerClient();
    MinecraftForge.EVENT_BUS.register(iChunUtil.eventHandlerClient);

    RenderingRegistry.registerEntityRenderingHandler(EntityLatchedRenderer.class, new RenderLatchedRenderer.RenderFactory());
    RenderingRegistry.registerEntityRenderingHandler(EntityBlock.class, new RenderBlock.RenderFactory());
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:32,代码来源:ProxyClient.java


示例17: setGameProfileLookupService

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
@Override
public void setGameProfileLookupService()
{
    YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Minecraft.getMinecraft().getProxy(), UUID.randomUUID().toString());
    EntityHelper.sessionService = yggdrasilauthenticationservice.createMinecraftSessionService();
    GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
    EntityHelper.profileCache = new PlayerProfileCache(gameprofilerepository, new File(Minecraft.getMinecraft().mcDataDir, MinecraftServer.USER_CACHE_FILE.getName()));
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:9,代码来源:ProxyClient.java


示例18: onClientDisconnect

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
public void onClientDisconnect()
{
    EntityTrackerHandler.onClientDisconnect();
    PatronEffectRenderer.onClientDisconnect();

    GrabHandler.grabbedEntities.get(Side.CLIENT).clear();

    for(ConfigBase conf : ConfigHandler.configs)
    {
        conf.resetSession();
    }

    EntityHelper.profileCache = null;
    EntityHelper.sessionService = null;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:16,代码来源:EventHandlerClient.java


示例19: onCameraSetupEvent

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
@SubscribeEvent
public void onCameraSetupEvent(EntityViewRenderEvent.CameraSetup event)
{
    if(cameraRoll != 0F && WorldPortalRenderer.renderLevel <= 0)
    {
        event.setRoll(EntityHelper.interpolateValues(prevCameraRoll, cameraRoll, (float)event.getRenderPartialTicks()));
    }
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:9,代码来源:EventHandlerWorldPortalClient.java


示例20: createPlaneAround

import me.ichun.mods.ichunutil.common.core.util.EntityHelper; //导入依赖的package包/类
private AxisAlignedBB createPlaneAround(Vec3d pos, double size)
{
    double halfW = width / 2D;
    double halfH = height / 2D;

    AxisAlignedBB plane = new AxisAlignedBB(pos.x - halfW, pos.y - halfH, pos.z - size, pos.x + halfW, pos.y + halfH, pos.z + size);
    EnumFacing faceOn = getFaceOn();
    if(faceOn.getAxis() == EnumFacing.Axis.Y)
    {
        plane = EntityHelper.rotateAABB(EnumFacing.Axis.X, plane, faceOn == EnumFacing.UP ? -90F : 90F, pos.x, pos.y, pos.z);
    }
    plane = EntityHelper.rotateAABB(EnumFacing.Axis.Y, plane, faceOn.getAxis() == EnumFacing.Axis.X ? 90F : faceOn.getAxis() == EnumFacing.Axis.Y && getUpDir().getAxis() == EnumFacing.Axis.X ? 90F : 0F, pos.x, pos.y, pos.z).offset(faceOn.getFrontOffsetX() * getPlaneOffset(), faceOn.getFrontOffsetY() * getPlaneOffset(), faceOn.getFrontOffsetZ() * getPlaneOffset());
    return plane;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:15,代码来源:WorldPortal.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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