Jump to content

Question

Posted

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?

 

Recommended Posts

  • 0
Posted (edited)
3 minutes ago, InFocus said:

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 by melron
  • 0
Posted
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
Posted
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
Posted
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
Posted
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
Posted
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
Posted
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
Posted (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 by melron
  • 0
Posted

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
Posted (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 by InFocus
Guest
This topic is now closed to further replies.



×
×
  • Create New...