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

Everything posted by DasKaktus

  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:
  15. THanks for your patience. But I tried: { "forge_marker": 1, "defaults": { "model": "ancienttech:blockSacrificeAltar" }, "variants": { "normal": [{}], "inventory": {"y": 90, "x": 90 } } } And nothing changed, still 2d. Do I need code for rendering it in inventory?
  16. any examples or information anywhere about this? I currently have: { "forge_marker": 1, "defaults": { "model": "ancienttech:blockSacrificeAltar" }, "variants": { "normal": [{}], "inventory": [{}] } } Which works, but the inventory is 2d. I've tried adding what I could scour the internet for but it only throws errors at me. And the blockstates in the minecraft reference is non-existent. ALsp looked at other mods but cant find any that uses this.
  17. Do you know how I make it slightly rotated in inventory view? As of now it is viewed from the side. I want it more like the blocks, view from an angle above.
  18. You know what, i'm such a derp. I have 2 blocks, which one of them worked fine (its a simple cube block) but my custom model did not work. When I looked upp the code för my rendering I noticed this: registerRender(ancientPageBlock); registerRender(ancientPageBlock); So when I changed it to what it was supposed to be: registerRender(ancientPageBlock); registerRender(sacrificeAltar); Look and behold, it worked. But great thanks for your time, I've spent a couple hours trying to understand why it was'nt rendering. Tinkered with tje json files and rearrenging code etc. So yeah, I'm a derp.
  19. Hi, I have searched and I have found nothing on how to render my custom block in my inventory and in my hand. Can somebody point me in the right direction on how I can do this. I looked thru the source on things that I thought could help me (enchanting table, chest, etc.) But I cant find how it is actually functions. Thanks.
  20. Oh, how I feel stupid now.. I knew that.. But as long as we are on semi-topic... How come all "players" spawn at the same place? If i load up and dig a hole, close the client. start the client back up, and im logged in as a different user i spawn at the last players location.
  21. Hi a quick question. My Achievements gets reset everytime i start the client. Is this because when I build from eclipse the jar gets renewed and the achievements gets reset?
  22. Sorry no github. But I put it in a pastebin. My first particle ever so.. Dont take the code to seriously because its an iteration of trial and error and much of the junk code are still there. And a lot of stitching together what I could read about it. http://pastebin.com/R6aFectz And in my proxy: ConsumeParticles particle = new ConsumeParticles( entity.worldObj, entity.posX + entity.worldObj.rand.nextFloat() * entity.width * 2.0F - entity.width, entity.posY + 0.5D + entity.worldObj.rand.nextFloat() * entity.height, entity.posZ + entity.worldObj.rand.nextFloat() * entity.width * 2.0F - entity.width, targetX + 0.5, targetY + 1, targetZ + 0.5,10, col.toInt(),1F); Minecraft.getMinecraft().effectRenderer.addEffect(particle);

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.