-
Posts
5170 -
Joined
-
Last visited
-
Days Won
77
Everything posted by Choonster
-
Run the build task from IDEA's Gradle window or the command line. The compiled JAR will be in build/libs.
-
You didn't answer diesieben07's question. Did you build the JAR using IDEA's build system or did you build it using the build Gradle task? Only the latter is correct.
-
Item#setDamage sets the ItemStack's damage to the specified amount. You call it with 1, so it sets the ItemStack's damage to 1. The method you want is ItemStack#damageItem, which increments the ItemStack's damage by the specified amount. Calling with 1 will add 1 to the damage. Side note: Don't use Item#setDamage directly, use ItemStack#setItemDamage when you want to set the ItemStack's damage instead.
-
[1.10.2] Get ingredients from Crafting Recipe
Choonster replied to Herobone's topic in Modder Support
Then you'll need to handle each recipe class individually. For Vanilla's shaped/shapeless recipes, look for a field containing the collection of ItemStack ingredients. For Forge's ore recipes, look for a field containing the collection of Object ingredients. Each Object can be either an ItemStack or a List<ItemStack>. I strongly recommend updating to 1.12.1. -
[1.10.2] Get ingredients from Crafting Recipe
Choonster replied to Herobone's topic in Modder Support
Which version of Minecraft are you using? In 1.12+, use IRecipe#getIngredients to get a list of Ingredients in a recipe and Ingredient#getMatchingStacks to get a list of ItemStacks matched by an Ingredient. IRecipe#getIngredients returns an empty list for special recipes with harcoded ingredients (e.g. RecipeBookCloning, RecipeFireworks, etc.), it only returns a non-empty list for recipes that use a collection of Ingredient objects (e.g. ShapedRecipes, ShapelessRecipes, ShapedOreRecipe and ShapelessOreRecipe). -
Broken Model Textures 1.11.2 forge: 13.20.1.2454
Choonster replied to Reelzerz's topic in Modder Support
The model you specified in the blockstates file doesn't exist. -
[1.6.4] Get the Resource/Resource location of any item.
Choonster replied to lexwebb's topic in Modder Support
Items and blocks no longer have textures, they now have models. Use RenderItem#getItemModelWithOverrides to get the model for an item. -
[1.10] Prevent automation extract from specific slots
Choonster replied to dakamojo's topic in Modder Support
Create a regular ItemStackHandler to store the inventory and use this in your Container. Create an IItemHandlerModifiable wrapper class that stores another IItemHandlerModifiable and delegates all methods to it except IItemHandler#extractItem. Implement this to always return ItemStack.EMPTY, preventing extraction from the wrapped inventory. Create an instance of this that wraps the regular ItemStackHandler and then expose this via your TileEntity's override of ICapabilityProvider#getCapability. -
[1.7.10][1.11.2]First Person 3D items with animations
Choonster replied to Asean12's topic in Modder Support
Forge has a model animation system, but unfortunately there's not much documentation on it. It was introduced in this commit, which briefly explains the purpose of some of the classes. The grammar of the Animation State Machine files is documented here. Forge has an example here (assets), there are also some examples linked here. This can animate JSON and B3D models, but unfortunately it can't animate OBJ models. -
[Solved?] [1.12] Make Illusioners spawn in mansions
Choonster replied to IceMetalPunk's topic in Modder Support
The root of the repository should be the root directory of your mod, i.e. where build.gradle and the src directory are. See my mod and its .gitignore file for an example of the repository structure to use and the files to include. -
The model file you've told Minecraft to use doesn't exist.
-
You need to pass the entity's ID (Entity#getEntityId) as one of the int arguments of EntityPlayer#openGUI. In your GUI handler, use World#getEntityByID to get the entity from its ID.
-
Everything is in the source code. World generation isn't handled by the Block class, it's handled by dedicated world generation classes. If you look for usages of Blocks.DIAMOND_ORE, you'll see that it's used in BiomeDecorator#decorate to create a WorldGenMinable instance. This is later used in BiomeDecorator#generateOres to generate veins of Diamond Ore.
-
[1.12] Help with registering entity into game
Choonster replied to Big_Bad_E's topic in Modder Support
EntityRegistry.registerModEntity has nothing to do with rendering/textures. It belongs in common code, not client-only code. The registryName argument is a registry name, not a texture path. The entityName argument should include your mod ID. The mod argument is the instance of your @Mod class, but you're passing the RenderManager instance (which is still null in preInit) instead. This isn't a mod instance, so the game crashes with a NullPointerException when Forge tries to get the mod ID to write to the log. -
[1.12] Help with registering entity into game
Choonster replied to Big_Bad_E's topic in Modder Support
Do you actually know Java? You can't just type an arbitrary name like that, you need to pass the method a ResourceLocation and a String. The ResourceLocation must have your mod ID as the domain. If you don't specify a domain, it defaults to minecraft. Entity registration must happen on both physical sides, so it should be done in your @Mod class or a class called from it. Render registration must be done by calling RenderingRegistry.registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) in preInit. This must happen only on the physical client, so it should be done in your client proxy or a client-only class called from it. -
Create a class that extends the IRecipe class you're currently using and then override IRecipe#getRemainingItems to return the remaining item for each slot. Use ForgeHooks.defaultRecipeGetRemainingItems to get the default remaining items for every slot or ForgeHooks.getContainerItem to get the default remaining item for a single slot. Create a class that implements IRecipeFactory and parses your recipe from the provided JSON object. Specify this class in recipes/_factories.json. You can see the IRecipeFactory implementations for the Vanilla and Forge recipe classes in CraftingHelper.init. In your recipe file, set the type property to "<modid>:<recipe_name>", where <modid> is your mod ID and <recipe_name> is the name you specified in recipes/_factories.json.
-
[1.12] Help with registering entity into game
Choonster replied to Big_Bad_E's topic in Modder Support
Passing null as an argument that isn't explicitly documented or annotated as nullable is a bad idea. You need to pass actual values for the registryName and entityName arguments. The registryName argument of EntityRegistry.registerModEntity is the registry name of the entity, which must be a unique name with your mod ID as the domain of the ResourceLocation and the entity's name as the path. The registry name is used as your entity's ID when it's being read from/written to NBT. The entityName argument of EntityRegistry.registerModEntity is a separate name for the entity, which should also be unique (i.e. you should include your mod ID in it). This is sometimes called the "old" name and is mainly used for translation/display purposes. I recommend using the registry name for this name, but it's not required to do so. -
[1.12.1] Awkward to admit, I can't setup a block
Choonster replied to PlayPrey's topic in Modder Support
You need to use a class that extends ItemBlock for the Item form of a Block. Where are you registering your item models? There should be some errors in the FML log telling you why the models aren't working, please post this using Gist or Pastebin. -
Have you tried looking at how Ender Pearls do this?
-
[1.12]How to make recipes configurable?
Choonster replied to RealTheUnderTaker11's topic in Modder Support
If you must register recipes in code (which I recommend against doing), use the registry events. -
Use World#getCollisionBoxes(Entity, AxisAlignedBB) to get all Block and Entity collision bounding boxes that intersect with the specified AABB. Use World#collidesWithAnyBlock to check if the AABB intersects any Block collision bounding boxes.
-
Use RenderLivingEvent#getEntity to get the entity being rendered, check if it's the client player (Minecraft#player) and then cast it to AbstractClientPlayer before rendering the ears. Since you're only rendering this for a player, it's probably best to subscribe to RenderPlayerEvent.Post instead of RenderLivingEvent.Post. This is only fired for players rather than every living entity.
-
[1.11.2] Custom Furnace - Last Step, Saving Data Help [SOLVED]
Choonster replied to HalestormXV's topic in Modder Support
You need to save the BURNING property to the metadata in DualFurance#getMetaFromState and then load it from the metadata in DualFurance#getStateFromMeta. You shouldn't be manually changing the TileEntity like you do in DualFurance.setState, just set the state to currentState.withProperty(BURNING, isBurning). Since you've overridden TileEntity#shouldRefresh to return true only when the Block changes, the TileEntity will automatically be preserved when the burning state changes. Vanilla only does this because it uses separate Blocks for the two burning states instead of one Block with a boolean property. -
SoundHandler.playSound(ISound) not doing anything
Choonster replied to PlanetTeamSpeak's topic in Modder Support
You don't. That code uses registry events, which Forge fires when each registry is ready to receive registrations.