Jump to content

terraya

Members
  • Posts

    161
  • Joined

  • Last visited

Posts posted by terraya

  1. Hello Dear Community,

     

    im asking myself, what does forge makes better then bukkit?

     

    bcuz , i see ppl do "RPG" server on "bukkit" servers but why?!?,

     

    i mean, on bukkit you cant add "custom armor/weapons/items" or ?

     

    so where is the point O.o

     

    on other hand forge allow to do all this stuff but why does forge isnt as bukkit?

    I mean the same stuff which you code on "bukkit" you can code them on "forge" aswell or am i wrong?

  2. It's just standard file stuff.  Copy the originals somewhere safe on server startup (or whenever, you may want to make this happen once when a config value is true, then set the config value to false) and then every 15 minutes (use a TickEvent Handler and keep track of the time) copy the files back.  The next time the server loads the chunks, they'll be read from the file.  Already-loaded chunks might persist (particularly if something changes and the server saves afterwards) but long-term things will get reset.

     

     

    at the end, at 9266 regions, if i try to make them "reload" every 15min , the server will lag ...

     

    so i think to restart the server every 2h with a function which reloads the "not destroyed world" is alright.

  3. ok its an I = Input O = Output file ... but how shall i do that

    i mean, i would make it respawn my "regions" on ea.15min he would reload the region,

     

    but do the "Server itself" have a function which makes reload the regions or do i have to code an i/o function?

    and if i have to code any i/o function, where shall i call it, in which section in my code etc :3

  4. are players going to destroy said 790.000.000.000 blocks?

     

    that keeps track of blocks broken.. not all blocks.

     

     

    well i got a world which is that big, and ye, if there would be something live worldedit with a "WAND" which could

    make it easyer it would be amazing but as i can see there is nothing,

     

    becouse if i would have to safe ea. block manualy it would take ages ..

     

    And Yes, its a "PVP" World where ppl can use "special devilfruits" which destroy much ... so i wanted to make

    everything respawn after 10-15min :3

  5. So i got a small problem ... dunno why , cant find the small error , or i forget anything?

     

    import DevilFruitSkills.IceBall;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.init.SoundEvents;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.stats.StatList;
    import net.minecraft.util.ActionResult;
    import net.minecraft.util.EnumActionResult;
    import net.minecraft.util.EnumHand;
    import net.minecraft.util.SoundCategory;
    import net.minecraft.world.World;
    import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
    
    public class IceBallItem extends Item{
    public IceBallItem() {
    super();
        this.setMaxStackSize(1);
        
    }
    
        public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand)
        {
            if (!playerIn.capabilities.isCreativeMode)
            {
                --itemStackIn.stackSize;
            }
        
            worldIn.playSound((EntityPlayer)null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.4F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
            if (!worldIn.isRemote)
            {
                IceBall entitythrowable = new IceBall(worldIn, playerIn);
                entitythrowable.setHeadingFromThrower(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
                worldIn.spawnEntityInWorld(entitythrowable);
            }
            playerIn.addStat(StatList.getObjectUseStats(this));
            return new ActionResult(EnumActionResult.SUCCESS, itemStackIn);
        }
    }

     

    after rightclick the entity get spawned but my item is gone :o

     

    the "return" function should help me there but dont know how to realitze it .. :x

     

    he has to return "null" or the "item" ? i mean after he uses it i want still to keep the item

  6. so i want to make him get "Multiple Items" ,

     

    this works so far:

     

    	@Override
        public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving)
        {
            super.onItemUseFinish(stack, worldIn, entityLiving);
            return new ItemStack(Items.BOW);      
        }

     

    but what do you mean by " this method instead of returning a new ItemStack" , everytime i remove "return" it just show me an error up -_-

     

     

  7. Hello Dear Community,

     

    i got 2 questions,

     

    how to make "Starter Items" , what i mean with "Starter Items" is that when a "new" player joins the server he get items i select.

     

    another thing,

    im doing a "Devil fruits" mod with many new sword/armors etc .. BUT well,

    how 2 code an item and on "rightclick" i eat it or i use it and it will give me some new items.

     

    so well "On Rightclick" ... but i cant find any function or any tut. for this kind of thing and as i know there is no item in Minecraft which does what i need :S

  8. If you don't get that you should learn programming better. Read about Object oriented programming and inheritance.

     

    What you should do is override the "attackEntityAsMob" method in your entity.

     

    i will do both since ppl tell me to learn programming better, im sure its a bit easyer to understand when you know , how to programm but yeh ... :D

     

    i will try to start to learn programming with a book soon.

     

    thanks anyway for the adivce with "attackEntityAsMob" :)

  9. Hello@All ,

     

    Emm yeh ...  :-X

    my entity is exploding ..

     

    but i dont understand it right ... i mean, this is my code:

     

    	@Override
    public void onUpdate() {
    	super.onUpdate();
    	if (this.worldObj.isRemote && !this.attackEntityAsMob(this)) {
    		this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
    		this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.posX+1, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
    		this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.posX, this.posY+1, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
    		this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.posX, this.posY, this.posZ+1, 0.0D, 0.0D, 0.0D, new int[0]);
    	} else if (!this.worldObj.isRemote && this.attackEntityAsMob(this)) {
    		this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
    		this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.posX+1, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
    		this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.posX, this.posY+1, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
    		this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.posX, this.posY, this.posZ+1, 0.0D, 0.0D, 0.0D, new int[0]);
    		worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 4.0F, true);
    		//this.setDead();
    	}
    }

     

    and it says

    	if (this.worldObj.isRemote && !this.attackEntityAsMob(this))

     

    doesnt it mean "attackentityasmob" ... that, when my entity attacks another entity ,

    it creates an explosion?

  10. i dont think so (i dont know what OOP is)

     

    i just learn before a bit of "C++" and i codetbefore in "AutoIT" like "Ingame Bots" which more around the character etc etc ..

     

    Then basically you're doing things backwards.  You're trying to learn an entire way of thinking without knowing either the language, the codebase, or the general principles.

     

    i.e. you named a method "makeTippedArrow" with the intent to override, but never actually overrode anything and didn't tell your IDE that that was your intent either, so when I asked about it you said "no no, that's actually a method in ItemArrow" which was pretty much false (I had already checked and supplied the actual method name), which meant that (at some point) you intentionally renamed the method, making the assumption (wrongly, due to your lack of OOP knowledge) that the change was meaningless and that because you didn't inform your IDE that it was supposed to override something (using @Override) your IDE couldn't spot the mistake.

     

    And the reason we ask that people have some background in programming already is so that we don't have to explain things like "that's not how that works" or that's all we'd be doing.  You can go virtually anywhere else to learn Java already, this forum is not a place for it because there's already too many questions available about Minecraft and Forge specifically to handle the increased load of "I don't understand, what's X?"

     

    yes that true what you say , but until now it does work pretty well on coding minecraft forge (obv. i dont have to do much until now becouse there are many tutorials out there) ,

     

    but  yes you´re right.

     

  11. yes, the thing is, ppl say most of the time "learn java before starting to code mods" but i started to learn java with coding mods :S

     

    Do you have any OOP experience?

     

     

    i dont think so (i dont know what OOP is)

     

    i just learn before a bit of "C++" and i codetbefore in "AutoIT" like "Ingame Bots" which more around the character etc etc ..

     

     

  12. makeTippedArrow()

    isn't overriding any method and you are not calling it yourself.

    Did you mean

    createArrow()

    ?

     

    public class CustomArrow extends ItemArrow{
    
    public CustomArrow() {
    	super();
    }
    
        public EntityArrow createArrow(World worldIn, ItemStack itemstack, EntityLivingBase shooter)
        {
        	ExplosionArrow entitytippedarrow = new ExplosionArrow(worldIn, shooter);
            return new ExplosionArrow(worldIn, shooter);
        }
        
    }

     

    solved it, thank you very much!

  13. makeTippedArrow()

    isn't overriding any method and you are not calling it yourself.

    Did you mean

    createArrow()

    ?

     

    "makeTippedArrow" is from the vanilla code , i actualy dont know what it does, but i was searchin for the past 2h for a solucion and 2codes i´ve found had it like it is in my code :S

  14. Hello@All ,

     

    i did a custom arrow but somehow it is not working right,

     

    it work on one site, i get the arrow in my inventory etc ...

    but after i shoot 1 arrow, (it waste 1 arrow from my Stack) but a normal "Arrow" appear ...so idk where the problem actualy is ...

     

    my CustomArrowClass:

    public class CustomArrow extends ItemArrow{
    
    public CustomArrow() {
    	super();
    }
    
        public EntityArrow makeTippedArrow(World worldIn, ItemStack itemstack, EntityLivingBase shooter)
        {
            EntityTippedArrow entitytippedarrow = new EntityTippedArrow(worldIn, shooter);
            return new ExplosionArrow(worldIn, shooter);
        }
        
    }
    
    

     

    my ClientProxy register:

    public class ClientProxy
      extends CommonProxy
    {
    @EventHandler
      public void registeRenders()
      {
        CustomBlocks.registerRenders();
        ItemsUpdate.registerRenders();
        
    	 RenderManager rm = Minecraft.getMinecraft().getRenderManager();
     RenderingRegistry.registerEntityRenderingHandler(EntityModelTest.class, new RenderModelTest()); 
     RenderingRegistry.registerEntityRenderingHandler(EntityDragonTest.class, new RenderDragonTest()); 
     RenderingRegistry.registerEntityRenderingHandler(FireBall.class, new RenderFireBall(rm)); 	
     RenderingRegistry.registerEntityRenderingHandler(BigFireBall.class, new RenderBigFireBall(rm)); 	
     RenderingRegistry.registerEntityRenderingHandler(IceBall.class, new RenderIceBall(rm)); 	
     RenderingRegistry.registerEntityRenderingHandler(IceWall.class, new RenderIceBall(rm)); 	
    
    
     //RenderingRegistry.registerEntityRenderingHandler(PawHit.class, new ThrowableBlockRender(rm, ArturFarid.BlockUpdate.init.CustomBlocks.planks1,Minecraft.getMinecraft().getRenderItem()));
     //RenderingRegistry.registerEntityRenderingHandler(BigFireBall.class, new RenderApple(rm, ItemsUpdate.yoru, Minecraft.getMinecraft().getRenderItem()));	  
    
      }
    
    public void registerRenderer() {
    	RenderingRegistry.registerEntityRenderingHandler(ExplosionArrow.class, new IRenderFactory() {
    		@Override
    		public Render createRenderFor(RenderManager manager) {
    			return new RenderExplosionArrow(manager);
    		}
    	});
    }
    }

     

    my registry in the main class:

    EntityRegistry.registerModEntity(ExplosionArrow.class, "TestArrow", 14, this, 80, 3, true);

     

    my entityarrow:

    public class ExplosionArrow extends EntityArrow {
    
    public ExplosionArrow(World worldIn) {
    	super(worldIn);
    }
    
    public ExplosionArrow(World worldIn, EntityLivingBase shooter) {
    	super(worldIn, shooter);
    }
    
    public ExplosionArrow(World worldIn, double x, double y, double z) {
    	super(worldIn, x, y, z);
    }
    
    @Override
    public void onUpdate() {
    	super.onUpdate();
    	if (this.worldObj.isRemote && !this.inGround) {
    		this.worldObj.spawnParticle(EnumParticleTypes.END_ROD, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
    	} else if (!this.worldObj.isRemote && this.inGround) {
    		worldObj.createExplosion(shootingEntity, this.posX, this.posY, this.posZ, 4.0F, true);
    		this.setDead();
    	}
    }
    
    @Override
    public ItemStack getArrowStack() {
    	return new ItemStack(ItemsUpdate.TestArrow);
    }
    
    @Override
    public void arrowHit(EntityLivingBase living) {
    	super.arrowHit(living);
    	World world = living.getEntityWorld();
    	if (living != shootingEntity) {
    		world.createExplosion(shootingEntity, living.posX, living.posY, living.posZ, 4.0F, true);
    	}
    }
    
    }

     

    my render:

    @SideOnly(Side.CLIENT)
    public class RenderExplosionArrow extends RenderArrow<ExplosionArrow> {
    
        public static final ResourceLocation res = new ResourceLocation("blockupdate:textures/entity/projectiles/TestArrow.png");
    
        public RenderExplosionArrow(RenderManager rm)
        {
            super(rm);
        }
        
    @Override
    public ResourceLocation getEntityTexture(ExplosionArrow entity) {
    	return res;
    }
    }

     

    after i shoot with the bow, the arrows land in the ground and when i pick them up i get a normal vanilla arrow ...

    and the arrow is shoot is also a vanilla one , even he uses my "customarrow" from my inventory ...

     

×
×
  • Create New...

Important Information

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