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.

GotoLink

Members
  • Joined

  • Last visited

Everything posted by GotoLink

  1. I mean that your GameRegistry.addRecipe line is at a wrong place. Put it in: public void load(FMLInitializationEvent event){
  2. Write your code in a method please. :'(
  3. Where do you put code in Java ?
  4. Texture should be in mcp/src/minecraft/assets/mochickens/textures/mobs/bluechicken.png
  5. You can use ItemStack nbt and the onItemRightClick method.
  6. You can use idDroped, damageDroped, quantityDroped in Block, if it is at block break you want it to happen.
  7. @Draco18s There is only one boolean in Item#onUpdate(...) and it is true only if item is the current held one.
  8. You don't need a container if you don't want inventory slots. Could you show your Gui class ? It would be easier to help you.
  9. Because they are from client and server side of the other event. You are welcome. Which means it should always open at this point ? I guess there is something wrong in your gui handling code, then.
  10. @ss7 Nice use of reflection here, but you have for (Field field : ModClass.class.getFields()) Which means you set a field for each block. Granted, a lot of people do this. I even do this () when i don't have much. But my suggestion only has two fields. (and it could be reduced to one, if you so wish) public class HandlerRegistry{ public static Map<String,BlockHandler> blocks = new HashMap(); public static Map<String,ItemHandler> items = new HashMap(); public static void register(BlockHandler block){ blocks.put(block.getName(), block); } public static void register(ItemHandler item){ items.put(item.getName(), item); } public static BlockHandler getBlock(String name){ blocks.get(name); } public static ItemHandler getItem(String name){ items.get(name); } } And that is only needed for blocks interactions anyway. Everything else can be done within BlockHandler.
  11. I'd say because people tend to follow tutorials and prefer to copy/paste lines like Ugly as hell. :'(
  12. public void onLogin(LivingSpawnEvent event) { if(event.entity instanceof EntityPlayer) Spawn is for mobs, actually... if(!ep.hasPlayerClass()) When is this value set to true ?
  13. 2/ Register your command to ClientCommandHandler.
  14. Name the Render class differently and see what happens.
  15. The entity should be spawned on server side only. Then all clients should know what to render for it with RenderingRegistry.registerEntityRenderingHandler(...)
  16. Yes, you can. I'd recommend object oriented code, though. A fast template : public class BlockHandler{ public int blockId//hold the unique data id for the block public BlockHandler(Class<? extends Block> clazz,Class[] paramType, Object[] param, int id, String unlocName, String oreName,...){ blockId = id; Block block = null; try{ block = clazz.getConstructor(paramType).newInstance(param);//building the block }catch(Exception e){} if(block!=null){ block.setUnlocalizedName(unlocName).set...//finalizing the block GameRegistry.registerBlock(block,unlocName);//registering... OreDictionary.registerOre(oreName,block); } } } Then you only need a List or Map in another class to hold all the BlockHandler. Like, BlockHandlerRegistry.register(this);
  17. EntityRegistry.registerGlobalEntityID(entityClass, entityName, id); EntityList.entityEggs.put(Integer.valueOf(id), new EntityEggInfo(id, bkEggColor, fgEggColor)); EntityRegistry.registerGlobalEntityID(entityClass, entityName, id); EntityList.entityEggs.put(Integer.valueOf(id), new EntityEggInfo(id, bkEggColor, fgEggColor)); Twice ? Really ? ResourceLocation("domarne", "/textures/mobs/DwarfA.png"); Drop the / before textures/mobs... This is a really common issue, you could have searched a bit.
  18. I am interested by the network and sound part of the update. I don't think terrain gen will change much. They just added a new world type and some biomes. Nothing special.
  19. World#getBiomeGenForCoords(int,int) to choose your biome WorldProvider#setSpawnPoint(int,int,int) to...
  20. player.getHeldItem().getClass().getSuperclass().getName() == "Block" That will never be true. EntityPlayer#getHeldItem() only returns an ItemStack. I'd use: player.getHeldItem().getItem() instanceof ItemBlock
  21. Of course you have a log to post. Forge log. Anyway, did you package your mod exactly like in your dev environment ?
  22. import mymobs.mobBulbasaur; import mymobs.mobBulbasaur.RenderTheMob; import mymobs.mobCharmander; import mypackage.CommonProxy; import cpw.mods.fml.client.registry.RenderingRegistry; public class ClientProxy extends CommonProxy { public void registerRenderers() { // This is for rendering entities and so forth later on RenderingRegistry.registerEntityRenderingHandler(mobBulbasaur.class, new RenderTheMob(new ModelBulbasaur(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(mobCharmander.class, new RenderTheMob(new ModelCharmander(), 0.5F)); The imports are telling me you are using the same RenderTheMob class for both. private static final ResourceLocation charmander = new ResourceLocation("basic", "/textures/mobs/CharmanderTexture.png"); Need to drop the / before textures/mobs...
  23. You can get a block Icon with Block.blocksList[id].getIcon(int,int).
  24. Hum...I am afraid using events is a bit harder than TickHandler. Anyway, here is a fast how-to: MinecraftForge.EVENT_BUS.register(new EventHandler()); //Where EventHandler is a class which you make and contain methods such as: @ForgeSubscribe//Forge annotation, don't forget it public void onMobDeath(LivingDeathEvent event){//LivingDeathEvent is an Event class made by Forge //note: method name has no influence if(event.entityLiving instanceof EntityPlayer){//you can use the variables in event to make special case //do whatever you want } }
  25. Yes, considering the fact that commands can use the unlocalized block name instead of block id, in 1.7, it is expected that unlocalized name will take over the id for every aspect at some point. I'd say it is a bit optimistic to think this is going to happen in 1.7.

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.