Jump to content

Durtle02

Members
  • Posts

    59
  • Joined

  • Last visited

Everything posted by Durtle02

  1. Alright my bad, thanks for the help. I just didn't know what you meant by :: . Last question, would world.provider.getDimension() work in theory?
  2. Thanks for the quick response! I'm not too familiar with lambda expressions and I like to know what I'm doing with my code. I've read though a few explanations and from what I can tell this is a Comparator Lambda, however, I still don't understand how it's used as I've never worked with them. If it's not too much ask, could you give an explanation and or usage example?
  3. If I have a variable of type World.class how would I get the ID of it? As far as I understand the dimension ID is not stored in the world object. What I need to check is if the dimension is the overworld or a custom dimension I have created. For example if I was to use onBlockActivated how would I get the ID of the world passed though as a parameter?
  4. No so much wasting time but just having little knowledge of what I'm doing, but that's why people help, so then later I can help too.
  5. Alright will do! Thanks for all the help and bearing me, I have very little clue what I'm doing and with such little preexisting resources it makes it hard to find out. I always hate asking on the forums because I feel like I'm wasting peoples time so thank you.
  6. So then to test for in other world what would I run in '//Do stuff'? Like how this world.getBlockState(posNumber).getBlock() will modify in the overworld with what I have but what would it look like for the mirrorworld?
  7. It's just an example. If I wanted to use detection like that with the other world. Pos is blocks location. public void blockSpread(World world, BlockPos posNumber) { if (world.getBlockState(posNumber).getBlock() != MirrorWorld.getBlockState(posNumber).getBlock()){ world.setBlockState(posNumber, MirrorWorld.getBlockState(posNumber)); } } Like this.
  8. And if I wanted to use it like this public void blockSpread(World world, BlockPos posNumber){ if (world.getBlockState(posNumber).getBlock() != Blocks.AIR){ } } how would I do so?
  9. Where would I go doing this? In my dimension files, correct?
  10. I don't know how to explain it but they do. Also I want players to be able to get there.
  11. You will need to be able to get to the dimension though.
  12. So you place it and it checks the surrounding blocks. If they are different, if they are it sets them as itself and turns itself to whatever the block is at it's cords in the mirror world (using random ticks). If it's not the same, it sets itself as air and doesn't change any others. Recreating this:
  13. I'm remaking an old mod and one of the blocks is regenerative of the mirror world. So it looks in mirror world, checks if blocks are same, and if not, makes it so.
  14. Hi, so I'd like to create an exact copy of the overworld so I can use a block as a regenerative thing however I don't know where to start. Could I get a quick run down of how the dimension generation works, how I can copy the world seed and where the files are that specifically handle generating the overworld are in the MC source code are? Also any UPDATED tutorials you have would be cool. Thanks. Durtle02
  15. Hi, I had just released the first version of my mod when my raw files got corrupted. I have a working version of the mod but don't have the raw code to continue development. Is there any way I can get the code back from the compiled mod?
  16. How do I add a new world generation to the generators tab in the create new world tab? Also how would I edit and exact x and z axis?
  17. #1 The previous reply still didn't answer how to use block states. I know my code is messy and the block placement works for now. I just need to no how to use the block states to do what I want it to do. #2 Also how do I code it in so the block has the same textures in game for each block state. Right now I'm getting the error texture when it's placed but the actual texture when in hand.
  18. #1 I forgot to mention that my code was a mess. #2 I copied it from the vanilla MC code. #3 I didn't know much of it or how to use it. #4 I didn't know if I had to place the block before setting the data and didn't realize that the second line would also place the block. #5 Didn't know that those were things, once again, my code is awful and I want it to work before I optimize it. Thanks for the help
  19. Okay so I've tried a few things and I can't get blockstates to work for me. The premise of this block is I wrote out my code and it doesn't work. Could someone tell me how to operate this code? The block state code was originally from net.minecraft.block.BlockCrops.class. package TestMod.tutorial.block; import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class OrangeGoo extends BlockBase{ public static final PropertyInteger SDIR = PropertyInteger.create("sdir", 0, 6); public OrangeGoo(String name){ super(Material.ROCK, name); setTickRandomly(true); setHardness(0.1f); setResistance(1f); } //metadata protected PropertyInteger getSDirProperty(){return SDIR;} protected int getSDir(IBlockState state){return (state.getValue(this.getSDirProperty()));} public IBlockState withSDir(int sdir){return this.getDefaultState().withProperty(this.getSDirProperty(), sdir);} @Override public IBlockState getStateFromMeta(int meta){return this.withSDir(meta);} @Override public int getMetaFromState(IBlockState state){return this.getSDir(state);} @Override protected BlockStateContainer createBlockState(){return new BlockStateContainer(this, new IProperty[] {SDIR});} //creative tab @Override public OrangeGoo setCreativeTab(CreativeTabs tab){ super.setCreativeTab(tab); return this; } int direction; //spreading block public void blockSpread(World world, IBlockState state, BlockPos posNumber, BlockPos inversePos,int direction,int j){ if(world.getBlockState(inversePos).getBlock() == ModBlocks.greengoo && world.getBlockState(posNumber).getBlock() != ModBlocks.redgoo){ if(j==direction){ world.setBlockState(posNumber, ModBlocks.orangegoo.getDefaultState()); world.setBlockState(posNumber, state.withProperty(SDIR, direction), 6); // Alternative - (SDIR, Integer.valueOf(direction)), 6); } } } @Override public void updateTick(World world, BlockPos pos, IBlockState state, Random rand){ int j = (state.getValue(SDIR)); BlockPos pos0 = new BlockPos((pos.getX()), (pos.getY()) , pos.getZ()); BlockPos xplus = new BlockPos((pos.getX()+1), (pos.getY()) , pos.getZ());//1 BlockPos xminus = new BlockPos((pos.getX()-1), (pos.getY()) , pos.getZ());//2 BlockPos yplus = new BlockPos((pos.getX()), (pos.getY()+1) , pos.getZ());//3 BlockPos yminus = new BlockPos((pos.getX()), (pos.getY()-1) , pos.getZ());//4 BlockPos zplus = new BlockPos((pos.getX()), (pos.getY()) , pos.getZ()+1);//5 BlockPos zminus = new BlockPos((pos.getX()), (pos.getY()) , pos.getZ()-1);//6 blockSpread(world, state, xplus, xminus,1,j); blockSpread(world, state, xminus, xplus,2,j); blockSpread(world, state, yplus, yminus,3,j); blockSpread(world, state, yminus, yplus,4,j); blockSpread(world, state, zplus, zminus,5,j); blockSpread(world, state, zminus, zplus,6,j); } @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY){ int j = (state.getValue(SDIR)); BlockPos pos0 = new BlockPos((pos.getX()), (pos.getY()) , pos.getZ()); BlockPos xplus = new BlockPos((pos.getX()+1), (pos.getY()) , pos.getZ());//1 BlockPos xminus = new BlockPos((pos.getX()-1), (pos.getY()) , pos.getZ());//2 BlockPos yplus = new BlockPos((pos.getX()), (pos.getY()+1) , pos.getZ());//3 BlockPos yminus = new BlockPos((pos.getX()), (pos.getY()-1) , pos.getZ());//4 BlockPos zplus = new BlockPos((pos.getX()), (pos.getY()) , pos.getZ()+1);//5 BlockPos zminus = new BlockPos((pos.getX()), (pos.getY()) , pos.getZ()-1);//6 blockSpread(world, state, xplus, xminus,1,j); blockSpread(world, state, xminus, xplus,2,j); blockSpread(world, state, yplus, yminus,3,j); blockSpread(world, state, yminus, yplus,4,j); blockSpread(world, state, zplus, zminus,5,j); blockSpread(world, state, zminus, zplus,6,j); return false;} }
  20. Just make two separate blocks. You can make them drop separate things. Have the bottom block have a random tick and when it reaches a certain age the bottom block would have an if then statements saying, if there is air above me, then place this other block.
  21. The winner is Animefan8888. I am not making crops.
  22. I've tried to read the minecraft forge documentation for block states but it's such a mess I can't make any sense out of it. Could someone help me with the actual code? Help is greatly appriciated.
  23. How do I make a block with metadata and how do I have that block make a new block with metadata? For an example I want to have a block and that block will get an input, north, for example and then create a new block in the north direction. Then it would send that metadata of north to the next block. In the end it would make a line of blocks going north.
  24. If it's not too much could you just get me the code? I've spent hours trying to figure it out
  25. I can't seem to get it to work. I tried using this public int tickRate(World worldIn){return 1;} But it had no effect. I tried changing the return to numbers in the hundreds and thousands but still nothing changed. I also tried world.scheduleUpdate(posNumber, this, 200); I don't know what methods to use in what combination to get it to work.
×
×
  • Create New...

Important Information

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