Skip to content

Commit

Permalink
Fixed Jellyfish trying to poison boats Crash
Browse files Browse the repository at this point in the history
Fixed Jellyfish trying to poison Boats and Players on Boats. This also includes Boats from Et Futurum Requiem.
  • Loading branch information
Rozmir-Rohi committed Dec 14, 2024
1 parent 9035b5b commit 0c5577c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import drzhark.mocreatures.entity.MoCEntityTameableAquatic;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.item.EntityBoat;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.potion.Potion;
Expand Down Expand Up @@ -169,13 +171,32 @@ protected void collideWithEntity(Entity entityThatThisEntityHasCollidedWith)
entityThatThisEntityHasCollidedWith instanceof MoCEntityJellyFish
|| entityThatThisEntityHasCollidedWith instanceof MoCEntityShark
|| entityThatThisEntityHasCollidedWith instanceof MoCEntityRay
|| (
entityThatThisEntityHasCollidedWith instanceof EntityPlayer
&& entityThatThisEntityHasCollidedWith.ridingEntity != null
&& ( //don't try to poison players that are riding boats
entityThatThisEntityHasCollidedWith.ridingEntity instanceof EntityBoat
|| (
MoCreatures.isEtFuturumRequiemLoaded
&&
(
EntityList.getEntityString(entityThatThisEntityHasCollidedWith.ridingEntity).equals("etfuturum.new_boat")
|| EntityList.getEntityString(entityThatThisEntityHasCollidedWith.ridingEntity).equals("etfuturum.chest_boat")
)
)
)
)
)
)
{
int secondsToApplyPoison = worldObj.difficultySetting.getDifficultyId() * 3;

//posion entities that collide with this entity
((EntityLivingBase) entityThatThisEntityHasCollidedWith).addPotionEffect(new PotionEffect(Potion.poison.id, (secondsToApplyPoison)* 20, 0));

if (entityThatThisEntityHasCollidedWith instanceof EntityLivingBase)
{
((EntityLivingBase) entityThatThisEntityHasCollidedWith).addPotionEffect(new PotionEffect(Potion.poison.id, (secondsToApplyPoison)* 20, 0));
}
}

super.collideWithEntity(entityThatThisEntityHasCollidedWith);
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/Rozmirs modifications to Mo Creatures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1330,4 +1330,7 @@ Converted the "instant kill if entity spawned in wrong biome" events to override
Fixed Fish Net not saving the entity data of aquatic pet which used to prompt the player to rename an already named pet.


Non-Flying Mo'Creatures Horses now display and use the vanilla horse jump bar.
Non-Flying Mo'Creatures Horses now display and use the vanilla horse jump bar.


Fixed Jellyfish trying to poison Boats and Players on Boats. This also includes Boats from Et Futurum Requiem.

0 comments on commit 0c5577c

Please sign in to comment.