Jump to content

DavidM

Members
  • Posts

    1830
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by DavidM

  1. Have you registered the event handler (MinecraftForge.EVENT_BUS#register)? Alternative methods include passing the mod id in the @EventBusSubscriber). Watch out for static or not though.
  2. If I understood correctly, no. Different players might be looking at different directions, but the entity can only have one position. Even if the mod is for single player only, the position of an entity shouldn't be abused for cosmetic (rendering) purposes; the position of an entity does a lot more than "keeping the entity visible", and messing with it can break other things.
  3. Which download did you click? The installer?
  4. Put it where you need it. Hint: Entity#isSneaking returns a boolean; true when the player is sneaking and false when the player is not.
  5. AFAIK this s due to the chunk(s) the entity is in is being culled; there is not much you can do about it. One way too circumvent this problem would be to break your large entity into multiple smaller entity (like how "dragon" entities are handled in some mods).
  6. Can you send a screenshot of the file that you downloaded as "version 2814"?
  7. You can either 1) Do it in the constructor of your item or 2) Call the method son your item when you first instantiate it in Register<Item> subscriber. There is no need to put the method in your item class; all item models should be registered that way, and registering the model does not need any private data. Therefore, just call registerItemRenderer for each of your item in the subscriber for ModelRegistryEvent. In addition, the tutorial you are following has a lot of bad practices. You might want to take a look at Cadiboo's example mod to learn about good practices for modding: https://github.com/Cadiboo/Example-Mod
  8. This line of code registers the model for the item. The “item” variable is an instance of an Item. In order to register the models for all your items, run the line of code above for each one of your item; for each item, replace the “item” variable with that item. This basically means “calling the method” (or running the method, if that’s easier to understand).
  9. What exactly are you trying to achieve? Empty left click swing or left click and hold? I can’t read. Yes. You should check if the player is holding the item (however a hacked client can easily send a false packet even if the item is not held in hand; you should also perform a check on the server side).
  10. I've been playing some modpacks recently, and realized that some mods tend to write a lot of messages to the log (most of which informing the initialization state the mod is at). Examples being: [19:34:44] [Client thread/INFO] [Actually Additions]: Initializing Crusher Recipes... [19:34:44] [Client thread/INFO] [Actually Additions]: Registered a total of 105 booklet chapters, where 305 out of 423 booklet pages contain information about items or fluids! [19:34:44] [Client thread/INFO] [Actually Additions]: PostInitializing ClientProxy... [19:34:44] [Actually Additions Special Fetcher/INFO] [Actually Additions]: Fetching Special People Stuff... [19:34:44] [Client thread/INFO] [Actually Additions]: PostInitialization Finished. [19:34:44] [Client thread/INFO] [AE2:C]: Post Initialization ( started ) [19:34:44] [Client thread/INFO] [AE2:C]: Industrial Craft 2 - Integration Disabled [19:34:44] [Client thread/INFO] [AE2:C]: Railcraft - Integration Disabled [19:34:44] [Client thread/INFO] [AE2:C]: Mine Factory Reloaded - Integration Disabled [19:34:44] [Client thread/INFO] [AE2:C]: Waila - Integration Disabled [19:34:44] [Client thread/INFO] [AE2:C]: Inventory Tweaks - Integration Enable [19:34:44] [Client thread/INFO] [AE2:C]: Just Enough Items - Integration Enable [19:34:44] [Client thread/INFO] [AE2:C]: Mekanism - Integration Enable [19:34:44] [Client thread/INFO] [AE2:C]: OpenComputers - Integration Disabled [19:34:44] [Client thread/INFO] [AE2:C]: TheOneProbe - Integration Enable [19:34:44] [Client thread/INFO] [AE2:C]: Tesla - Integration Disabled [19:34:44] [Client thread/INFO] [AE2:C]: CraftTweaker - Integration Enable [19:34:44] [Actually Additions Special Fetcher/INFO] [Actually Additions]: Fetching Special People Stuff done! [19:34:44] [Client thread/INFO] [AE2:C]: Post Initialization ( ended after 266ms ) [19:34:49] [Client thread/INFO] [THAUMCRAFT]: Loaded 22 research entries from thaumcraft:research/alchemy [19:34:49] [Client thread/INFO] [THAUMCRAFT]: Loaded 5 research entries from thaumcraft:research/eldritch [19:34:49] [Client thread/INFO] [THAUMCRAFT]: Loaded 20 research entries from thaumcraft:research/basics [19:34:49] [Client thread/INFO] [THAUMCRAFT]: Loaded 23 research entries from thaumcraft:research/auromancy [19:34:49] [Client thread/INFO] [THAUMCRAFT]: Loaded 12 research entries from thaumcraft:research/scans [19:34:49] [Client thread/INFO] [THAUMCRAFT]: Loaded 20 research entries from thaumcraft:research/artifice [19:34:49] [Client thread/INFO] [THAUMCRAFT]: Loaded 17 research entries from thaumcraft:research/infusion [19:34:49] [Client thread/INFO] [THAUMCRAFT]: Loaded 29 research entries from thaumcraft:research/golemancy These messages are rather unimportant to me as a player, and they tend to spam the whole log, making Warning/Error level messages hard to locate. Is there a way to config the game to not write Info level messages to the log?
  11. There is an error in the config file of CodeChicken Lib. Check the config file (delete it if necessary).
  12. People on this forum will eventually come by and answer. There is no need for PM. Try updating Blood Magic and Forge. If that does not work, report to the author of Blood Magic. Oops. Didn’t realize this was already answered.
  13. Remember how in the ModelRegistry event subscriber you registered the models of items like: ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); Well, just invoke the method with each item in your mod instead of checking for IHasModel first. EDIT: Your current code should be fine. Just remove all references of IHasModel. You should not be using anything like ItemBase of BlockBase (abusing inheritance). Instantiate, add to your modItems, and register your items in the subscriber for RegistryEvent.Register<Item>; there is no need for an ItemBase.
  14. You are using a variable called CAVE, but it does not exist. You have to create it (unless it is a property of a superclass). Either way, this should be basic java.
  15. 1. Your problem is caused by not (fully) knowing how overriding works, or else this error won’t occur. The IDE is telling you "hey this method does not exist in the parent class", therefore you should make sure your method matches the method in the superclass. 2. Always look at the source code first, as the source code is definitely updated and functional, whereas answers on the internet can be old and not fitted to use in the current version.
  16. You won't get far without the understanding of basic java. As a general suggestion, learn java before making a mod.
  17. 1. "mymod" not a good mod id. 2. We cannot see what is wrong with your code unless you post your code (especially mymod.Main.init(Main.java:461)).
  18. "Overriding" is basic java knowledge; you are expected to know it according to the forum rules. Since you did not specify the version of Minecraft you are modding for, I'm going to assume it's 1.12.2. Item#onItemUse is defined as: public EnumActionResult onItemUse (EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) Well as you can see: "EnumActionResult" is not spelt "ActionResult<ItemStack>" "EntityPlayer" is not spelt "ItemStack" "BlockPos" is not spelt "int" Therefore, you are creating a new method instead of overriding an existing one. As a general suggestion, you should always use your IDE to do the overriding for you instead of manually typing it out.
  19. No one really knows what kind of code MCreator will generate, therefore it is hard to help you. However, a good IDE also: Has ways to view the source code Has good warning/error displaying Has easy navigations and links through files Has good javadoc support etc I am doubtful that MCreator has those features. Using a bad IDE will no doubt slow down your development. Cmd + left click in my case. Viewing the source code can be very helpful when developing with a new API.
  20. ... He literally just told you what is problem is and how to fix it. Like what Keitaro said: , check your parameters. An overriding method must have the same parameters as the method it is overriding.
  21. This is for checking the block's oredict and destroying it if it is wood. This will allow your giant to work with every type of tree. See this if loop thingy? if (block != Blocks.COMMAND_BLOCK && block != Blocks.REPEATING_COMMAND_BLOCK && block != Blocks.CHAIN_COMMAND_BLOCK && block != Blocks.IRON_BARS && block != Blocks.END_GATEWAY) { flag1 = this.world.setBlockToAir(blockpos) || flag1; } else { flag = true; } Locate it in your code and change the condition to match your need. Personally, I would discourage copying from vanilla in this case, as the code you copied can be rewritten to better fit your needs.
  22. MCreator is known for creating broken mods. The "2 lines of code" might cause major issues later on (like crash in multiplayer, etc).
  23. 1. Obj is unlikely to be the cause of this; it is only a model file, and has nothing to do with lighting. 2. Obj has nothing to do with forge except for being a loadable model. Optifine is responsible for messing with rendering and lighting. Try reporting to Optifine.
×
×
  • Create New...

Important Information

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