Sanity 436 Posted September 28, 2017 Report Share Posted September 28, 2017 Hello Lads, I ran into an issue with the Vencillio base where gem's and some other items could be cut or crafted without the necessary tool, today I have a small snippet of code which could be considered kinda "hacky" but takes care of this issue. First Open your Crafting.java rs2.content.skill.craftingnew.Crafting.java search for public boolean itemOnItem(Player player, Item use, Item with) { next search for this final Craftable craftable = getCraftable(use.getId(), with.getId()); if (craftable == null) { return false; } and underneath that we can add this snippet of code I have written. if(craftable.getUse().getId() != use.getId() && craftable.getUse().getId() != with.getId()) { player.send(new SendMessage("You need a " + craftable.getUse().getDefinition().getName() + " to craft this")); return false; } Let's explain a bit what this code does so you guys can understand how we are solving this issue craftable.getUse.getId() returns the ID of the required Chisel(or required tool) we are comparing this against both of our used items to make sure a chisel is in fact being used. If the correct tool is not being used we are using craftable.getUse().getDefinition.getName() to return the name of the proper tool to the user. Hopefully this helped someone out. Link to comment Share on other sites More sharing options...
SpiritOfTheLau 0 Posted May 9, 2020 Report Share Posted May 9, 2020 Simple solution but well crafted. Nice work Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now