InFocus Posted October 4, 2018 Posted October 4, 2018 Hi all, i have just a question. It is possible to restrict all items (armor,weapons,etc etc) and leave just 1 type or armor to access in zone? I mean for VoiceCommand teleport?
0 melron Posted October 4, 2018 Posted October 4, 2018 (edited) 3 minutes ago, InFocus said: http:// i didnt give you this line... check again return Arrays.asList(getInventory().getItems()).stream().filter(i -> i.isEquipped() && i.getItem().getCrystalType() == type).findAny().isPresent(); Edited October 4, 2018 by melron
0 Kara Posted October 4, 2018 Posted October 4, 2018 3 minutes ago, melron said: What about a small refactored code? https://imgur.com/a/WlU1ThX @InFocus use this The millisecond is because of the printLn. If you remove printLn you will see that there is no difference. And even if there is a 30 millisecond difference do you know what 30 millisecond mean? It's the 0.03 of a second. Your neurotransmitters pass a signal though in 0.6 millisecond. The code is execute faster than this.
0 melron Posted October 4, 2018 Posted October 4, 2018 1 minute ago, Kara` said: The millisecond is because of the printLn. If you remove printLn you will see that there is no difference. And even if there is a 30 millisecond difference do you know what 30 millisecond mean? It's the 0.03 of a second. Your neurotransmitters pass a signal though in 0.6 millisecond. The code is execute faster than this. thats why i didnt even touch the code because the difference for what he needs is absolutely 0. but lets get real, the correct syntax is not the one you posted
0 InFocus Posted October 4, 2018 Author Posted October 4, 2018 Well, i must select TYPE like parameter?
0 Kara Posted October 4, 2018 Posted October 4, 2018 1 minute ago, melron said: thats why i didnt even touch the code because the difference for what he needs is absolutely 0. but lets get real, the correct syntax is not the one you posted It's corrent no matter what. If you dig so far then the syntax of java as a language is not correct and we should wait for jdk 12 update. Now if you want dig so far for 30 millisecond go ahead i dont care Melronious Melroni.
0 melron Posted October 4, 2018 Posted October 4, 2018 2 minutes ago, Kara` said: It's corrent no matter what. If you dig so far then the syntax of java as a language is not correct and we should wait for jdk 12 update. Now if you want dig so far for 30 millisecond go ahead i dont care Melronious Melroni. Did you change your try() style or... ?
0 Kara Posted October 4, 2018 Posted October 4, 2018 Just now, melron said: Did you change your try() style or... ? Depends if i wake up, drink my tea, sit on PC, open maxcheaters and the first thing i see is a post of yours then nop. But most of the times. I had even difficult time moving from normal for to lambda even tho lambda is slower for 1 millisecond :'(
0 InFocus Posted October 4, 2018 Author Posted October 4, 2018 else if (activeChar.hasGradeEquipped(CrystalType.S)) { activeChar.sendMessage("You don't have equiped with S grade"); return false; } + public boolean hasGradeEquipped(CrystalType s) { return Arrays.asList(getInventory().getItems()).stream().filter(i -> i.isEquipped() && (i.getItem().getCrystalType() == s)).findAny().isPresent(); } I no have any items S in inventory and i can teleport. Why?
0 InFocus Posted October 4, 2018 Author Posted October 4, 2018 What's wrong :))))))))))))))) except my english
0 melron Posted October 4, 2018 Posted October 4, 2018 (edited) 1 minute ago, InFocus said: What's wrong :))))))))))))))) except my english The only wrong here, is your english mate... the code is working like this: if the player have ATLEAST 1 item S grade equiped he CANT teleport What you mean you havent items in your inventory? Edited October 4, 2018 by melron
0 InFocus Posted October 4, 2018 Author Posted October 4, 2018 Melron , Melron :) I want to say IF player have the LAST item S grade in inventory CAN teleport in that zone!!! With 0 items s grade, i want player can't enter ! :)
0 InFocus Posted October 4, 2018 Author Posted October 4, 2018 (edited) For exemple, if player have full Draconic armor (Doesn't metter if it's light or heavy) and no have weapon (S grade:) ) he can not enter Edited October 4, 2018 by InFocus
Question
InFocus
Hi all, i have just a question. It is possible to restrict all items (armor,weapons,etc etc) and leave just 1 type or armor to access in zone? I mean for VoiceCommand teleport?
70 answers to this question
Recommended Posts