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.

Burpingdog1

Members
  • Joined

  • Last visited

  1. Burpingdog1 changed their profile photo
  2. yeah was referring to his code, prob shouldn't have posted it but I didn't want to just give him the code either
  3. I have never used that before, but my best guess is you'd need to just make the itemstack you are returning from getContainerItem to be 1 less durability than the itemstack parameter... or else no durability loss will occur. Also is the if statement necessary? @Override public ItemStack getContainerItem(ItemStack itemStack) { if (!hasContainerItem(itemStack)) { return ItemStack.EMPTY; } return new ItemStack(getContainerItem()); } @Override public boolean hasContainerItem(ItemStack stack) { return hasContainerItem(); } I'd just have getContainerItem return the item -1 durability & hasContainerItem to true
  4. oh, whats the difference between using Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register and ModelLoader.setCustomModelResourceLocation ?
  5. I think the problem is in your moditems file, you forgot to give it the destination to your mod folder new ModelResourceLocation(Reference.MOD_ID+":"+item.getRegistryName(), "inventory")
  6. Alright, guess first time I read it forgot the offset part... so I offsetted the x/z values by 8 and it works great! Thanks, now what is the best way in making it gradually turning into the dense stone instead of just going straight to dense stone after y<=30
  7. when loading new chunks the game freezes making me have to force close.. this is my code I used public class WorldGen implements IWorldGenerator { private WorldGenerator genDenseStone; public WorldGen() { genDenseStone = new GenDenseStone(); } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.getDimension()) { case -1: netherGen(world, random, chunkX, chunkZ, chunkGenerator, chunkProvider); break; case 0: overworldGen(world, random, chunkX, chunkZ, chunkGenerator, chunkProvider); break; case 1: endGen(world, random, chunkX, chunkZ); break; } } private void overworldGen(World world, Random random, int chunkX, int chunkZ, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { genDenseStone.generate(world, random, new BlockPos(chunkX, 30, chunkZ)); } private void netherGen(World world, Random random, int blockX, int blockZ, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { } private void endGen(World world, Random random, int blockX, int blockZ) { } public class GenDenseStone extends WorldGenerator { @Override public boolean generate(World worldIn, Random rand, BlockPos pos) { int x = pos.getX()*16; int yMax = pos.getY(); int z = pos.getZ()*16; for(int a = 0; a < 16; a++) { for(int b = 0; b < 16; b++) { for(int c = 0; c <= yMax; c++) { if(worldIn.getBlockState(new BlockPos(a+x,c,b+z)).getBlock() == Blocks.STONE) { worldIn.setBlockState(new BlockPos(a+x, c, b+z), GCBlocks.denseStone.getDefaultState()); } } } } return true; } }
  8. is there an example of how to use ChunkProviders/IChunkGenerators? Through my googling all I found was tutorials using WorldGenerator
  9. Few questions, do you know any good tutorials that go in depth with world generation(Explains what chunkX/chunkZ is)? and can I use the ChunkProvider/IChunkGenerator variables in the generate method in the WorldGen class, or would I need to make a new ChunkProvider class? if so would I just use chunkProvider.getLoadedChunk(chunkX, chunkZ).setBlockState(pos, state);
  10. any stone below y 50 would be replaced is what I would be doing
  11. look through the entityegg class it might help
  12. Lately I've been working with WorldGenerator trying to replace stone below a certain y level with a harder stone and I have been stuck for few days figuring out so decided to ask for help on here. public class WorldGen implements IWorldGenerator { private WorldGenerator genDenseStone; public WorldGen() { genDenseStone = new WorldGenDenseStone(); } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.getDimension()) { case -1: netherGen(world, random, chunkX, chunkZ); break; case 0: overworldGen(world, random, chunkX, chunkZ); break; case 1: endGen(world, random, chunkX, chunkZ); break; } } private void overworldGen(World world, Random random, int chunkX, int chunkZ) { } private void netherGen(World world, Random random, int blockX, int blockZ) { } private void endGen(World world, Random random, int blockX, int blockZ) { } } public class WorldGenDenseStone extends WorldGenerator { @Override public boolean generate(World worldIn, Random rand, BlockPos pos) { return false; } } the worldgen class for dense stone is default because I've been taking away code since it wasn't working guessing I don't really have a good idea how generating stuff works even at looking at some tutorials. I am bad at explaining, so hope you guys understand what i mean and can push me in the right direction
  13. you probably hava a 32bit java installed, had this problem before install the 64bit
  14. Getting the pickblock, saving it to a variable, and checking if it is null? Like, how else? Yeah, forgot to take out the getDisplayName so kept crashing... Seems as if I had a long day lol
  15. the getDisplayName().equals() one, how would I check if the block doesnt have a pickItem?
  16. Ah thanks for the reminder of that, derpy old me public class LookGUI extends GuiScreen { public LookGUI(Minecraft mc, EntityPlayer player ) { if(mc.currentScreen == null ) { ScaledResolution scale = new ScaledResolution(mc); int width = scale.getScaledWidth(); int height = scale.getScaledHeight(); RayTraceResult coords = mc.getRenderViewEntity().rayTrace(5, 1); Block blockLookingAt = mc.theWorld.getBlockState(coords.getBlockPos()).getBlock() ; String name =""; if(!(blockLookingAt.equals(Blocks.AIR))) { if(blockLookingAt.getPickBlock(mc.theWorld.getBlockState(coords.getBlockPos()), coords, mc.theWorld, coords.getBlockPos(), player).getDisplayName().equals(null)) name=blockLookingAt.getLocalizedName(); else name = blockLookingAt.getPickBlock(mc.theWorld.getBlockState(coords.getBlockPos()), coords, mc.theWorld, coords.getBlockPos(), player).getDisplayName(); if(name != null)drawCenteredString(mc.fontRendererObj, name, width/2, 5, Integer.parseInt("FFAA00", 16)); } } } } line 44 is near the null checker I have the if(blockLookingAt.getPickBlock(mc.theWorld.getBlockState(coords.getBlockPos()), coords, mc.theWorld, coords.getBlockPos(), player).getDisplayName().equals(null))

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.