All users will need to merge their Minecraft Forum account with a new or existing Twitch account starting October 23rd. You can merge your accounts by clicking here. Have questions? Learn more here.
Dismiss
  • 0

    posted a message on Better Records - Download songs from the internet!
    Problem was, the widget was getting a 502 error. That's why I posted that. :P
    Posted in: Minecraft Mods
  • 0

    posted a message on Better Records - Download songs from the internet!
    Am I losing my marbles, or is there no download link?
    Posted in: Minecraft Mods
  • 0

    posted a message on [Solved] Blocks - updateTick(World world) very slow, regardless of output.
    Indeed. Thanks for all your help!
    Posted in: Modification Development
  • 0

    posted a message on [Solved] Blocks - updateTick(World world) very slow, regardless of output.
    Your code works perfectly! I made a good system for it too:

        int tickUpdateCounter = 0;
        int tickUpdateDelay = 30 * 20; // 30 seconds 
    
        @Override
        public void updateEntity()
        {
            World world = worldObj;
            int x = xCoord;
            int y = yCoord;
            int z = zCoord;
            
            if(updateTimer())
            {
    
            }
    
        }
    
        public boolean updateTimer()
        {
            if (tickUpdateCounter >= tickUpdateDelay)
            {
                tickUpdateCounter = 0;
                return true;
            }
            else
            {
                tickUpdateCounter++;
                return false;
            }
        }
    Posted in: Modification Development
  • 0

    posted a message on [Solved] Blocks - updateTick(World world) very slow, regardless of output.
    Well, it works. But it instantly spreads. Broke my game. Is there a way to slow down the delay between updates in a tile entity?



    TileEntityInfectorBlock code:

    public class TileEntityInfectorBlock extends TileEntity
    {
        public TileEntityInfectorBlock()
        {
            super();
        }
        
        @Override
        public boolean canUpdate()
        {
            return true;
        }
        
        @Override
        public void updateEntity()
        {
            World world = worldObj;
            int x = xCoord;
            int y = yCoord;
            int z = zCoord;
            
            if(canReplace(world.getBlock(x, y + 1, z)))
            {
                replace(world, x, y, z, 0, 1, 0);
            }
    
            if(canReplace(world.getBlock(x, y - 1, z)))
            {
                replace(world, x, y, z, 0, -1, 0);
            }
    
            if(canReplace(world.getBlock(x + 1, y, z)))
            {
                replace(world, x, y, z, 1, 0, 0);
            }
    
            if(canReplace(world.getBlock(x - 1, y, z)))
            {
                replace(world, x, y, z, -1, 0, 0);
            }
    
            if(canReplace(world.getBlock(x, y, z + 1)))
            {
                replace(world, x, y, z, 0, 0, 1);
            }
    
            if(canReplace(world.getBlock(x, y, z - 1)))
            {
                replace(world, x, y, z, 0, 0, -1);
            }
    
            if(!(canReplace(world.getBlock(x, y + 1, z)) || canReplace(world.getBlock(x, y - 1, z)) || canReplace(world.getBlock(x + 1, y, z)) || canReplace(world.getBlock(x - 1, y, z)) || canReplace(world.getBlock(x, y, z + 1)) || canReplace(world.getBlock(x, y, z - 1))))
            {
                world.setBlock(x, y, z, BlockManager.fossil);
            }
        }
        
        public void replace(World world, int x, int y, int z, int xOff, int yOff, int zOff)
        {
            world.setBlock(x, y, z, BlockManager.fossil);
            world.setBlock(x + xOff, y + yOff, z + zOff, BlockManager.infection);
        }
        
        public boolean canReplace(Block block)
        {
            List<Block> disallowedBlocks = Arrays.asList(Blocks.air, Blocks.bedrock, BlockManager.fossil, BlockManager.infection, BlockManager.altar);
            
            return !(disallowedBlocks.contains(block));
        }
    }




    Block code:

    public class InfectorBlock extends BlockContainer
    {
        public InfectorBlock()
        {
            super(Material.rock);
            this.setTickRandomly(true);
        }
        
        @Override
        public TileEntity createNewTileEntity(World var1, int metadata)
        {
            return new TileEntityInfectorBlock();
        }
        
        @Override
        public int tickRate(World world)
        {
            return 8;
        }
    }
    Posted in: Modification Development
  • 0

    posted a message on [Solved] Blocks - updateTick(World world) very slow, regardless of output.
    Alright. The only reason why I posted that is because it used to be fast, and for some reason it slowed. Nothing else did, but my block. Thinking back, it's because there was a tile entity assigned to the block :/



    Thanks.
    Posted in: Modification Development
  • 0

    posted a message on [Solved] Blocks - updateTick(World world) very slow, regardless of output.
    Alright, this isn't relevant anymore. However, I have a new issue. I have this block, but the tickRate is very slow regardless of what I set it to:



    public class InfectorBlock extends Block
    {
        public InfectorBlock()
        {
            super(Material.rock);
            this.setTickRandomly(true);
            BlockMycelium m;
        }
        
        @Override
        public void updateTick(World world, int x, int y, int z, Random rand)
        {
            super.updateTick(world, x, y, z, rand);
            
            if(!world.isRemote && CorruptionMod.spread)
            {   
                System.out.println("Tick!");
                
                if(canReplace(world.getBlock(x, y + 1, z)))
                {
                    replace(world, x, y, z, 0, 1, 0);
                } else {}
                
                if(canReplace(world.getBlock(x, y - 1, z)))
                {
                    replace(world, x, y, z, 0, -1, 0);
                } else {}
                
                if(canReplace(world.getBlock(x + 1, y, z)))
                {
                    replace(world, x, y, z, 1, 0, 0);
                } else {}
                
                if(canReplace(world.getBlock(x - 1, y, z)))
                {
                    replace(world, x, y, z, -1, 0, 0);
                } else {}
                
                if(canReplace(world.getBlock(x, y, z + 1)))
                {
                    replace(world, x, y, z, 0, 0, 1);
                } else {}
                
                if(canReplace(world.getBlock(x, y, z - 1)))
                {
                    replace(world, x, y, z, 0, 0, -1);
                } else {}
            }
        }
        
        @Override
        public int tickRate(World world)
        {
            return 4;
        }
        
        public void replace(World world, int x, int y, int z, int xOff, int yOff, int zOff)
        {
            world.setBlock(x, y, z, BlockManager.fossil);
            world.setBlock(x + xOff, y + yOff, z + zOff, this);
        }
        
        public boolean canReplace(Block block)
        {
            List<Block> disallowedBlocks = Arrays.asList(Blocks.air, Blocks.bedrock, BlockManager.fossil, BlockManager.infection, BlockManager.altar);
            
            return !(disallowedBlocks.contains(block));
        }


    Posted in: Modification Development
  • 0

    posted a message on [Solved] Blocks - updateTick(World world) very slow, regardless of output.
    I don't have Natura as a dependency, it is just upon testing with my modpack that it does that. It also does that with ExtraUtilities' Taint blocks!



    Here's the imports (checked 'em twice)

    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import java.util.Arrays;
    import java.util.List;
    import java.util.Random;
    import me.dudemister.forge.endgame.CorruptionMod;
    import me.dudemister.forge.endgame.common.BlockManager;
    import me.dudemister.forge.endgame.lib.Location;
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.init.Blocks;
    import net.minecraft.world.World;
    Posted in: Modification Development
  • 0

    posted a message on [Solved] Blocks - updateTick(World world) very slow, regardless of output.
    I've used that before, and it works, but I need to create a new instance for a use I'm implementing after I fix this.
    Posted in: Modification Development
  • 0

    posted a message on [Solved] Blocks - updateTick(World world) very slow, regardless of output.
    Update 1: I removed Natura, and now it just places air.
    Posted in: Modification Development
  • 0

    posted a message on [Solved] Blocks - updateTick(World world) very slow, regardless of output.

    Hello! I have a block, shown here:
     public class CorruptBlock extends Block { public final List immuneBlocks = Arrays.asList(Blocks.bedrock, Blocks.air, Blocks.end_stone, this); public Location location; public CorruptBlock() { super(Material.cake); this.setTickRandomly(true); } public CorruptBlock(Location location) { super(Material.cake); location.world.spawnParticle("magicCrit", location.x, location.y, location.z, location.x, location.y, location.z); this.setTickRandomly(true); } @Override public void updateTick(World world, int x, int y, int z, Random rand) { super.updateTick(world, x, y, z, rand); if(!world.isRemote && CorruptionMod.spread) { location = new Location(world, x, y, z); eat(world, x, y, z); eat(world, x, y + 1, z); eat(world, x, y - 1, z); eat(world, x + 1, y, z); eat(world, x - 1, y, z); eat(world, x, y, z + 1); eat(world, x, y, z - 1); } } @SideOnly(Side.CLIENT) @Override public void randomDisplayTick(World world, int x, int y, int z, Random rand) { if(rand.nextInt(8) == 0) { world.spawnParticle("reddust", x + 0.5D, y + 1.3D, z + 0.5D, 1, 0, 0); } } @Override public int tickRate(World world) { return 12; } public void eat(World world, int x, int y, int z) { if(!(immuneBlocks.contains(world.getBlock(x, y, z)))) { world.setBlock(x, y, z, new BlockCorruption(new Location(world, x, y, z))); } } } 
    And when it calls eat(), and actually places a new CorruptBlock(), it places Natura's Tainted Soil instead. Know why?




    New problem, check last post at bottom!
    -Alex
    Posted in: Modification Development
  • 0

    posted a message on Custom model - move cube like dropped item.
    I have, that's where I got

    [pre]float var28 = (new Random().nextFloat() * 2.0F - 1.0F) * 0.3F;[/pre]




    But as I mentioned, it creates a highly skippy up-and-down motion. Like instead of sliding to the next position, it teleports to it.
    Posted in: Modification Development
  • 0

    posted a message on Set biome for one block location only
    I'll take a look at that, I was not aware there was functions for getting the array!
    Posted in: Modification Development
  • 0

    posted a message on Custom model - move cube like dropped item.
    Hello again! I've got a custom model, relevant part here:



    public void setRotationAngles(Entity ent, float f, float f1, float f2, float f3, float f4, float f5)
      {
        super.setRotationAngles(f, f1, f2, f3, f4, f5, ent);
        float var28 = (new Random().nextFloat() * 2.0F - 1.0F) * 0.3F; //This creates a f**ked up glitching up and down motion.
        centrecube.offsetY = var28;
      }
    
    





    Anyways, I need to create a motion that is exactly like an item when dropped on the ground (You know, that up and down levitating feel?)



    Thanks!

    -Alex
    Posted in: Modification Development
  • 0

    posted a message on Set biome for one block location only
    Making a type of world-based infection, and I need to change the biome for the blocks it infects. I've got the biome, I have the infection, I just need to stick them together with Java-brand Superglue.
    Posted in: Modification Development
  • To post a comment, please or register a new account.