Jump to content

EverythingGames

Forge Modder
  • Posts

    388
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    United States
  • Personal Text
    All And Everything Games

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

EverythingGames's Achievements

Diamond Finder

Diamond Finder (5/8)

20

Reputation

  1. Are you storing NBT in an itemstack? Itemstack NBT is updated by vanilla Minecraft (synced) with the server and the client automatically. You could try using IEEP (IExtendedEntityProperties) to save teleporting coords to the player when right clicking with your item and then syncing your data on the EntityJoinWorldEvent. Look it up on google if you choose to do it that way. As for the itemstack NBT I do not see why that wouldn't sync.
  2. Return "this" in IPerspectiveAwareModel. Why not just "break" instead of returning the Pair for every transform type? Also, RenderItem.applyVanillaTransform will apply GL from the model you specify (watch for what you return there).
  3. This is a horrible idea. Think again. Please elaborate. public class TestItem extends Item { //One use (decrements your stack upon use i.e destroying the item depending if your stack size is 1) @Override public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) { playerIn.inventory.consumeInventoryItem(this); //You can use itemStackIn.stackSize--; here - this demonstrates using with the player instance return itemStackIn; } } EDIT: I see what you mean after some more testing - this will not work due to the fact that consumeInventoryItem decrements the itemstack's stacksize at the nearest stack in the player's inventory (meaning sometimes not the item you are holding i.e another stack of the same item located in your inventory). Sorry about that - misinterpreted what that method really does. @OP I would stick with the crafting table damage to get 1 use.
  4. Just how? Like mentioned above, you would add / edit the armor layers / armor rendering. Try looking into the RenderPlayerEvent - all rendering for the player is done there, including armor rendering (pretty sure - look into ModelPlayer.class and RenderPlayer.class to find more info on the biped layers for the player). Also, look at LayerBipedArmor.class and LayerArmorBase.class. Maybe you could create a new player model with the player's skin, 3 / 4 pixel arms, and armor (except the armor is made red) and cancel the vanilla model in the RenderPlayerEvent. I've done similar, it can be done.
  5. If you want your item to be destroyed upon one use, just listen for when you use your item (however you handle that), and if you did use it, you can destroy that item manually in code, giving you one use. entityPlayer.inventory.consumeInventoryItem(THEITEMYOUWANTTODESTROY);
  6. You probably haven't dealt with reflection. This is exactly what you need here, as pointed out above, so read up on some tutorials. That should get rid of that nasty Access Transformer.
  7. I would increment a ticker right after subscribing to the LivingDeathEvent. Check the instance of the entity in the LivingDeathEvent against the EntityPlayer, then increment your counter in ticks (use another event, such as the ClientTickEvent - remember to check the player instance and event.phase == Phase.Start or Phase.END, otherwise your code runs twice per tick). This way, you have complete control of when your counter increments and when it stops.
  8. [23:56:05] [Client thread/INFO] [FML]: FML has found a non-mod file [1.8]DrVaders Robot Pet Mod-1.0.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible. Did you put anything in your Mods folder, found in your mod dev folder? I've seen this happen when you throw a mod (zip file / jar) into the mods folder (a non-deobfuscated file). Really, what have you in there?
  9. This works when you return 0.0F - if you are in survival. My item does not need to be able to interact with blocks (or blocks with inventory / other capabilities on left / right click). diesieben07 gave the perfect solution, MouseEvents. This stops vanilla packets from being sent and rendering / particles from being spawned on the client. Perfect solution, considering the personal MouseListener I wrote for Forge is uninterrupted by canceling vanilla Mouse actions. Thanks for the help.
  10. This couldn't make any more sense. Your saying have a Main class with the "@Mod" annotation, including its several parameters, yet Forge / FML is not recognizing your Mod as a Mod. What is happening in the console? Did you even look in the "Mods" button at the Minecraft Main Menu? That is very basic - check the mods button, post the log, and show us your code (Main class).
  11. I need to be able to have an item that cannot break any blocks - that can be achieved with events or overriding the Item class' methods. However, the server is still telling the client to render the break animation (the block's break stages), and the client is also still spawning block-break particles. Is there a way to cancel everything before the block is broken (kind of like when the block is first clicked) so that it looks seamless as though the player had not clicked at all? I know ItemSword does this, although I cannot find any place where ItemSword is referenced in the Call Hierarchy (besides where instances of it are created for registration). If someone could please elaborate on how I would get this done, I would appreciate it Thanks.
  12. I actually ended up writing listeners that you implement. Pretty much like an event (considering the Listener you implement event handles for you), except unlike an event, you extend the specific Listener class and it gives you a few methods (depending on the listener type) that you must override. For example, I have a ListenerClientMouse class extending ListenerClient (which ultimately extends Listener, except ListenerClient is client side only, obviously). The ListenerClientMouse listens for when the user is holding down the mouse, when the mouse is not being held down (not doing anything), when the mouse was clicked (semi-automatic mouse click), and finally when the mouse was released (semi-automatic mouse released). Using the 'MouseListener' that I wrote, I can now easily send a packet to the server once per click (regardless if user is holding, the method is called only once meaning only one packet is sent), and once per release (again, only called one, only one packet sent). A boolean is set upon click / release in IEEP and checked on the PlayerTickEvent. Everything worked like a charm, though it seemed like too much effort for a bit of optimization. The code is similar to the code shown above.
  13. Wrong. EntityJoinWorldEvent is triggered by all entities joining the world, hence the name. Subscribe to the EntityJoinWorldEvent, check the instance of the AbstractClientPlayer against the event.entity, and then cast and do whatever you need. Remember, changing the skin with reflection during the EntityJoinWorldEvent will result in a NullPointerException (if you are changing NetworkPlayerInfo.locationSkin), so you will need to create a delayed runnable and schedule it to run on the main thread. Be sure to use ObfuscationReflectionHelper with SRG names.
  14. Use the EntityJoinWorldEvent and check the instance of the entity there compared to the AbstractClientPlayer. Then cast the event.entity to AbstractClientPlayer and do whatever you need.
  15. Techne, a tool used for modeling items, blocks, and entities in 1.7.10 (only entities in 1., uses .tcn files. The part that we use is exported to Java code in a .txt file, and should be used as a reference to get all the boxes / rotations / translations / scale right upon construction of your model class (initializing your ModelRenderer instances). Take a look at any of the mobs in Minecraft's source code, those are perfect examples of the similar code that Techne exports. You may also want to reference the render classes for the models / entities.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.