-
Posts
44 -
Joined
-
Last visited
-
Days Won
2
Everything posted by TheMikeste1
-
The best tutorial is vanilla code. Take a look at a simple mob's Entity, Renderer, and Model classes. I'm just now dabbling with it, but from what I can tell registering mobs is the same as 1.14.
-
Hmm.. Okay. I poked around a little in your code, but I couldn't find where you were registering your container. Could you link that for me? Edit: I'm dumb. It's here: https://github.com/GummyBlasian/Inventory-Power/blob/master/src/main/java/com/sangam1/InventoryRepair/Registry.java#L61
-
https://github.com/GummyBlasian/Inventory-Power/blob/master/src/main/java/com/sangam1/InventoryRepair/proxy/ClientProxy.java#L15 You need to register your screen, as you were trying to do here. Here's mine as an example: https://github.com/TheMikeste1/Wabbits/blob/master/src/main/java/themikeste1/wabbits/Wabbits.java#L102 It needs to be client-side, so as long as you're initializing your client proxy only on the client-side you should be good.
-
How create a custom mob / entity in 1.14 and above
TheMikeste1 replied to Bantix's topic in Modder Support
No, I have not. It's all code. -
[1.14.4][RESOLVED] OBJ Models: How to Get Started
TheMikeste1 replied to TheMikeste1's topic in Modder Support
Assuming nothing has changed between 1.14 version, take a look at this: #onModelBakeEvent. -
[1.14.4] How to properly call OBJLoader.INSTANCE.addDomain
TheMikeste1 replied to jun2040's topic in Modder Support
You only call it on the client side, like so: private void doClientStuff(final FMLClientSetupEvent event) { ... OBJLoader.INSTANCE.addDomain({modid}); ... } You can see how I did it here. -
[1.14.4][RESOLVED] OBJ Models: How to Get Started
TheMikeste1 replied to TheMikeste1's topic in Modder Support
@ehaugw I handled the Pre Stich event here. @jun2040 I created a model.json for my test block in addition to the other files. See here. @blinky000 My models map a .png file to the sides of the block. See my .mtl file. -
I haven't tried it, but you should try taking a look at EntityJoinWorldEvent. You can listen for this event, then add what you want as the player spawns. Be aware that this event is called for every entity whenever it joins the world (including on respawn). There are also a number of PlayerEvents you might want to look at.
-
I think you need to register a GUI factory for you mod. See line 408 of net.minecraftforge.fml.client.gui.GuiModList. Unfortunately, I'm not quite sure how you do that. I would suspect it has to do with ScreenManager, like Block GUIs do.
-
[SOLVED][1.14.4] Disable Player Crafting/Smelting
TheMikeste1 replied to TheMikeste1's topic in Modder Support
Excellent, thanks! -
[SOLVED][1.14.4] Disable Player Crafting/Smelting
TheMikeste1 replied to TheMikeste1's topic in Modder Support
Awesome, thank you. I should have specified though: I want to disable vanilla recipes. Is there a way to use those to override the vanilla recipes somehow? -
I'm attempting to prevent a player from crafting/smelting items if they don't fulfill certain requirements. I've read through some some older posts ([1.10.2] Disabling crafting recipe for certain players, Player-based Crafting Recipes), but was hoping there was a new way to do it. Unfortunately, I've already played with ItemCraftedEvent and ItemSmeltedEvent, but they still trigger after the deed has been done. From what I've read, there may not be a way to prevent a smelting recipe, but if anyone has any ideas on how to stop it I'd appreciate it. Thanks!
-
It looks like the config system has changed a little bit since 1.13. I followed McJty's tutorial here: https://wiki.mcjty.eu/modding/index.php?title=Tut14_Ep6#Configuration Video: https://youtu.be/Qz5gpY37KdQ?list=PLmaTwVFUUXiBKYYSyrv_uPPoPZtEsCBVJ&t=733 I also have some code you can look at here: Registering and loading Config Config.java
-
I'm creating my own registry, and I noticed net.minecraftforge.registries.NamespacedWrapper is package-private. This class is used in GameData as the callback for most registries. Was this intentional? I could just make my own version, but since NamespacedWrapper does everything I need (and seems to be what every other registry is using), I'd prefer to use it. Are there any other classes that are more suitable as a registry callback for modders?
-
Try reading through the model section of ReadTheDocs. (https://mcforge.readthedocs.io/en/latest/models/introduction/)
-
I made a post about this topic not too long ago. You can find it here: Hopefully you'll be able to figure it out by poking through there.
-
[1.14.4] How to add render layers to players
TheMikeste1 replied to Huntrex's topic in Modder Support
So it would basically change the skin of the player? I don't have my IDE available to see how to do this, but you could try updating the texture of the PlayerModel whenever the item is in their inventory instead of adding an overlay. That would eliminate the possibility of textures from the original skin poking through the overlay as well. -
A couple hours ago I tried updating Forge for one of my projects from version 28.0.88 to 28.0.91, but now I can't compile my code, even after switching back to 28.0.88. I've tried removing IntelliJ's .idea folder and reimporting the project, as well as deleting the MC and Forge libraries stored in the Users/~user~/.gradle folder. I've also tried downloading the new MDK and replacing my project's files with it (especially build.gradle, since I've modified mine). If anyone would be willing to take a look at my files and help me figure out what's wrong, I'd appreciate it: https://pastebin.com/ssXsgtEq build.gradle mappings Forge dependency gradle.properties Note that I've been changing versions by modifying forgeversion in gradle.properties. It hasn't caused any issues so far, but I don't think that's the issue since I've tried using a fresh build.gradle. I've also tried changing mappings to mappings channel: 'stable_', version: '1.14.4' just in case that was the issue, but it unfortunately didn't help. Finally, on line 244 of the pastebin, you'll notice it's searching a local repository I've made. I've tried manually downloading the files it's looking for from the official Forge website and placing them there, but it still wouldn't compile. Thanks in advance!
-
We won't be able to help much without seeing your code. However, it looks like you have a NullPointerException here: meaning something wasn't initialized.
-
How create a custom mob / entity in 1.14 and above
TheMikeste1 replied to Bantix's topic in Modder Support
I just finished experimenting with this. Here's my repository if you want to have a look: https://github.com/TheMikeste1/Wabbits You'll need to register an EntityType. Please note that the way I'm doing this is a little strangely because of the way I set up my spawn eggs. There's a lot of code you don't need in my repository. Once you've registered an EntityType, you'll need a probably need a custom entity class. For rendering, you'll need a renderer, renderer factory, and a model (unless you want to use one of the existing models. Once you've made those, you can register your renderer like so (note that this is client side only!): RenderingRegistry.registerEntityRenderingHandler(WabbitEntity.class, RenderWabbitFactory.INSTANCE); -
I have a local folder where I keep all my libraries. I point to it in my build.gradle like this: //... // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply plugin: 'eclipse' apply plugin: 'maven-publish' repositories { flatDir { name = "locallib" dir "../~lib" } } //The rest of the file... Later, in the dependencies section, I have this: dependencies { //... compile "themikeste1:librarymodid:" + mcversion + "-modversion" } My mods.toml for the mod I'm working on contains this: [[dependencies.modid]] modId="librarymodid" mandatory=true versionRange="[0,)" ordering="NONE" side="BOTH" You could change the side attribute to say SERVER if you want it to only be applied on the server. My jar manifest for the mod I'm depending on is set up like this: jar { manifest { attributes([ "Specification-Title": "modname", "Specification-Vendor": "TheMikeste1", "Specification-Version": "1", // We are version 1 of ourselves //Are we though? "Implementation-Title": project.name, "Implementation-Version": "${modVersion}", "Implementation-Vendor" :"TheMikeste1", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "Maven-Artifact": "themikeste1:librarymodid:" + version ]) } } I then just publish the mod I depend on to that folder and I'm able to use it as normal. I have no idea if this is how you're supposed to do it, but it works for me. ??♂️
-
[1.14.4] [SOLVED] How to get Recipes with IItemHandler
TheMikeste1 replied to TheMikeste1's topic in Modder Support
Oh, awesome. I didn't notice that class. Thanks! -
I've been using an IItemHandler (which, according to the Forge docs, we're supposed to use instead of IInventory) to handle the inventory of one of the processing blocks in my mod. However, I'm not sure how to get recipes with it. The Minecraft RecipeManager requires an IInventory as the second parameter of #getRecipe(), and I couldn't find a Forge RecipeManager nor a different method that would take an IItemHandler and return a recipe. Does anyone know how I can get recipes using my IItemHandler? Just for reference, here's what I'm trying to do: public class GrinderTileEntity extends TileEntity implements ITickableTileEntity, INamedContainerProvider { private LazyOptional<IItemHandler> itemHandler = LazyOptional.of(this::createItemHandler); private LazyOptional<IEnergyStorage> energyHandler = LazyOptional.of(this::createEnergyHandler); private int counter = 0; public GrinderTileEntity() { super(TileEntityTypes.grinder); } @Override public void tick() { if (world.isRemote) return; //Nothing to do if we have no energy AtomicBoolean hasEnergy = new AtomicBoolean(); energyHandler.ifPresent( e -> hasEnergy.set(e.getEnergyStored() > 0) ); if (!hasEnergy.get()) return; //Nothing to do if there isn't an item. AtomicReference<ItemStack> stack = new AtomicReference<>(); itemHandler.ifPresent( h -> stack.set(h.getStackInSlot(0).copy()) ); if(stack.get().isEmpty()) return; AtomicReference<IItemHandler> inventory = new AtomicReference<>(); itemHandler.ifPresent(inventory::set); //#getRecipe() is where it breaks, specifically inventory.get() IRecipe<?> recipe = world.getRecipeManager() .getRecipe(RecipeTypes.GRINDING, inventory.get(), world) .orElse(null); //processing... } /* ************************************************ * Used to create the IItemHandler for itemHandler ***************************************************/ private IItemHandler createItemHandler() { return new ItemStackHandler(2) { @Override public boolean isItemValid(int slot, @Nonnull ItemStack stack) { return ItemTags.getCollection() .get(ResourceLocation.tryCreate("forge:ores")) .contains(stack.getItem()) && slot == 0; } @Nonnull @Override public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { if (slot != 0 || !ItemTags.getCollection() .get(ResourceLocation.tryCreate("forge:ores")) .contains(stack.getItem()) ) { return stack; } return super.insertItem(slot, stack, simulate); } @Override protected void onContentsChanged(int slot) { markDirty(); } }; } //other functions... } Thanks!
-
[1.14.4][RESOLVED] OBJ Models: How to Get Started
TheMikeste1 replied to TheMikeste1's topic in Modder Support
That did it! Thank you so much!