Everything posted by GotoLink
-
i can't make shaped recipies
I mean that your GameRegistry.addRecipe line is at a wrong place. Put it in: public void load(FMLInitializationEvent event){
-
i can't make shaped recipies
Write your code in a method please. :'(
-
i can't make shaped recipies
Where do you put code in Java ?
-
[SOLVED][1.6.4] Mob Texture Not Loading
Texture should be in mcp/src/minecraft/assets/mochickens/textures/mobs/bluechicken.png
-
How to make an item change on right click
You can use ItemStack nbt and the onItemRightClick method.
-
[1.6.4] Dropping Items from blocks
You can use idDroped, damageDroped, quantityDroped in Block, if it is at block break you want it to happen.
-
Give poison effect when item is in inventory
@Draco18s There is only one boolean in Item#onUpdate(...) and it is true only if item is the current held one.
-
Open GUI on login
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.
-
Open GUI on login
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.
-
[Solved]Blocks outside of @mod class
@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.
-
[Solved]Blocks outside of @mod class
I'd say because people tend to follow tutorials and prefer to copy/paste lines like Ugly as hell. :'(
-
Open GUI on login
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 ?
-
[SOLVED] Current Item Change & Chat Send Event
2/ Register your command to ClientCommandHandler.
-
={Mob Isnt Loading Correctly}=
Name the Render class differently and see what happens.
-
entity only renders on the client it was created on
The entity should be spawned on server side only. Then all clients should know what to render for it with RenderingRegistry.registerEntityRenderingHandler(...)
-
[Solved]Blocks outside of @mod class
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);
-
={Mob Isnt Loading Correctly}=
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.
-
Anyone else dreading 1.7 update?
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.
-
Help with spawn locations and structures
World#getBiomeGenForCoords(int,int) to choose your biome WorldProvider#setSpawnPoint(int,int,int) to...
-
Changing texture on rightclick
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
-
[SOLVED] Issues releasing my mod
Of course you have a log to post. Forge log. Anyway, did you package your mod exactly like in your dev environment ?
-
How do I add more than 1 mob in my mod?
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...
-
Help with Custom IItemRenderer
You can get a block Icon with Block.blocksList[id].getIcon(int,int).
-
[Solved] A hook to access onLivingUpdate for EntityPlayer
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 } }
-
How reading the configFile works, makiing a config organiser for modpacks
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.
IPS spam blocked by CleanTalk.