Fake players don't drop spell books (#818)

Magic shouldn't be automated

Co-authored-by: DrParadox7 <47131096+DrParadox7@users.noreply.github.com>
This commit is contained in:
WinDanesz
2022-07-09 23:29:24 +02:00
committed by GitHub
parent 09f858af20
commit 98997d90ac
2 changed files with 16 additions and 3 deletions
@@ -801,7 +801,7 @@ public class WizardryEventHandler {
@SubscribeEvent
public void onLivingDropsEvent(LivingDropsEvent event){
// Evil wizards drop spell books themselves
if(event.entityLiving instanceof EntityMob && !(event.entityLiving instanceof EntityEvilWizard) && event.source.getEntity() instanceof EntityPlayer && Wizardry.spellBookDropChance > 0){
if(event.entityLiving instanceof EntityMob && !(event.entityLiving instanceof EntityEvilWizard) && event.source.getEntity() instanceof EntityPlayer && !(event.source.getEntity() instanceof FakePlayer) && Wizardry.spellBookDropChance > 0){
// This does exactly what the entity drop method does, but with a different random number so that the
// spell book doesn't always drop with other rare drops.