Everything posted by navybofus
-
Custom Rendered Block Tutorial?
Thanks. I'm learning so much more the deeper I delve. I keep making harder projects for myself so I can produce higher quality mods.
-
Custom Rendered Block Tutorial?
To explain a bit, I've currently got a block that does everything I want it to for my mod, but it's lackluster at best. So, I went into Techne and created a new model that fits in the normal bounds of a vanilla block. I've exported the .java file and put it in my mod workspace. I know that I need to add a tile entity and register the custom model, but all of the tutorials I've found on the subject are so out of date that nothing seems to work correctly. So, I'm looking for either some help or a link to an existing tutorial that is up to date enough that I can follow it step by step. (The tutorials I found were for modloader too) Any help is much appreciated! Thanks! EDIT: Currently using VSWE's lectures, but something is still wrong because I haven't been able to even get an untextured model into the world.
-
[1.7.2] java.lang.OutOfMemoryError when adding a bunch of recipes.
I guess what i was trying to say is that you could write a loop for all similar recipes that use different item types. If I understand the question correctly, couldn't you put all the like-materials into an array and just increment through it as you increment through the nested loop? Edit: After re-reading your post, I think this is what you're already attempting.
-
--ItemStack not updating in the GUI [Fixed, but with new problems]
once again, I didn't think about the server... isRemote saved me again. EDIT: Okay, so I'm new to this event_bus thing and the isRemote check worked in fixing the visual bug, but something is still wrong. My creative functionality is gone. Can anyone help me find the mistake? Any notes on my code will be helpful as I learn more and more every day. Oh, and sorry that I don't javadoc my methods or comment many code parts. package com.navybofus.sweettea; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class CauldronActivateHandler { public CauldronActivateHandler(){ } @SubscribeEvent(priority=EventPriority.HIGHEST) public void handleCauldronActivate(PlayerInteractEvent event) { EntityPlayer player = event.entityPlayer; World world = player.worldObj; int x = event.x; int y = event.y; int z = event.z; Block block = world.getBlock(x, y, z); ItemStack itemstack = new ItemStack(BaseSweetTea.itemEmptyCup); if(world.isRemote){ // Not sure if anything should go here } else { if(event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { if(player.getHeldItem() != null){ if(player.getHeldItem().getItem() == itemstack.getItem()){ if(block == Blocks.cauldron) { int metadata = world.getBlockMetadata(x, y, z); if(metadata > 0) { // If in creative, don't take a cup or water, but give a water cup. if (!player.capabilities.isCreativeMode) { ItemStack itemstack1 = new ItemStack(BaseSweetTea.itemColdWaterCup); if (!player.inventory.addItemStackToInventory(itemstack1)) { world.spawnEntityInWorld(new EntityItem(world, (double)x + 0.5D, (double)y + 1.5D, (double)z + 0.5D, itemstack1)); } else if (player instanceof EntityPlayerMP) {//Not sure what this does exactly. ((EntityPlayerMP)player).sendContainerToPlayer(player.inventoryContainer); } --player.getHeldItem().stackSize; player.inventory.addItemStackToInventory(itemstack1); world.setBlockMetadataWithNotify(x, y, z, MathHelper.clamp_int(metadata - 1, 0, 3), 2); if (player.getHeldItem().stackSize <= 0) { player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); } } else { if(!player.inventory.addItemStackToInventory(new ItemStack(BaseSweetTea.itemColdWaterCup))){ player.inventory.addItemStackToInventory(new ItemStack(BaseSweetTea.itemColdWaterCup)); } } } } } } } } } }
-
[1.7.2] java.lang.OutOfMemoryError when adding a bunch of recipes.
Well, like Draco's said. If you overload the same varItemStack then you're taking compatibility away from mods that may use the same names. You're example of sticks makes me immediately think of Tinkerer's Construct. The more items you add to a single name greatly diminishes your mod's compatibility with other mods. If you want recipes to have several variants, you should just type out the variant recipes. Instead of merging item types.
-
--ItemStack not updating in the GUI [Fixed, but with new problems]
I wanted to see where the problem lies before I post a bug report. I am using a PlayerInteractEvent handler to take an item from the player and immediately give them another item in exchange. This works fine except the itemstack that the player is holding only decreases (visually) once every other activation. However the result is correct. Even though the number of items doesn't decrease, the exchanged item increases accordingly. The reason I said "visually" above is because on the next exchange the number of items, even after switching to another active slot, does decrease. This make the problem a visual bug. Now, whether or not this bug is forge, minecraft or me. I'm not sure. Has anyone else experienced this sort of thing? I can post my code if needed, but I don't really think its necessary. If anyone needs more information please let me know. Thanks!
-
Added Chat Messages Posting Twice
Wow, a small little if statement was jacking me up that bad... I guess that's what I get for working in code all day. Thanks so much. No more alienated mod users wondering why every status is double posted.
-
Added Chat Messages Posting Twice
Still posting twice. I was sure that was going to work too. Any other ideas?
-
Added Chat Messages Posting Twice
I'm successfully sending the player status updates via their actions in my mod, but the chat fills up really fast when it posts twice. The code is only in the class once, but no matter where I put it (troubleshooting) it shows up twice. par3EntityPlayer.addChatMessage(new ChatComponentText("A chatty chat message for you!")); I'm wondering if the onItemRightClick() is running twice, or if the ChatComponentText is. Although, I've tried to use the minecraft way and it still double posts. Any insight? Is this a bug, "just the way it is" or more likely... is it my erroneous code?
-
[Solved]How to change the directory forge looks for the JDK?
Sweet. Happy modding!
-
[Solved]How to change the directory forge looks for the JDK?
Are you having troubles compiling? If so, you'll need to set your PATH variable to the most updated JDK. But, since you don't have admin permissions, this won't help you. If you're not having compiling issues, what is the issue more specifically?
-
[Solved] Where's the deobfuscated Minecraft files?
That's basically what mine looks like, good so far. Now, I just need to create an assets package in my src/ folder? BTW Thanks so much for the help. Your mod looks amazing just from looking at your code. I can't wait to try it out once my mod is up an running the way I want.
-
[Solved] Where's the deobfuscated Minecraft files?
I'll try it and let you know. my first test is going to be a version of en_US.lang in my resources folder that only contains the header info and my items/blocks.
-
[Solved] Where's the deobfuscated Minecraft files?
I saw that. I was wondering if I just add my blocks/items to it and if I put it in my rss folder so it moves during the build.
-
[Solved] Where's the deobfuscated Minecraft files?
Thanks! EDIT: Actually I found the forge src files, but all the minecraft files are Classes from what I can tell. I'll keep fishing around in the build folder. Now maybe I can find out how to implement the new block/item naming system via the asset lang system since .addName was deprecated.
-
[Solved] Where's the deobfuscated Minecraft files?
EDIT: I /still/ can't seem to find the minecraft src files. I found the forge java, but the minecraft folder only has a forge related java file. I am wondering if I did something wrong in the command line process, although my projects compile just fine. EDIT 2: I finally found that you have to run "gradlew setupDecompWorkspace --refresh-dependencies" and then run gradlew setupDevWorkspace eclipse" this adds the source java files to your project. There may be a condensed way to do this but this worked for me.
-
Stopping the use of a item/tool
I appreciate the help. Thanks. Although this is my method of studying until I get to the programming portion of my studies. Also, I've made several mods in the past. I get hung up every now and then, but I always find my way.
-
Stopping the use of a item/tool
I'm trying to stop players from using certain items until they meet some prerequisites, but I can't seem to get a good comparison working that will allow me to do something with the item in the spot. So far I've just created some conditional statements to test my ideas. Below you can see that I'm using the isSwingInProgress event in a player update event. I'm using this because I don't want the item to get kicked for having it, just using it. Right now I am having the chat spit out the (player name) "is using a" currentItem. Well this comes out in chat as "Player### is using a 1xpickaxeStone@1 (2, 3 ...). So when I try to compare the .getCurrentItem to an ItemStack variable that I created I'm not getting the right comparison. Any help is appreciated! Also, if more explanation is needed please let me know. @ForgeSubscribe public void onPlayerUpdate(LivingUpdateEvent event){ if(event.entityLiving instanceof EntityPlayer){ EntityPlayer player = (EntityPlayer) event.entityLiving; if(player.isSwingInProgress){ player.addChatMessage(player.getEntityName() + " is using a " + player.inventory.getCurrentItem()); ItemStack heldItem = new ItemStack(Item.pickaxeStone); if(player.inventory..getCurrentItem() == heldItem){ player.addChatMessage("Using a Stone Pickaxe."); //If I get this message to display then I know I can get the items kicked out of the slot, just need to get this if statement working. } } } }
-
[Solved] A hook to access onLivingUpdate for EntityPlayer
Fixed it! Thanks! I mistyped the event register in my base mod.
-
[Solved] A hook to access onLivingUpdate for EntityPlayer
I just tried to add this to see if it was working and the chat never said anything. I'm guessing I'm trying to take this too far out of context from your example. @ForgeSubscribe public void onPlayerUpdate(LivingUpdateEvent event){ if(event.entityLiving instanceof EntityPlayer){ EntityPlayer player = (EntityPlayer) event.entityLiving; player.addChatMessage("Updated"); } }
-
[Solved] A hook to access onLivingUpdate for EntityPlayer
So how would I call LivingUpdateEvent? I keep getting errors.
-
[Solved] A hook to access onLivingUpdate for EntityPlayer
Which ever is the easiest way. Can you give me a small example? The tick handler seems a bit too complicated for me. I haven't been able to take my java programming class yet. I'm learning and getting to play me favorite game
-
[Solved] A hook to access onLivingUpdate for EntityPlayer
Okay so I implemented ITickHandler from my base mod file and added the methods. Then I put a simple System.out.println("Tick Start") in the tickStart()method and "Tick End" in the tickEnd() method and nothing is showing up in the console. I am sure that I implemented ITickHandler in the wrong place. @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { System.out.println("Tick Start"); } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { System.out.println("Tick End"); } @Override public EnumSet<TickType> ticks() { // TODO Auto-generated method stub return null; } @Override public String getLabel() { // TODO Auto-generated method stub return null; }
-
[Solved] A hook to access onLivingUpdate for EntityPlayer
Okay so I'm having a brain fart. How do I get the player data into the tick function? @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { activeInventoryItemCheck(); // This is throwing an error because I have the custom function args as EntityPlayer }
-
[Solved] A hook to access onLivingUpdate for EntityPlayer
Currently I'm trying to find a hook or function that allows me to add a few conditional statements in the onLivingUpdate ticks. I created the function, but I am sure that I have no idea where to put it to get it read by the client. Right now its in my base mod. There is probably a better way to do this than the way I am, but I'm not sure of how to do it. Any information would be awesome! Thanks!
IPS spam blocked by CleanTalk.