-
[1.10.2] Checking blocks around player
Wow, that was clean looking.
-
[1.10.2] Checking blocks around player
To clarify. I need a function to check if these 3 conditions are met: Player standing on obsidian. There are redstone around the player. Outside of the redstone there should be air blocks. So what do you think of this: public boolean checkRitualOuter(World world, BlockPos playerpos){ boolean isInside = false; BlockPos pos1 = new BlockPos(playerpos.getX()-2, playerpos.getY(), playerpos.getZ()-2); BlockPos pos2 = new BlockPos(playerpos.getX()+2, playerpos.getY(), playerpos.getZ()+2); BlockPos pos3 = new BlockPos(playerpos.getX()-1, playerpos.getY(), playerpos.getZ()-1); BlockPos pos4 = new BlockPos(playerpos.getX()+1, playerpos.getY(), playerpos.getZ()+1); for (BlockPos p1 : BlockPos.getAllInBox(pos1, pos2)) { isInside = false; for (BlockPos p2 : BlockPos.getAllInBox(pos3, pos4)) { if(p1 == p2){ isInside = true; } } if(!isInside){ if(world.getBlockState(p1).getBlock() != Blocks.AIR){ return false; } }else{ if(p1 == playerpos && world.getBlockState(playerpos.down(1)).getBlock() != Blocks.OBSIDIAN){ return false; }else{ if(world.getBlockState(p1).getBlock() != Blocks.REDSTONE_WIRE){ return false; } } } } return true; }
-
[1.10.2] Checking blocks around player
Hi. Is there a simplier way to check if the blocks around(with 1 spacce inbetween) the player is air than the following code. The code seems so ugly.. BlockPos posStart = player.getPosition(); if(world.getBlockState(posStart.north(2)).getBlock() == Blocks.AIR && world.getBlockState(posStart.north(2).east(1)).getBlock() == Blocks.AIR && world.getBlockState(posStart.north(2).east(2)).getBlock() == Blocks.AIR && world.getBlockState(posStart.north(2).west(1)).getBlock() == Blocks.AIR && world.getBlockState(posStart.north(2).west(2)).getBlock() == Blocks.AIR && world.getBlockState(posStart.south(2)).getBlock() == Blocks.AIR && world.getBlockState(posStart.south(2).east(1)).getBlock() == Blocks.AIR && world.getBlockState(posStart.south(2).east(2)).getBlock() == Blocks.AIR && world.getBlockState(posStart.south(2).west(1)).getBlock() == Blocks.AIR && world.getBlockState(posStart.south(2).west(2)).getBlock() == Blocks.AIR && world.getBlockState(posStart.west(2)).getBlock() == Blocks.AIR && world.getBlockState(posStart.west(2).north(1)).getBlock() == Blocks.AIR && world.getBlockState(posStart.west(2).south(1)).getBlock() == Blocks.AIR && world.getBlockState(posStart.east(2)).getBlock() == Blocks.AIR && world.getBlockState(posStart.east(2).north(1)).getBlock() == Blocks.AIR && world.getBlockState(posStart.east(2).south(1)).getBlock() == Blocks.AIR){ }
-
[1.10.2] [SOLVED] How to test block is air or fire etc.
Actually it compiled, both version worked But i stuck with blockIn == Blocks.Fire check. It was probably too late in the night to test the simpliest thing.
-
[1.10.2] [SOLVED] How to test block is air or fire etc.
Ok, thanks. I can do this? Material m = blockIn.getBlockState().getBaseState().getMaterial(); if(m == Material.AIR){ return true; } But how do I check if blockIn (which is Block) is Blocks.FIRE ? blockIn.getBlockState().getBlock() ?
-
[1.10.2] [SOLVED] How to test block is air or fire etc.
How can i test if a block is Material.Air or Blocks.FIRE etc.. ? I found this function in Minecraft block: /** * Get a material of block */ @Deprecated public Material getMaterial(IBlockState state) { return this.blockMaterial; } Which as you see is deprecated. (and why do you need to pass along IBlockState?!) So is there any similar function that is'nt deprecated?
-
[1.10.2] [SOLVED] Particles stopped rendering texture
I got it working again. It was my EventManager that was'nt loading. So this was never triggered. @SideOnly(Side.CLIENT) @SubscribeEvent public void onTextureStitch(TextureStitchEvent event){ ResourceLocation sacrificealtarParticleRL = new ResourceLocation("ancienttech","particles/" + ModNames.PARTICLE_CONSUME); event.getMap().registerSprite(sacrificealtarParticleRL); }
-
[1.10.2] [SOLVED] Particles stopped rendering texture
Nobody? Is there anywhere else I can try to register the texture?
-
[1.10.2] [SOLVED] Particles stopped rendering texture
Hi. Suddenly my custom particles stopped rendering the texture, I dont know what changed that could do this. Now it only shows the purple/black texture. I debugged it and came to the conclusion that my texture is not loaded. Image of debugger: i've tried changing public ResourceLocation texture = new ResourceLocation(ModNames.MOD_NAME, "particles/"+ ModNames.PARTICLE_CONSUME); to public ResourceLocation texture = new ResourceLocation("ancienttech", "particles/sacrificealtar"); and public ResourceLocation texture = new ResourceLocation("ancienttech", "particles/sacrificealtar.png"); and public ResourceLocation texture = new ResourceLocation("ancienttech", "textures/particles/sacrificealtar"); and public ResourceLocation texture = new ResourceLocation("ancienttech", "textures/particles/sacrificealtar.png"); my particle class (yeah its still messy im in the works to clean up my code): Particle in clientproxy: Code in my tilentity to spawn particles: asset path (image) There are no missing texture errors in console, no errors at all. I really could use a second pair of eyes, the code was working before and the particles were rendering just fine.
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
Tried cube_all, but got warnings so Im going with block. Thanks again for the help. I really appreciate it.
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
Thanks! That worked. Now I will try to figure out the right parent to use.
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
https://s32.postimg.org/6qcjeap3p/2d_image.png[/img]
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
Model Block: Model Item:
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
Yeah I tried with the brackets on inventory also, no change. still renders 2d.
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
I got it from here: http://modwiki.temporal-reality.com/mw/index.php/Render_Block_Basic-1.9 When I was trying to render it in inventory. But if I remove the [] eg. "variants": { "normal": {}, "inventory": {"y": 90, "x": 90 } } I get errors:
IPS spam blocked by CleanTalk.