Package com.pahimar.ee3.tileentity

Examples of com.pahimar.ee3.tileentity.TileEntityAlchemyArray.readFromNBT()


        if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray && entityLiving instanceof EntityPlayer)
        {
            NBTTagCompound customEntityData = EntityHelper.getCustomEntityData(entityLiving);
            ChalkSettings chalkSettings = new ChalkSettings();
            chalkSettings.readFromNBT(customEntityData);

            // Set adjusted rotation
            int facing = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
            ((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).setRotation(chalkSettings.getRotation(), facing);

View Full Code Here


            TileEntityAlchemyArray tileEntityAlchemyArray = (TileEntityAlchemyArray) world.getTileEntity(x, y, z);
            if (entityPlayer.getCurrentEquippedItem() != null && entityPlayer.getCurrentEquippedItem().getItem() instanceof ItemChalk && !entityPlayer.isSneaking())
            {
                NBTTagCompound customEntityData = EntityHelper.getCustomEntityData(entityPlayer);
                ChalkSettings chalkSettings = new ChalkSettings();
                chalkSettings.readFromNBT(customEntityData);

                ResourceLocation glyphTexture = GlyphTextureRegistry.getInstance().getRegisteredGlyphAt(chalkSettings.getIndex());

                if (tileEntityAlchemyArray.addGlyphToAlchemyArray(new Glyph(glyphTexture, GlyphTextureRegistry.getInstance().getRegisteredGlyphTextures().get(glyphTexture)), chalkSettings.getSize()))
                {
View Full Code Here

    {
        if (!world.isRemote)
        {
            NBTTagCompound playerCustomData = EntityHelper.getCustomEntityData(entityPlayer);
            ChalkSettings chalkSettings = new ChalkSettings();
            chalkSettings.readFromNBT(playerCustomData);
            int coordOffset = getOffsetForSize(chalkSettings.getSize());
            ForgeDirection orientation = ForgeDirection.getOrientation(side);
            boolean canPlaceAlchemyArray = ModBlocks.alchemyArray.canPlaceBlockOnSide(world, x, y, z, side);

            if (canPlaceAlchemyArray)
View Full Code Here

    {
        if (!world.isRemote)
        {
            NBTTagCompound playerCustomData = EntityHelper.getCustomEntityData(entityPlayer);
            ChalkSettings chalkSettings = new ChalkSettings();
            chalkSettings.readFromNBT(playerCustomData);
            int coordOffset = getOffsetForSize(chalkSettings.getSize());
            ForgeDirection orientation = ForgeDirection.getOrientation(side);
            boolean canPlaceAlchemyArray = ModBlocks.alchemyArray.canPlaceBlockOnSide(world, x, y, z, side);

            placeBlockAt(entityPlayer, itemStack, world, x, y, z, ModBlocks.alchemyArray, side);
View Full Code Here

    {
        if (key != Key.UNKNOWN)
        {
            NBTTagCompound playerCustomData = EntityHelper.getCustomEntityData(entityPlayer);
            ChalkSettings chalkSettings = new ChalkSettings();
            chalkSettings.readFromNBT(playerCustomData);

            if (key == Key.CHARGE)
            {
                if (!entityPlayer.isSneaking())
                {
View Full Code Here

    @SubscribeEvent
    public void syncChalkSettingsOnLogin(cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent event)
    {
        NBTTagCompound playerCustomData = EntityHelper.getCustomEntityData(event.player);
        ChalkSettings chalkSettings = new ChalkSettings();
        chalkSettings.readFromNBT(playerCustomData);

        PacketHandler.INSTANCE.sendTo(new MessageChalkSettings(chalkSettings), (EntityPlayerMP) event.player);
    }

    @SubscribeEvent
View Full Code Here

        {
            NBTTagCompound playerCustomData = EntityHelper.getCustomEntityData(event.player);

            // Chalk Settings
            ChalkSettings chalkSettings = new ChalkSettings();
            chalkSettings.readFromNBT(playerCustomData);
            chalkSettings.writeToNBT(playerCustomData);

            EntityHelper.saveCustomEntityData(event.player, playerCustomData);
        }
    }
View Full Code Here

        if (itemStack.getItem() instanceof ItemAlchemicalTome)
        {
            if (itemStack.hasTagCompound() && NBTHelper.hasTag(itemStack, Names.NBT.KNOWLEDGE))
            {
                PlayerKnowledge playerKnowledge = new PlayerKnowledge();
                playerKnowledge.readFromNBT(itemStack.getTagCompound());
                return playerKnowledge;
            }
            else
            {
                PlayerKnowledge playerKnowledge = new PlayerKnowledge();
View Full Code Here

    public IMessage onMessage(MessageTileEntityAlchemyArray message, MessageContext ctx)
    {
        if (message.tileEntityAlchemyArrayNBT != null)
        {
            TileEntityAlchemyArray tileEntityAlchemyArray = new TileEntityAlchemyArray();
            tileEntityAlchemyArray.readFromNBT(message.tileEntityAlchemyArrayNBT);

            TileEntity tileEntity = FMLClientHandler.instance().getClient().theWorld.getTileEntity(tileEntityAlchemyArray.xCoord, tileEntityAlchemyArray.yCoord, tileEntityAlchemyArray.zCoord);

            if (tileEntity instanceof TileEntityAlchemyArray)
            {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.