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.

f1rSt1kChannel

Members
  • Joined

  • Last visited

Everything posted by f1rSt1kChannel

  1. Have you worked with github? How convenient for me to publish my mod?
  2. Well all mods 1.7.2 repository looks the same, it seems to me, this is done automatically somehow, no?
  3. As is normal upload your mod on github? To my repository looked like here: https://github.com/Glitchfiend/BiomesOPlenty Help, please!
  4. Do not need to create anything. And instead of "checkWorld" write MODID + "BlaBlaBla".
  5. @SubscribeEvent public void playerLoggedIn(PlayerLoggedInEvent event){ if(event.player.getEntityData().hasKey("checkWorld")){ return; } event.player.getEntityData().setBoolean("checkWorld", true); System.out.println("Open your GUI"); }
  6. 1 - side, 2 - metadata
  7. @ForgeSubscribe public onChangeGUI(GuiOpenEvent e){ if(e.gui instanceof GuiMainMenu){ e.gui = new CustomGuiMainMenu(); } }
  8. player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 5, 0, false));
  9. GL11.glRotated(180, 0, 0, 0);
  10. >EntityRegistry.addSpawn(MyMob.class, 80, 6, 10, EnumCreatureType.monster, Mycustombiome); Change EnumCreatureType.monster to EnumCreatureType.creature.
  11. I need to render the object as usual, but increased its size to shift his position. How do I do this? Sorry for my english, I'm from Ukraine.
  12. Use this: public static BiomeGenBase[] biomesWithout(BiomeGenBase... biomesWithout){ ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(); for(BiomeGenBase biome : BiomeGenBase.biomeList){ for(int i = 0; i < biomesWithout.length; i++){ if(biome != null && biome != biomesWithout[i]){ biomes.add(biome); } } } return biomes.toArray(new BiomeGenBase[biomes.size()]); } And: EntityRegistry.addSpawn(EntityPig2.class, 1, 1, 1, EnumCreatureType.creature, biomesWithout(/** here write biomes in which the mob will not spawn */));
  13. No, this will crash, since biomeList contains null values! Look here for a solution: http://www.minecraftforge.net/forum/index.php/topic,17455.msg88353.html#msg88353 I am sorry to have confused.
  14. EntityRegistry.addSpawn(EntityPig2.class, 1, 1, 1, EnumCreatureType.creature, BiomeGenBase.biomeList);
  15. Create class: public class BlockReplaceHelper{ public static boolean replaceBlock(Block toReplace, Class<? extends Block> blockClass){ Field modifiersField=null; try{ modifiersField=Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); for(Field field:Blocks.class.getDeclaredFields()){ if (Block.class.isAssignableFrom(field.getType())){ Block block=(Block)field.get(null); if (block==toReplace){ String registryName=Block.blockRegistry.getNameForObject(block); int id=Block.getIdFromBlock(block); ItemBlock item=(ItemBlock)Item.getItemFromBlock(block); System.out.println("Replacing block - "+id+"/"+registryName); Block newBlock=blockClass.newInstance(); FMLControlledNamespacedRegistry<Block> registry=GameData.blockRegistry; registry.putObject(registryName,newBlock); Field map=RegistryNamespaced.class.getDeclaredFields()[0]; map.setAccessible(true); ((ObjectIntIdentityMap)map.get(registry)).func_148746_a(newBlock,id); map=FMLControlledNamespacedRegistry.class.getDeclaredField("namedIds"); map.setAccessible(true); ((BiMap)map.get(registry)).put(registryName,id); field.setAccessible(true); int modifiers=modifiersField.getInt(field); modifiers&=~Modifier.FINAL; modifiersField.setInt(field,modifiers); field.set(null,newBlock); Field itemblock=ItemBlock.class.getDeclaredFields()[0]; itemblock.setAccessible(true); modifiers=modifiersField.getInt(itemblock); modifiers&=~Modifier.FINAL; modifiersField.setInt(itemblock,modifiers); itemblock.set(item,newBlock); System.out.println("Check field: "+field.get(null).getClass()); System.out.println("Check registry: "+Block.blockRegistry.getObjectById(id).getClass()); System.out.println("Check item: "+((ItemBlock)Item.getItemFromBlock(newBlock)).field_150939_a.getClass()); } } } }catch(Exception e){ e.printStackTrace(); return false; } return true; } } And BlockReplaceHelper.replaceBlock(Block.farmLand, NewFarmLand.class)
  16. for(int i = 0; i < 9; i++){ if(world.getBlockId(x, y + i, z) == 0){ //generation } }

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.