Jump to content

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Animefan8888

  1. What you are saying is you do not want it to be right click and you do not have to deal with planting? Have you tried registering your event in preInit and then canceling it (most events are registered during init normally but I believe they can be registered in any of those events) I am not sure how events get fired to well.
  2. Try checking if the Entity (Living?) is an instanceof FakePlayer or if that doesn't work try to apply the effects within a Event instead of the onBlockAcivatedMethod(...) that may work.
  3. Oh! I meant to have ItemPrimitiveSpear extend ItemPrimitiveSpearTool. Do I not even need the ItemPrimitiveSpearTool class? I expect ToolMaterial to be able to set the durability, enchantability etc using the "primitive" tool material that I have, in the SpearItems class. You do not unless it has a special effect like throwing.
  4. Hmm maybe you missed the thingymabober in the whoseitwhatsit that caused the dohicky to become flabbergasted. How are we supposed to know if you don't show what you have? Like I said, I am happy to post my code but there are lots of files and I wondered if there might be a common or obvious solution without the hassle of reading through everything. At this point I'm going to have to post 5+ classes worth of code because I have no ideas about what is causing the problem. My custom furnace is one of several types subclassed from an abstract class so that's where a lot of the action happens. The abstract class: The subclass: The same for the blocks, abstract class: Subclass: The Containers if you need to see those - abstract class: Subclass: I also have the TileEntities registered in init in my common proxy, the blocks registered in preinit, and a GUI handler to set up the containers. I can post all of that if you really want but I'll stop here for now. You write your ItemStacks to the tag items and then try to read them from stacks. That was not obvious, also I see you override getUpdateTag(...) but not its partner.
  5. Hmm maybe you missed the thingymabober in the whoseitwhatsit that caused the dohicky to become flabbergasted. How are we supposed to know if you don't show what you have? *Edit The more code there is the more possibilities it might be...
  6. package bloopers.spearmod.items; import net.minecraft.item.Item; public class ItemPrimitiveSpear extends Item // I wonder why it doesn't have any modifiers // { public ItemPrimitiveSpear(ToolMaterial material) { this.setMaxStackSize(1); } } Do not use Minecraft.getMinecraft.getRenderItem().getItemModelMesher() just use ModelLoader.setCustomModelResourceLocation(...)
  7. 1.7.10 is no longer supported once a moderator sees this thread (probably diesieben07) it will be locked and you will be asked to update.
  8. Implementation is similar to extending class, you just are not limited by how many you can implement and instead of saying extends it is implements and you can only implement and interface. Tinkers Construct I believe is Open Source and should have some sort of capability. Also interfaces can extend interfaces. Read the stuff in parentheses as that is where diesieben denotes more information and names of interfaces and classes.
  9. createBlockState is called in the constructor of Block therefore it is null.
  10. That renderer class is a TESR (TESR stands for TileEntitySpecialRenderer) if you look into that class you will see it extends TileEntitySpecialRenderer. This is registered via ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer()); *Note Pseudo-code not sure what would happen if you tried to do this...I am actually kind of curious.
  11. If it doesn't use a TESR and it is not an inventory based block you are using no need to have a TE. If it uses the model system look into its JSONs that will be your source unless minecraft has a workaround or they use an entity to draw the book.
  12. Sadly im not sure if this can be done with IBakedModels look into that, but before that look into how vanilla does that. I assume that it uses a TESR, if it can not be done using a IBakedModel or even a JSON model use a TESR.
  13. The motionX motionY motionZ yaw and pitch setMotionAndHeading or similar is called right before it was created look into that for information in general.
  14. Thanks for all the info! Okay, so I've created my event handler and I think the logic is fine. How should I register my customized entity? I tried EntityRegistry.registerGlobalEntityID(UnderwaterEntityArrow.class, "Arrow", 262); But this causes some unclear error (stacktrace doesn't yield helpful information, but I'm going to assume ID clash, I tried to use the ID of an arrow... what param should I use instead? some arbitrary large number?), any ideas? I can't seem to find examples of replacing entities, and so I'm not sure what ID I should use (or even if I'm using the right registry class). Edit: I got it to register like this (I think... at least it didn't error): EntityRegistry.registerModEntity(UnderwaterEntityArrow.class, "Arrow", 262, this, 100, 100, true); Here's my code for the event: @SubscribeEvent public void entityJoinWorldEvent(EntityJoinWorldEvent event) { if(event.entity instanceof EntityArrow) { UnderwaterEntityArrow replacement = new UnderwaterEntityArrow(event.world); Entity shooter = ((EntityArrow) event.entity).shootingEntity; replacement.setLocationAndAngles(shooter.posX, shooter.posY + (double)shooter.getEyeHeight(), shooter.posZ, shooter.rotationYaw, shooter.rotationPitch); event.world.spawnEntityInWorld(replacement); event.entity.setDead(); } } Unfortunately I get an NPE at line 43. Shooter is the only possible null thing (as replacement is instantiated just above it), what should I do? My guess would be that custom arrow isn't having its data set... Not really sure what to do. Also, is shootingEntity of EntityArrow referring to the Bow or the source (Player, Skeleton, dispenser, etc)? Im not sure what constructor you should be using look at ItemBow for which constructor it uses you will also need to set it's Motion and heading before you spawn it. *Edit Isnt shootingEntity a private field.
  15. The entity system in minecraft is a little complex both the server and the client have a list of entities the server handles/syncs entity data. You will register and create a new Entity that extends lets say EntityArrow. In this new Entity class override onUpdate for physics calculations. If all you are changing is the speed at which it comes out just multiply the motion x/z in EntityJoinedWorldEvent. For more clarification search EntityJoinedWorldEvent and EntityConstructingEvent to find out where they are called from.
  16. If i am i am understanding this correctly what you could do in bukkit if you can send update packets send update packets for the projectiles. If this is not an option you can subscribe to EntityJoinedWorldEvent or EntityConstructingEvent probably the prior and check if it is an instanceof EntityProjectile and then edit the motion there. If that doesn not fix it you will need to create a new Entity extending the current ones aka EntityArrow/EntitySnowball. And replace the entity in one of the events i mentioned earlier. *Edit if extending override setMotionAndHeading (I think that is what it is called if not it is similar).
  17. Thanks no access to dev right now.
  18. IngameGuiEvent i believe it is called you need to subscribe and register it.
  19. 1. You need to loop through the players inventory and compare that to recipes, since recipes normally only have one in each slot just compare them in numbers and items (stacksize and the item). 2. You will need a way to identify what is a stair block, not all mods extend BlockStair. Maybe the best way to do that would be to compare collision boxes. And also do the instance of check. 3. The list should be handled on the gui then synced with the container using packets(to notify the container of the new slots). You should not use vanilla slots for this instead create a custom slot you will most likely have to disable the slots clicking based on z level(this way you dont click on multiple visably, instead you click on the one above the rest) i would just sort the list or map of the slots based on the zlevel. 4. Also sort the recipe list based on modid obviously put minecraft first.
  20. The problem with changing the strength of the explosion below 2 is not only particle effect though. It also changed the radius of the explosion. Since display size, block damage radius, and entity damage is all based on one variable, you need to modify that with your own custom explosion.
  21. 1.7.10 is no longer supported though read the crash yourself if you understand Java you should have no problems.
  22. You should not be editing forge/minecraft directly if why would you need to build it, no one will be able to use your mod as they would beed the modified version anyway. If you want a feature added to forge then submit a pull request on their github 0age with the code.
  23. The powers of reflection! Or you could just create a new one, just throwing that out there.
  24. Take a look at my block video tutorial in the youtube link in my signature.
×
×
  • Create New...

Important Information

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