Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DasKaktus

Members
  • Joined

  • Last visited

  1. Wow, that was clean looking.
  2. 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; }
  3. 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){ }
  4. 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.
  5. 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() ?
  6. 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?
  7. 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); }
  8. Nobody? Is there anywhere else I can try to register the texture?
  9. 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.
  10. Tried cube_all, but got warnings so Im going with block. Thanks again for the help. I really appreciate it.
  11. Thanks! That worked. Now I will try to figure out the right parent to use.
  12. https://s32.postimg.org/6qcjeap3p/2d_image.png[/img]
  13. Yeah I tried with the brackets on inventory also, no change. still renders 2d.
  14. 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:

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.