Revert "Merge remote-tracking branch 'origin/dev' into dev"

This reverts commit 66edbcea80, reversing
changes made to 3fd962289c.
This commit is contained in:
Luis C.M committed 2022-11-06 01:25:28 -06:00
1 parent 66edbcea80
commit 8d3cd3fd82
58 files changed
+780 -284

No files matched your search

@@ -1,13 +1,19 @@
package noppes.npcs.scripted.entity;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import noppes.npcs.scripted.constants.EntityType;
import noppes.npcs.scripted.interfaces.entity.IAnimal;
import noppes.npcs.scripted.interfaces.entity.IPlayer;
import noppes.npcs.scripted.interfaces.item.IItemStack;
public class ScriptAnimal<T extends EntityAnimal> extends ScriptLiving<T> implements IAnimal {
protected T entity;
public ScriptAnimal(T entity) {
super(entity);
this.entity = entity;
}
@Override
@@ -15,8 +21,35 @@ public class ScriptAnimal<T extends EntityAnimal> extends ScriptLiving<T> implem
return EntityType.ANIMAL;
}
/**
* Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
* the animal type)
*/
public boolean isBreedingItem(IItemStack itemStack) {
return this.entity.isBreedingItem(itemStack.getMCItemStack());
}
/**
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
*/
public boolean interact(IPlayer player) {
return this.entity.interact((EntityPlayer) player.getMCEntity());
}
public boolean isInLove() {
return this.entity.isInLove();
}
public void resetInLove() {
this.entity.resetInLove();
}
public boolean canMateWith(IAnimal animal) {
return this.entity.canMateWith((EntityAnimal) animal.getMCEntity());
}
@Override
public boolean typeOf(int type){
return type == EntityType.ANIMAL?true:super.typeOf(type);
return type == EntityType.ANIMAL || super.typeOf(type);
}
}