Jump to content

Choonster

Moderators
  • Posts

    5117
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by Choonster

  1. You'll need to create your own condition that returns true or false based on this option and then create separate recipe files for easy and hard mode that use this condition. Create a class that implements IConditionFactory and then specify this class in recipes/_factories.json. You can implement BooleanSupplier (the type returned by IConditionFactory#parse) using a lambda that returns the value of your config option. In a recipe file, set the conditions property of the top-level object to an array containing an object for each condition. In each condition object, set the type property to the name of the condition type and include any other properties required by the condition type. Forge will test the conditions at recipe load time and only register the recipe if all of them are met. You can use the forge:not condition to invert the result of a condition. If the hard and easy mode recipes are mostly the same except for one or two ingredients, you may want to use a conditional ingredient like this. This will allow the individual ingredients to change based on the config option instead of having one of two recipes enabled based on the config option. Resource packs can't overwrite server-side files like recipes or loot tables, but Mojang plans to add data packs in 1.13 to allow that.
  2. This probably isn't related to sides, though you should fix that as well. CommandHandler#registerCommand is a vanilla method, which means it has a different name outside of the development environment. You need to use the build Gradle task to build your mod and reobfuscate it from MCP (deobfuscated) to SRG (obfuscated) names.
  3. Phone: LG G5 OS: Android 7.0.0 Browser: Chrome 60.0 Example thread: http://www.minecraftforge.net/forum/topic/60386-112-trouble-with-recipes/ When browsing the forums on my phone, I noticed that the Google ad directly after the first post often overflows and obscures the top of the second post. This can be seen in the screenshot embedded below:
  4. If you look at the method signatures in IForgeRegistry, you'll see that IForgeRegistry#getValues returns a List<V> (i.e. a collection of all values in the registry) whereas IForgeRegistry#getEntries returns a Set<Map.Entry<ResourceLocation, V>> (i.e. a collection of all name-value pairs in the registry). There are very few areas where you need to use numeric IDs, they should be avoided wherever possible as they're automatically assigned and different for each save. You generally want to use the objects directly or use registry names if that's not possible. If you tell us what you're trying to do, we can tell you how to do it.
  5. I managed to get this working with a single Item per bucket type, you can see my code here. This involves overriding several UniversalBucket methods that assume that the empty and full buckets are different Items and using an IFluidHandlerItem implementation that isn't limited to the Forge/Vanilla bucket Items. The model registration was already handled automatically by my existing code, so you won't see it in the linked commit. I essentially do the same thing that Forge does in ModelLoader.setBucketModelDefinition.
  6. You can't change the textures of Forge's UniversalBucket instance (those are specified in assets/forge/blockstates/dynbucket.json), but you can create and register your own instance and specify your own textures. The universal bucket uses ModelDynBucket for its model, this is a dynamically-generated model that retextures itself based on the fluid contained in the ItemStack. Forge uses ModelLoader.setBucketModelDefinition to set the universal bucket's model, you can do the same thing as this method but specify your own blockstates file instead of using Forge's one.
  7. Create a pack.mcmeta file in src/main/resources and set pack -> pack_format to 3. Alternatively, download a recent MDK and copy its pack.mcmeta file into src/main/resources. Mojang distribute the sounds and alternative language files through a separate resource repository system, these are stored with hashed names in .minecraft/assets (outside of the development environment) or ~/.gradle/caches/minecraft/assets (inside of the development environment). I'm not entirely sure why this is, but I suspect it's to prevent the Minecraft JAR from being too large.
  8. Static textures need to be square (i.e. equal width and height). Animated textures need to have a height equal to N times their width (where N is the number of frames). Animated textures require an mcmeta file with the same name as the texture (e.g. liquidessence_still.png.mcmeta) that specifies the animation data. See the wiki for the full format or the vanilla liquid mcmeta files for examples.
  9. thin_block doesn't specify any elements (it only specifies some display transformations) and neither does your model, so nothing is rendered. If you look at the models that extend thin_block (e.g. carpet, daylight_detector), you'll see that they specify an element themselves.
  10. I answered this in the OP's Minecraft Forum thread.
  11. There should be an error in the log telling you why the recipe failed to load. I suspect it's because you didn't include the minecraft domain in the recipe type, so Forge used your mod ID as the domain and couldn't find any recipe factory with that name.
  12. My previous post was incorrect, fluid textures actually go in assets/<modid>/textures/<path>. I forgot that I automatically add a prefix to my fluid textures so that the textures can go in the assets/<modid>/textures/blocks directory. new ResourceLocation(Magic.MOD_ID, "liquidessence.flow") is expanded to assets/<modid>/textures/liquidessence.flow.png. new ResourceLocation(Magic.MOD_ID, "fluids/liquidessence_still") is expanded to assets/<modid>/textures/fluids/liquidessence_still.png.
  13. The player's inventory is stored in the EntityPlayer#inventory field, which is an instance of InventoryPlayer (an implementation of vanilla's IInventory interface). Forge patches EntityPlayer to add the EntityPlayer#getCapability method, which exposes various IItemHandler wrappers of the InventoryPlayer (main, equipment or joined depending on the EnumFacing). These don't store the inventory contents themselves, they simply provide access to the underlying InventoryPlayer through the IItemHandler interface. You can use a SlotItemHandler with one of these IItemHandler wrappers instead of a regular Slot with the InventoryPlayer to achieve the same result (access a player inventory slot in a GUI).
  14. It's important to distinguish between physical sides and logical sides. Proxies handle physical sides, but they don't handle logical sides. Client-only classes like GUIs, models and renderers can only be accessed on the physical client, but sending messages to players should happen on the logical server (not just the physical server). Forge's documentation explains this in more detail here. The common type of your proxies (the type of the @SidedProxy field) should be an interface rather than a class. There's no need for a common proxy class because proxies are only for sided code; common code belongs in your @Mod class and other common classes.
  15. EntityPlayer already provides CapabilityItemHandler.ITEM_HANDLER_CAPABILITY itself, so it never delegates this to the attached ICapabilityProviders. You need to create your own interface that extends IItemHandler, register a capability for it and provide that from AbilityProvider instead. AbilityProvider.handler is a static field, which means it's shared between all instances of AbilityProvider (and thus all instances of EntityPlayer you attach it to). It needs to be an instance field instead. Your IDE should warn you about accessing a static field through this.
  16. Fluid textures go in src/main/resources/assets/<modid>/textures/<path>, where <modid> is your mod ID and <path> is the path component of the texture ResourceLocation. The UniversalBucket instance is stored in the ForgeModContainer#universalBucket field. Use ForgeModContainer.getInstance to get the ForgeModContainer instance. In 1.11.2, use UniversalBucket.getFilledBucket to get an ItemStack of the UniversalBucket filled with the specified Fluid. In 1.12+, this has been deprecated in favour of FluidUtil.getFilledBucket. Keep in mind that vanilla recipes don't support ingredients with NBT in 1.11.2, you'll need to create your own recipe classes (you'll probably want to extend an existing recipe class). In 1.12+, use a minecraft:item_nbt ingredient in a JSON recipe to create an NBT-sensitive ingredient. Edit: Fluid textures go in src/main/resources/assets/<modid>/textures/<path>, not src/main/resources/assets/<modid>/textures/blocks/<path>.
  17. Forge doesn't allow you to use checkboxes or radio buttons by default, it uses buttons that cycle between the valid values when clicked instead. A boolean field will be converted to a boolean property and use a button that cycles between true and false in the config GUI. This is equivalent to a checkbox. An enum field will be converted to a string property that only accepts the enum's values and use a button that cycles between these values in the config GUI. This is equivalent to a set of radio buttons. What would you want a non-radio button for?
  18. If you mean the tiled dirt background, that's assets/minecraft/textures/gui/options_background.png (Gui.OPTIONS_BACKGROUND).
  19. I'm not too sure what the problem is, then. Try setting a breakpoint in ItemSlab#onItemUse, clicking a top slab while holding a slab and stepping through the code to see why it's not combing the slabs. Side note: ModelLoader is a client-only class, referencing it in common code will crash the dedicated server. Model registration must be handled in a dedicated, client-only class. Registration of Blocks, Items and other IForgeRegistryEntry implementations should be done in the corresponding registry events. Registration of models should be done in ModelRegistryEvent. Pass Side.CLIENT to the @Mod.EventBusSubscriber annotation to prevent the model registration class being loaded on the dedicated server.
  20. What class are you using for the Item form of the slab? Vanilla uses ItemSlab, which handles combining single slabs into double slabs.
  21. What you've created is an item predicate, not a criterion trigger. You need to use an existing criterion trigger like inventory_changed but use your custom item predicate instead of the vanilla one. As I said before, each object in the items array for the inventory_changed criterion is an item predicate. You need to set the type element of an item predicate object to the registry name of your custom item predicate.
  22. RegistryEvent.Register is only for types that are in a Forge registry (i.e. types that implement IForgeRegistryEntry). There's no IWorldGenerator registry (IWorldGenerator doesn't extend IForgeRegistryEntry), so IWorldGenerators should still be registered in preInit/init. Recipe files in your mod's assets/<modid>/recipes directory are automatically loaded and registered by Forge. IRecipeFactory, IIngredientFactory and IConditionFactory classes should be specified in assets/<modid>/recipes/_factories.json rather than being registered in code. If you do register recipes in code (which you should avoid doing where possible), do it in RegistryEvent.Register<IRecipe>.
  23. You need to build your mod with the build Gradle task, which reobfuscates your code to SRG names after compiling it. These are the names used by Minecraft outside of the development environment.
  24. It needs a Function<JsonObject, ItemPredicate>, i.e. a function that takes a JsonObject and deserialises it into an ItemPredicate. You can implement this with a lambda, method reference (e.g. a constructor method reference) or an anonymous class. Look at the static initialiser block in ItemPredicates and the OredictItemPredicate constructor it references for an example of this.
  25. I don't know the answer to that myself. Have you tried looking at the difference between AbstractHorse in 1.12 and EntityHorse in 1.10.2 to see how the vertical parameter has changed the motion calculations?
×
×
  • Create New...

Important Information

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