Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

fr0st

Forge Modder
  • Joined

  • Last visited

Everything posted by fr0st

  1. Oh, I have already dealt with this kind of problem. I have basically created a dynamic alloy system (The crafting class of the alloy tool checks the metals used in the crafting and adds all of the components' attributes, like durability, efficiency and all kinds of custom values), which is quite an analogy here, or I misunderstood everything; if that's the case, don't bother keeping to read, just give me an heads up on that. Let me try to explain you how I've done it.. First of all I created a crafting class implementing IRecipe. I will skip IRecipe#matches, and get right to the one we need: IRecipe#getCraftingResult. Here you can get the components used in the recipe (IRecipe#getCraftingResult has an InventoryCrafting argument, which is basically the crafting grid inventory). So, you check if one of the components is a diamond, you add 5 to a "durability" value, for example. That's just to give you the idea. Then when you have checked through all of your components and rods, and adjusted your values, you return an ItemStack containing your custom tool (Don't forget Item#setMaxDamage(yourDurabilityValue) to set your tool's custom durability) Hope I made that clear enough. To summarize things up: You make a custom IRecipe class which will handle your custom tool's crafting. Use then IRecipe#getCraftingResult to grab all the components you need, and after checking them, add for example an int to a durability value. When you are done, return an itemstack containing your custom tool, with all the proper adjustments. This is quite basic (that's how I see it), you just need to tell me what you don't understand, okay?
  2. Don't let sieben read! Quick, hide the evidence!
  3. event.x, event.y, and event.z are the coordinates of the block you interacted with. You obviously check if the block at those coords is a sandstone block. Note that the event fires even if you left click, so add a check for event.action aswell! Then you need to check the item that the player is holding, and we have an event.entityPlayer. Finally, the side of the block the player has interacted with: event.face. 1 is the top face, so you should go with that. At this point we checked if the player right clicked with a flint and steel in hand, on the top side of a sandstone block. Now you should set your portal blocks with event.world.setBlock. But be careful, because you also need to check for the shape of the portal around (and by that I also mean its orientation) I won't provide any code for now, you have to try by yourself!
  4. strings.MODID is "animals" right? That needs to be lowercase. Also, an error about the file not found should pop up on the console.. you might try and spot it, and see what minecraft is actually looking for.
  5. *Double post, my connection derped*
  6. I also noticed that when you use addRecipe, you do "B", instead of " B ".. spaces matter, as there should be 3 chars.. space = no item in the crafting recipe. By the way.. you should post the crash log and the main class.. we aren't wizards
  7. Wait... why not just using a PlayerInteractEvent, which is easier? You have everything you need in that event. Making a new fire block is pointless, in my opinion..
  8. fr0st replied to fr0st's topic in Modder Support
    You should open a new thread, instead of necrobumping..
  9. Well... he's here to learn, not to copy-paste ready code.. Also, what are you talking about? itemList should have been a List<Item>, or an item array.. whereas obviously for the random part you need the randomInt as an integer... you might have gotten that wrong..
  10. Like when hovering an item, you hold shift and it shows more info? Easy! In your addInformation you want this: if(GuiScreen.isShiftKeyDown()){ do some stuff } If that's not what you needed... apologies, my english confused me!
  11. Ok, so today I looked inside minecraft's src, and I saw that rain and snow are rendered inside EntityRender.. so is there a way to add a new weather effect without changing base classes, which is something i don't want to?
  12. Could you please provide an ingame screenshot, and a techne one of your model? I would like to understand a bit more
  13. I did, to make my backpack wearable.. @Override public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { return yourmodel; }
  14. Basically, after 30 minutes of testing some volcano codes [spoiler=..exactly] i came up with the right function (2gudatmaths).. but then suddenly my mind was overrun by an idea.. what about a new weather effect? (Before you ask it, no, i can't stick to one task. That is bad. That is me. Sorry) What I would like to do, is like snow biomes do.. when it's raining, instead of rain render a snowfall.. I wanted to make something similar for my custom biome (Which i will create, I don't have it right now).. so instead of water, i want ashes to rain. I don't really think I saw this before in any other mod, so that is why i am asking.. is this even possible? Thanks in advance.
  15. Inside your registerIcons you need to register the textures from your mod's assets folder.. add "yourmodid:" before the texture name.
  16. fr0st replied to fr0st's topic in Modder Support
    Progress was made.. at least now my generator transfers energy correctly to adjacent blocks, the problem here is going to be wires.
  17. fr0st replied to fr0st's topic in Modder Support
    I know that, but still I don't want to use apis.. i wouldn't be asking for help then ^^
  18. You aren't overriding it correctly, that method doesn't only pass an Entity parameter. If you are using eclipse, use the Ctrl + Space shortcut to automatically have the method overridden, and then of course use the parameters you are given
  19. fr0st replied to fr0st's topic in Modder Support
    Because not everyone wants to use and depend on someone else's api.. my goal is to make it myself, but to achieve it i need this forum
  20. Multiply entity.motionX, entity.motionY, entity.motionZ by whatever you want.
  21. fr0st replied to fr0st's topic in Modder Support
    I should have said that in the op, but.. i am already doing that! package coalpower.api.energy; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; public class EnergyBuffer implements IEnergySink{ private int energy, maxEnergy, intakeRate, extractRate; public EnergyBuffer(int maxEnergy, int rate){ this(maxEnergy, rate, rate); } public EnergyBuffer(int maxEnergy, int receiveRate, int extractRate){ this.maxEnergy = maxEnergy; this.intakeRate = receiveRate; this.extractRate = extractRate; } public int getEnergy(){ return energy; } public int getMaxEnergy(){ return maxEnergy; } public void readFromNBT(NBTTagCompound nbt){ this.energy = nbt.getInteger("EnergyBuffer"); } public void writeToNBT(NBTTagCompound nbt){ nbt.setInteger("EnergyBuffer", energy); } @Override public int receiveEnergy(int amount) { int energyAmount = Math.min(maxEnergy - energy, Math.min(intakeRate, amount)); this.energy += energyAmount; return energyAmount; } @Override public int extractEnergy(int amount) { int energyAmount = Math.min(energy, Math.min(extractRate, amount)); this.energy -= energyAmount; return energyAmount; } } (IEnergySink is just an interface for receiveEnergy, extractEnergy, getMaxEnergy and getEnergy) What I need is an efficient way to build a network.. with my java skills. Like when a block is added into the world, add it to a network aswell (If there is one, else build a new one), then transfer this energy over the network..
  22. onEntityCollidedWithBlock passes an Entity argument
  23. fr0st posted a topic in Modder Support
    Here i am with this question again.. i have a block that is able to connect to other energy-based blocks (only rendering). Energy is just a variable, no magic, and i know that.. i just need to know how to actually go for making a network. Doing what i think i should do isn't a good way to go.. which is: I am a wire. If i have energy and i detect a block that needs it, after scanning all the blocks around myself, i pass it to said block. but the error here would be that the wire would also detect its source of power and give the power back.. My java skills generally are pretty basic. I have been in the modding section of minecraft for an year or so, and learnt java all from modding.. Is someone willing to point me in the right direction here? I am not in a rush to implement this.. Also keep in mind that I want to have things as tidy and efficient as they can get.. that is why i rewrote my mod from scratch.... 2 times..
  24. Scale it before rendering?
  25. Yep, you are right, since he can understand english aswell. Enough off topic from me, let's wait for him now

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.