Everything posted by DasKaktus
-
[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:
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
No errors.
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
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?
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
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.
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
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.
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
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.
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
Yes, I have JSON models.
-
[1.10.2] [SOLVED*2] Rendering custom block in hand and inventory
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.
-
Achievements reset
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.
-
Achievements reset
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?
-
[1.10.2] Custom Particles?
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);
IPS spam blocked by CleanTalk.