Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

1.5 updating so much fun


ashtonr12
 Share

Recommended Posts

error one;

the error is under .adddungeonLoot i assume this has been reworded but couldnt find the replacement.

DungeonHooks.addDungeonLoot(new ItemStack(Item.diamond.ItemID), 1, 1, 1);

error two;

package ashtonsmod.common;

import static net.minecraftforge.common.ForgeDirection.EAST;
import static net.minecraftforge.common.ForgeDirection.NORTH;
import static net.minecraftforge.common.ForgeDirection.SOUTH;
import static net.minecraftforge.common.ForgeDirection.WEST;

import java.util.Random;

import javax.swing.text.html.parser.Entity;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BlockStickyGrips extends Block
{
    protected BlockStickyGrips(int par1)
    {
        super(par1, Material.circuits);
        this.setCreativeTab(CreativeTabs.tabDecorations);
    }

    /**
     * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
     * cleared to be reused)
     */
    public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
    {
        this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
        return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);
    }
    
    public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
    {
    	par5Entity.motionY = 0.2;
    	par5Entity.fallDistance = 0.0F;
    }

    @SideOnly(Side.CLIENT)

    /**
     * Returns the bounding box of the wired rectangular prism to render.
     */
    public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
    {
        this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
        return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4);
    }

    /**
     * Updates the blocks bounds based on its current state. Args: world, x, y, z
     */
    public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
    {
        this.updateLadderBounds(par1IBlockAccess.getBlockMetadata(par2, par3, par4));
    }

    /**
     * Update the ladder block bounds based on the given metadata value.
     */
    public void updateLadderBounds(int par1)
    {
        float f = 0.125F;

        if (par1 == 2)
        {
            this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
        }

        if (par1 == 3)
        {
            this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
        }

        if (par1 == 4)
        {
            this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
        }

        if (par1 == 5)
        {
            this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
        }
    }

    /**
     * Is this block (a) opaque and (b) a full 1m cube?  This determines whether or not to render the shared face of two
     * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
     */
    public boolean isOpaqueCube()
    {
        return false;
    }

    /**
     * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
     */
    public boolean renderAsNormalBlock()
    {
        return false;
    }

    /**
     * The type of render function that is called for this block
     */
    public int getRenderType()
    {
        return 8;
    }

    /**
     * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
     */
    public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
    {
        return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST ) ||
               par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST ) ||
               par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) ||
               par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH);
    }

    /**
     * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
     */
    public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9)
    {
        int j1 = par9;

        if ((j1 == 0 || par5 == 2) && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
        {
            j1 = 2;
        }

        if ((j1 == 0 || par5 == 3) && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
        {
            j1 = 3;
        }

        if ((j1 == 0 || par5 == 4) && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
        {
            j1 = 4;
        }

        if ((j1 == 0 || par5 == 5) && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
        {
            j1 = 5;
        }

        return j1;
    }

    /**
     * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
     * their own) Args: x, y, z, neighbor blockID
     */
    public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
    {
        int i1 = par1World.getBlockMetadata(par2, par3, par4);
        boolean flag = false;

        if (i1 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
        {
            flag = true;
        }

        if (i1 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
        {
            flag = true;
        }

        if (i1 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
        {
            flag = true;
        }

        if (i1 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
        {
            flag = true;
        }

        if (!flag)
        {
            this.dropBlockAsItem(par1World, par2, par3, par4, i1, 0);
            par1World.func_94571_i(par2, par3, par4);
        }

        super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
    }

    /**
     * Returns the quantity of items to drop on block destruction.
     */
    public int quantityDropped(Random par1Random)
    {
        return 1;
    }

    @Override
    public boolean isLadder(World world, int x, int y, int z)
    {
        return true;
    }


@Override
public String getTextureFile(){
return CommonProxy.blocks_png;
}}

the errors are under .montionY and .fallDistance , i dont know why these are errors they work perfectly in my other blocks, maybe something to do with this block being a ladder.

 

error three

package ashtonsmod.common;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;

public class EntityInkBall extends EntityThrowable
{
    public EntityInkBall(World par1World)
    {
        super(par1World);
    }

    public EntityInkBall(World par1World, EntityLiving par2EntityLiving)
    {
        super(par1World, par2EntityLiving);
    }

    public EntityInkBall(World par1World, double par2, double par4, double par6)
    {
        super(par1World, par2, par4, par6);
    }

    /**
     * Called when this EntityThrowable hits a block or entity.
     */
    protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
    {
        if (par1MovingObjectPosition.entityHit != null)
        {
            byte var2 = 0;

            if (par1MovingObjectPosition.entityHit instanceof EntityBlaze)
            {
                var2 = 3;
            }

            par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.func_85052_h()), 2);    		
            }

        for (int var3 = 0; var3 < 8; ++var3)
        {
            this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
        }

        if (!this.worldObj.isRemote)
        {
            this.setDead();
        }
    }
}

this error is under func_85052_h i assume the function has been renamed once again couldnt find the replacement anywhere.

 

i have searched the internet for answers to these problems and have found none i am trying to use this place as a last resort because some of the people on here get a bit cranky when i make noob mistakes or basic java error because of my lack of knowledge and for this i am sorry. if anyone could please help me solve these errors i would be very grateful. this is my first major update too so  if there is any obvious updating mistakes let me know.

 

P.S

i know i haven't updated my item or block textures yet i am doing that now i just thought i would give you lovely people some time to have a looky at these ones whilst i do :)

 

Use examples, i have aspergers.

Examples make sense to me.

Link to comment
Share on other sites

addDungeonLoot has been replaced by the methods in ChestGenHooks. Please read the code in there before asking how to do that.

Error2: You imported the wrong entity.

Error3: Look at DamageSource.causeThrownDamage. It takes 2 Entities as arguments, arg1 is this (ok, this is the entity being thrown, makes sense) arg2 is what? Hm, maybe the player that has thrown? Hm, lets find a method for that. It is there.

Link to comment
Share on other sites

ok so i have done all my textures but i just cannot get that dungeon chest hook thing

the best i have is

	 ChestGenHooks.addDungeonLoot(new ItemStack(ashtonsmod.LSboots), 5, 1, 1);

 

but its missing an argument and the visibility of the hook is private anywho ?

im stuck...

Use examples, i have aspergers.

Examples make sense to me.

Link to comment
Share on other sites

The category is there so the process for adding Items gets unified. Adding stuff to a Dungeon chest is the same as adding it to a Mineshaft chest or a Jungle Temple dispenser. The only difference is the category.

The info about quantities goes into the 2nd parameter, WeightedRandomChestContent.

Link to comment
Share on other sites

i thought about that class

and i saw

public static final String DUNGEON_CHEST            = "dungeonChest";

and assumed that dungeonChest was the catagory but that was wrong so i tried DUNGEON_CHEST but that didnt work either :/

i am trying :(

Use examples, i have aspergers.

Examples make sense to me.

Link to comment
Share on other sites

OK sorry I wasn't specific enough the code is invalid an red error line appears under the area where i am meant to put a category no matter what I seem to put except null but that would defeat the point correct?

 

maybe it starts like this?

ChestGenHooks.DUNGEON_CHEST

but i dont know how to finish the line if this is the case.

Use examples, i have aspergers.

Examples make sense to me.

Link to comment
Share on other sites

i know but if i type

 

ChestGenHook. it suggest .DUNGEON_CHEST and .addItem and viable methods for adding loot to a dungeon chest.

 

if i choose .DUNGEONCHEST i cant fingure out how to finish the line

if i choose . add Item the generated line is

 

ChestgenHook.addItem(catagory, item);

 

then i change it too

 

ChestGenHook.addItem(catagory, ashtonsmod.IngotBush,1,1,1);

 

and i cannot figure out a catagory variable that does not become an error.

the 1,1,1 is the max, min and chance correct? that is not an error i just wanted to check.

Use examples, i have aspergers.

Examples make sense to me.

Link to comment
Share on other sites

no need to start getting upset with each other :)

i do not know very much about java at it isnt my fualt that they changed the dungeon hooks thing but all i am looking for the new solution, last night i got this far;

 

chestGenHooks.additem("dungenChest", new WeightedRandomChestContent(1,1,1,1,1))

 

and i know what some of the didgets do but not all of them and i cant find the right order and i dnot know if this is actually correct it just gives no errors :)

(the didgets are maxstacksize, minstacksize,chance and i dont knwo the other two and i dont knwo the order)

if this is incorrect could someone just post the correct one? if it is correct can someone tell me the order of the numbers and what they each mean please?

Use examples, i have aspergers.

Examples make sense to me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello There! In the 73rd episode of Bed Wars we get into a lobby with a guy who had a cool name and for some reason Ben is very impressed with the name and thus the title!  
    • I have been trying to install forge, but I can't even get the installer to run. I'm really not sure what the issue is, first let me make sure I am even using the installer right, I downloaded the forge installer matching my minecraft version (1.19.2), if I double click the .jar from the download then I see a flash of a black window that immediately disappears. If I use a command prompt, I receive the following output: C:\Users\austi> java -jar forge-1.19.2-43.0.19-installer.jar Error: Unable to access jarfile forge-1.19.2-43.0.19-installer.jar   I feel like this is more likely a java issue than a forge issue but I was hoping that people here might be able to help. I've tried a couple versions of java, at first I was using 8 I believe because all of the install guides for forge were a bit older so they linked to the java website rather than oracle. I tried version 18 from the oracle site and received the same result from command prompt. It is also entirely possible that I am doing something else wrong that is blatantly obvious to everyone else.
    • Here is my configuration: % java -version java version "18.0.2" 2022-07-19 Java(TM) SE Runtime Environment (build 18.0.2+9-61) Java HotSpot(TM) 64-Bit Server VM (build 18.0.2+9-61, mixed mode, sharing) forge-1.19-41.1.0-mdk on macOS Monterey 12.5 I ran the command: ./gradlew genEclipseRuns and was hoping it will generate the Eclipse project files for me. The run log is at https://gist.github.com/arun-gupta/06b983a6976b4c0a0f510d0dc225ddd3 and the generated directory structure is at https://gist.github.com/arun-gupta/3f5bfc70ec5d3d903b0f97d42840abda. In previous versions (1.12-ish), it used to generate an eclipse directory but 1.19 does not seem to have it. I tried opening the top-level forge directory but Eclipse does not recognize it as a project as well. How do I open this project in Eclipse now?  
    • I didn't put in credentials, I used it only for testing installing forge. But still the problem mentioned above.
    • I am trying to use Forge 1.18.2, I have checked my firewall, redownloaded Forge, deleted the fml.toml file (which keeps reappearing) and looked at countless help pages. I am just trying to download and use forge so that I can play with my friends and it will not download. It tells me there may be an issue with the Java runtime config and that the exit code is one, and I have copied the exit code.   
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.