Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.12.2' into 150-bunny-water-des…
Browse files Browse the repository at this point in the history
…ync-issue
  • Loading branch information
demonlexe committed Aug 23, 2024
2 parents 59223d4 + b306133 commit 48e926c
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 45 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/drzhark/mocreatures/MoCConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 3 additions & 9 deletions src/main/java/drzhark/mocreatures/MoCTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void onUpdate() {
}
}
}
if (this.isRiding()) MoCTools.dismountSneakingPlayer(this);
if (this.isRiding()) MoCTools.dismountPassengerFromEntity(this, this.getRidingEntity(), false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/drzhark/mocreatures/proxy/MoCProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 48e926c

Please sign in to comment.