diff --git a/gradle.properties b/gradle.properties index 86e65ed02..53c0998d6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx3G # Mod Information mod_id=mocreatures -mod_version=12.4.4 +mod_version=12.4.5 maven_group=drzhark.mocreatures archives_base_name=DrZharks-MoCreatures-Extended # License Plugin diff --git a/src/main/java/drzhark/mocreatures/MoCConstants.java b/src/main/java/drzhark/mocreatures/MoCConstants.java index 0d5fffb84..99b9ff975 100644 --- a/src/main/java/drzhark/mocreatures/MoCConstants.java +++ b/src/main/java/drzhark/mocreatures/MoCConstants.java @@ -8,7 +8,7 @@ public class MoCConstants { public static final String MOD_ID = "mocreatures"; public static final String MOD_PREFIX = MOD_ID + ":"; public static final String MOD_NAME = "DrZhark's Mo'Creatures Extended"; - public static final String MOD_VERSION = "12.4.4"; + public static final String MOD_VERSION = "12.4.5"; public static final String MOD_ACCEPTED_VERSIONS = "[" + MOD_VERSION + "]"; public static final String MOD_DEPENDENCIES = "after:crossbow;after:futuremc;after:thaumcraft;after:thermalexpansion;after:traverse"; public static final Integer DATAFIXER_VERSION = 1; diff --git a/src/main/java/drzhark/mocreatures/MoCTools.java b/src/main/java/drzhark/mocreatures/MoCTools.java index 2aed95e74..4483adfcd 100644 --- a/src/main/java/drzhark/mocreatures/MoCTools.java +++ b/src/main/java/drzhark/mocreatures/MoCTools.java @@ -1225,10 +1225,10 @@ public static void dismountPassengerFromEntity(Entity passenger, Entity entity, if (!force && (passenger == null || entity == null || passenger.getRidingEntity() == null)) { return; } - if (force || (passenger instanceof EntityLivingBase && entity.isSneaking())) { - System.out.println("Forcing dismount from " + entity + " for passenger " + passenger); - passenger.dismountRidingEntity(); + if (force || entity.isSneaking() || passenger.isInWater()) { + if (force) MoCreatures.LOGGER.info("Forcing dismount from " + entity + " for passenger " + passenger); passenger.setPositionAndUpdate(entity.posX, entity.posY + 1D, entity.posZ); + passenger.dismountRidingEntity(); MoCTools.playCustomSound(passenger, SoundEvents.ENTITY_CHICKEN_EGG); if (entity instanceof EntityPlayer) { NBTTagCompound tag = entity.getEntityData(); @@ -1240,12 +1240,6 @@ public static void dismountPassengerFromEntity(Entity passenger, Entity entity, } } - public static void dismountSneakingPlayer(Entity entity) { - // Entity is riding the player. - if (!entity.isRiding()) return; - dismountPassengerFromEntity(entity, entity.getRidingEntity(), false); - } - public static boolean isInsideOfMaterial(Material material, Entity entity) { double d = entity.posY + entity.getEyeHeight(); int i = MathHelper.floor(entity.posX); diff --git a/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java b/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java index 6c98b13cf..2f42140b7 100644 --- a/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java +++ b/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java @@ -323,7 +323,7 @@ public void onLivingUpdate() { this.randomAttributesUpdated = true; } - if (this.canRidePlayer() && this.isRiding()) MoCTools.dismountSneakingPlayer(this); + if (this.canRidePlayer() && this.isRiding()) MoCTools.dismountPassengerFromEntity(this, this.getRidingEntity(), false); super.onLivingUpdate(); } diff --git a/src/main/java/drzhark/mocreatures/entity/item/MoCEntityKittyBed.java b/src/main/java/drzhark/mocreatures/entity/item/MoCEntityKittyBed.java index 37f0a173f..75e935ef3 100644 --- a/src/main/java/drzhark/mocreatures/entity/item/MoCEntityKittyBed.java +++ b/src/main/java/drzhark/mocreatures/entity/item/MoCEntityKittyBed.java @@ -201,7 +201,7 @@ public void onUpdate() { } } } - if (this.isRiding()) MoCTools.dismountSneakingPlayer(this); + if (this.isRiding()) MoCTools.dismountPassengerFromEntity(this, this.getRidingEntity(), false); } @Override diff --git a/src/main/java/drzhark/mocreatures/entity/item/MoCEntityLitterBox.java b/src/main/java/drzhark/mocreatures/entity/item/MoCEntityLitterBox.java index d04198367..8c97bd3ca 100644 --- a/src/main/java/drzhark/mocreatures/entity/item/MoCEntityLitterBox.java +++ b/src/main/java/drzhark/mocreatures/entity/item/MoCEntityLitterBox.java @@ -175,7 +175,7 @@ public void onUpdate() { setUsedLitter(false); this.litterTime = 0; } - if (this.isRiding()) MoCTools.dismountSneakingPlayer(this); + if (this.isRiding()) MoCTools.dismountPassengerFromEntity(this, this.getRidingEntity(), false); } @Override diff --git a/src/main/java/drzhark/mocreatures/entity/neutral/MoCEntityKitty.java b/src/main/java/drzhark/mocreatures/entity/neutral/MoCEntityKitty.java index 7410a1a81..79730017e 100644 --- a/src/main/java/drzhark/mocreatures/entity/neutral/MoCEntityKitty.java +++ b/src/main/java/drzhark/mocreatures/entity/neutral/MoCEntityKitty.java @@ -1052,7 +1052,7 @@ else if (!world.getBlockState(getPosition()).causesSuffocation()) { super.onLivingUpdate(); } // Dismount player on both sides to prevent desyncs - if (this.isRiding()) MoCTools.dismountSneakingPlayer(this); + if (this.isRiding()) MoCTools.dismountPassengerFromEntity(this, this.getRidingEntity(), false); } public boolean onMaBack() { diff --git a/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityFilchLizard.java b/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityFilchLizard.java index fe4461692..515e33dc2 100644 --- a/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityFilchLizard.java +++ b/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityFilchLizard.java @@ -201,12 +201,12 @@ public ItemStack[] getCustomLootItems(Entity entityIn, ResourceLocation resource @Override protected SoundEvent getDeathSound() { - return MoCSoundEvents.ENTITY_FILCH_LIZARD_DEATH; + return MoCreatures.proxy.legacyFilchLizardSounds ? SoundEvents.ENTITY_GENERIC_DEATH : MoCSoundEvents.ENTITY_FILCH_LIZARD_DEATH; } @Override protected SoundEvent getHurtSound(DamageSource source) { - return MoCSoundEvents.ENTITY_FILCH_LIZARD_HISS; + return MoCreatures.proxy.legacyFilchLizardSounds ? SoundEvents.ENTITY_GENERIC_HURT : MoCSoundEvents.ENTITY_FILCH_LIZARD_HISS; } // Sneaky... diff --git a/src/main/java/drzhark/mocreatures/entity/tameable/MoCEntityTameableAmbient.java b/src/main/java/drzhark/mocreatures/entity/tameable/MoCEntityTameableAmbient.java index ff78f914c..7a261859f 100644 --- a/src/main/java/drzhark/mocreatures/entity/tameable/MoCEntityTameableAmbient.java +++ b/src/main/java/drzhark/mocreatures/entity/tameable/MoCEntityTameableAmbient.java @@ -502,20 +502,6 @@ public void setGestationTime(int time) { gestationtime = time; } - @Override - public boolean startRidingPlayer(EntityPlayer player) { - if (MoCTools.getEntityRidingPlayer(player) != null) { - return false; // Something is already riding this player. - } - boolean ret = super.startRiding(player); - if (ret) { - NBTTagCompound tag = player.getEntityData(); - tag.setUniqueId("MOCEntity_Riding_Player", this.getUniqueID()); - return true; - } - return false; - } - @Override public boolean canRidePlayer() { return false; diff --git a/src/main/java/drzhark/mocreatures/entity/tameable/MoCEntityTameableAquatic.java b/src/main/java/drzhark/mocreatures/entity/tameable/MoCEntityTameableAquatic.java index 6695817f8..1b9df1e40 100644 --- a/src/main/java/drzhark/mocreatures/entity/tameable/MoCEntityTameableAquatic.java +++ b/src/main/java/drzhark/mocreatures/entity/tameable/MoCEntityTameableAquatic.java @@ -505,20 +505,6 @@ public int getGestationTime() { return gestationtime; } - @Override - public boolean startRidingPlayer(EntityPlayer player) { - if (MoCTools.getEntityRidingPlayer(player) != null) { - return false; // Something is already riding this player. - } - boolean ret = super.startRiding(player); - if (ret) { - NBTTagCompound tag = player.getEntityData(); - tag.setUniqueId("MOCEntity_Riding_Player", this.getUniqueID()); - return true; - } - return false; - } - @Override public boolean canRidePlayer() { return false; diff --git a/src/main/java/drzhark/mocreatures/proxy/MoCProxy.java b/src/main/java/drzhark/mocreatures/proxy/MoCProxy.java index 7e3abeb27..5786b2636 100644 --- a/src/main/java/drzhark/mocreatures/proxy/MoCProxy.java +++ b/src/main/java/drzhark/mocreatures/proxy/MoCProxy.java @@ -66,6 +66,7 @@ public class MoCProxy implements IGuiHandler { public boolean legacyBigGolemSounds; public boolean legacyBunnyTextures; public boolean legacyDuckSounds; + public boolean legacyFilchLizardSounds; public boolean legacyMiniGolemSounds; public boolean legacyRatDeathSound; public boolean legacySharkModel; @@ -288,6 +289,7 @@ public void readGlobalConfigValues() { this.legacyBigGolemSounds = this.mocSettingsConfig.get(CATEGORY_MOC_CREATURE_GENERAL_SETTINGS, "LegacyBigGolemSounds", false, "Enables legacy big golem sounds.").getBoolean(false); this.legacyBunnyTextures = this.mocSettingsConfig.get(CATEGORY_MOC_CREATURE_GENERAL_SETTINGS, "LegacyBunnyTextures", false, "Enables simple bunny textures like in legacy versions.").getBoolean(false); this.legacyDuckSounds = this.mocSettingsConfig.get(CATEGORY_MOC_CREATURE_GENERAL_SETTINGS, "LegacyDuckSounds", false, "Enables legacy duck sounds.").getBoolean(false); + this.legacyFilchLizardSounds = this.mocSettingsConfig.get(CATEGORY_MOC_CREATURE_GENERAL_SETTINGS, "LegacyFilchLizardSounds", false, "Enables generic hurt sounds rather than hissing for the filch lizards.").getBoolean(false); this.legacyMiniGolemSounds = this.mocSettingsConfig.get(CATEGORY_MOC_CREATURE_GENERAL_SETTINGS, "LegacyMiniGolemSounds", false, "Enables legacy mini golem sounds.").getBoolean(false); this.legacyRatDeathSound = this.mocSettingsConfig.get(CATEGORY_MOC_CREATURE_GENERAL_SETTINGS, "LegacyRatDeathSound", false, "Enables legacy rat death sound.").getBoolean(false); this.legacySharkModel = this.mocSettingsConfig.get(CATEGORY_MOC_CREATURE_GENERAL_SETTINGS, "LegacySharkModel", false, "Enables the simple shark model and texture like in legacy versions.").getBoolean(false);