-
Posts
424 -
Joined
-
Last visited
Everything posted by Daeruin
-
Thanks, that's what I needed to know and it's quite simple.
-
No. What I'm asking for just the normal setup for working with multiple versions of Forge. It's probably something super simple. But I've only ever made one mod for one version of Minecraft. And this is my first time using IntelliJ for anything. Say I switch to my git branch for 1.16. My local repo now has all my 1.16 code for my mod. But IntelliJ doesn't know that. My existing project in IntelliJ still has some old version of Forge loaded. Now what?
-
I know how to use git and branches. How do I make multiple versions of the Minecraft source code available in IntelliJ?
-
How do you maintain multiple versions of your mod? I want to be able to do bug fixes for mods I released for older versions of Minecraft while still developing new mods for 1.16. I'm using IntelliJ and I don't know how to set up my projects to accomplish this.
-
I'm talking about an item, not a block. I didn't want to have to make a whole 3D item model. That wouldn't save me any time. I'm wanting to use the built-in item rendering, but just using a portion of an existing texture image.
-
I have an item with three sizes. Is it possible to use just one texture for all three, and specify which part of the texture file to use? So the large would use the entire texture, the medium would use a 10x10 portion of the texture, and the small would use 6x6. I know the item model supports the use of elements, and you can set uv coordinates for the elements, but I'm not sure how exactly I would use that in this case, or if it's even possible. I can't think of any examples to look at. TIA.
-
Thank you for the reply. Does using RenderTypeLookup#setRenderLayer do the same thing as Block#getRenderLayer used to do? Or are they different things?
-
I'm planning to create 12 blocks, each with 3 sizes and 16 color variations, and I don't want to have to create hundreds of texture files to support all the variations. Each of the 12 blocks will have its own base texture that I want to just tint with another color. I have created an IBlockColor and successfully used it to change the color of the blocks, but the end result isn't good enough. For example, when I color some of the base textures with a dark blue, it basically ends up being black. I would like it to merely be tinted blue. I can achieve a slightly better color for those blocks by using a lighter shade of blue, but then the other blocks are too pale. I don't want to have to find a unique, perfect color for hundreds of blocks by trial and error. Playing around in Photoshop, I can consistently get the effect I want by putting a colored layer with like 40% opacity over top of each texture. Is there a way to achieve this kind of effect in Minecraft?
-
Do you know Java? That's step one.
-
My solution is different from what the others are talking about. See Jabelar's tutorial on conditional recipes and follow the link he gives to Choonster's TestMod3 example. It's all laid out there. The basic idea is that you create a class that implements IConditionFactory to return true or false based on some value in your config file. Then you create a _factories file in your recipes folder. Then you add the condition into the recipe's json file. This is all for 1.12.2. I haven't looked at newer versions and don't know if it works the same. What version are you working with?
-
It seem like you could also have two versions of the recipe with conditions that check the config value to determine which recipe to load.
-
[1.12.2] Recipe advancement for conditional recipe
Daeruin replied to Daeruin's topic in Modder Support
There have to be a dozen different posts here about how to add advancements. Can't be that hard to find. -
[1.12.2] Wanting to know if dropped item is gone.
Daeruin replied to Lea9ue's topic in Modder Support
You are right. I had forgotten about that. There are a handful of methods you can override to get custom control over the EntityItem created by a specific Item: hasCustomEntity, createEntity, onEntityItemUpdate, and getEntityLifespan. You would override hasCustomEntity to return true, then override createEntity to supply your custom EntityItem. -
[1.12.2] Wanting to know if dropped item is gone.
Daeruin replied to Lea9ue's topic in Modder Support
After creating your custom EntityItem class, you would subscribe to EntityJoinWorldEvent and replace the entity with your custom one. I think this post ended up doing that: -
I have a custom recipe that is conditional based on a setting in my mod's config. Depending on how the user sets up the config, the recipe may or may not be available. I also have an advancement for the recipe, so it automatically gets added to the user's recipe book when they get the appropriate items. This causes an error when the recipe is turned off in the config, because the advancement doesn't recognize the recipe. Is there some way to make the advancement conditional, as well? Or another way to deal with the issue?
-
Found the problem. I was mixing up slot index with slot number (for like the tenth time). Slot indexes start over for each inventory, but slot numbers are continuous across inventories (like a chest inventory and survival inventory). I also made my code a little more efficient by only searching the player's inventory, since that's where I don't want items to end up. Here's the final code, for anyone who's interested.
-
Alright, I found something that seems to be working: EntityPlayerMP player = (EntityPlayerMP)event.getEntityPlayer(); player.dropItem(stackInSlot, false); // Spawns the EntityItem player.inventoryContainer.putStackInSlot(i, ItemStack.EMPTY); player.sendContainerToPlayer(player.inventoryContainer); This only works in my regular survival inventory so far (placing item in the 4x4 crafting grid and closing it with hot bar full so item is forced to go into my regular inventory). If I do it with a crafting table, there seems to be something wrong with my slot indexes, because I'm getting two copies of the item, with one of them in a slot I don't expect. I'll try to figure out that problem tomorrow.
-
Latest code: @SubscribeEvent public void onContainerClosed(PlayerContainerEvent.Close event) { Container container = event.getContainer(); List<Slot> slotList = container.inventorySlots; for (int i = 0; i < slotList.size(); i++) { Slot slot = container.inventorySlots.get(i); IInventory inventoryForSlot = slot.inventory; if (inventoryForSlot instanceof InventoryPlayer && slot.getSlotIndex() > 8) // I think this guarantees the slot is NOT in the hot bar { ItemStack stackInSlot = slot.getStack().copy(); if (stackInSlot.getItem() instanceof ItemBlockBasket) { event.getEntityPlayer().dropItem(stackInSlot, false); // Spawns the EntityItem event.getEntityPlayer().inventory.setInventorySlotContents(slot.getSlotIndex(), ItemStack.EMPTY); event.getEntityPlayer().inventoryContainer.detectAndSendChanges(); } } } }
-
I did this: event.getEntityPlayer().inventoryContainer.detectAndSendChanges(); event.getEntityPlayer().openContainer.detectAndSendChanges(); No dice. When I open my inventory, the item still appears to be there, but if I try to click on it, it immediately disappears. If I open another container, like the crafting table, the item disappears.
-
I didn't originally post any code, because I was asking about ideas for something I hadn't written code for yet. I have since attempted something. This is my current attempt to remove my block from the regular inventory after closing the crafting table container. The only problem is that removing the item from the slot doesn't get synced to the client. Current working code that prevents my block from being placed in the regular inventory via mouse clicks or keyboard.
-
I have a block that should only be allowed in the player's hot bar--not their regular inventory slots and not in other containers. So far I have been using GuiScreenEvent to detect the various mouse clicks and keyboard shortcuts that move items around. It's working except one scenario. If the player puts the block in the crafting grid, fills up their hot bar, then closes the crafting GUI with the block still in the crafting grid--the block automatically gets put into their regular inventory (assuming they have empty slots there). How can I detect this situation? I've been hoping to avoid the need to loop through every player's inventory every tick to search for the block.
-
There are a number of posts here on how to remove vanilla recipes in 1.12. Take five minutes to search.
-
Replacing vanilla blocks is sometimes necessary if there's no event that will let you achieve the behavior you want. It can decrease mod compatibility if other mods are modifying or replacing the same block as you, so try to use events first.
-
https://shadowfacts.net/tutorials/forge-modding-112/ https://cubicoder.github.io/tutorials/1-12-2/tutorials/ Also check out Cadiboo's test mod, Choonster's TestMod3, The Grey Ghost, Minecraft by Example.
-
[1.12.2]Modding: Item the opens a GUI when right-clicked
Daeruin replied to Jigokusaru's topic in Modder Support