Skip to content

Commit

Permalink
fix #26
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsterner committed Mar 26, 2024
1 parent 0160a86 commit 5929817
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'maven-publish'
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.15.3
# Mod Properties
mod_version=1.20.1-3
mod_version=1.20.1-4
maven_group=dev.mrsterner.besmirchment
archives_base_name=besmirchment
# Dependencies
# check this on https://modmuss50.me/fabric.html
bewitchment_version=5017964
bewitchment_version=5205373

cardinal_components_version=5.2.2
fabric_permissions_api_version=0.1-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
Expand Down Expand Up @@ -110,8 +111,10 @@ public void onInitialize() {
transformationComponent.getTransformation().onRemoved(playerEntity);
transformationComponent.setTransformation(BSMTransformations.WEREPYRE);
transformationComponent.getTransformation().onAdded(playerEntity);
PlayerLookup.tracking(playerEntity).forEach(foundPlayer -> SpawnSmokeParticlesPacket.send(foundPlayer, playerEntity));
SpawnSmokeParticlesPacket.send(playerEntity, playerEntity);
if (playerEntity instanceof ServerPlayerEntity serverPlayerEntity) {
PlayerLookup.tracking(playerEntity).forEach(foundPlayer -> SpawnSmokeParticlesPacket.send(foundPlayer, playerEntity));
SpawnSmokeParticlesPacket.send(serverPlayerEntity, playerEntity);
}
playerEntity.getWorld().playSound(null, playerEntity.getBlockPos(), BWSoundEvents.ENTITY_GENERIC_CURSE, playerEntity.getSoundCategory(), 1, 1);
int variant = -1;
if (source.getSource() instanceof WerepyreEntity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ protected ActionResult interactMob(PlayerEntity player, Hand hand) {
if (!player.isCreative()) {
stack.decrement(1);
}
PlayerLookup.tracking(player).forEach(foundPlayer -> SpawnSmokeParticlesPacket.send(foundPlayer, player));
SpawnSmokeParticlesPacket.send(player, player);
if (player instanceof ServerPlayerEntity serverPlayerEntity) {
PlayerLookup.tracking(player).forEach(foundPlayer -> SpawnSmokeParticlesPacket.send(foundPlayer, player));
SpawnSmokeParticlesPacket.send(serverPlayerEntity, player);
}
getWorld().playSound(null, getBlockPos(), BWSoundEvents.ENTITY_GENERIC_PLING, player.getSoundCategory(), 1, 1);
if (BWComponents.TRANSFORMATION_COMPONENT.get(player).isAlternateForm()) {
TransformationAbilityPacket.useAbility(player, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import dev.mrsterner.besmirchment.common.entity.interfaces.VillagerWerepyreAccessor;
import moriyashiine.bewitchment.api.BewitchmentAPI;
import moriyashiine.bewitchment.client.packet.SpawnSmokeParticlesPacket;
import moriyashiine.bewitchment.common.entity.living.WerewolfEntity;
import moriyashiine.bewitchment.common.entity.living.util.BWHostileEntity;
import moriyashiine.bewitchment.common.registry.BWComponents;
import moriyashiine.bewitchment.common.registry.BWSoundEvents;
Expand Down Expand Up @@ -51,7 +52,9 @@ public void tick() {
if (storedVillager != null && age % 20 == 0 && (getWorld().isDay() || BewitchmentAPI.getMoonPhase(getWorld()) != 0)) {
VillagerEntity entity = EntityType.VILLAGER.create(getWorld());
if (entity instanceof VillagerWerepyreAccessor) {
PlayerLookup.tracking(this).forEach(player -> SpawnSmokeParticlesPacket.send(player, this));
if (!getWorld().isClient) {
PlayerLookup.tracking(this).forEach(player -> SpawnSmokeParticlesPacket.send(player, this));
}
getWorld().playSound(null, getX(), getY(), getZ(), BWSoundEvents.ENTITY_GENERIC_TRANSFORM, getSoundCategory(), getSoundVolume(), getSoundPitch());
entity.readNbt(storedVillager);
entity.updatePositionAndAngles(getX(), getY(), getZ(), random.nextFloat() * 360, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import net.minecraft.nbt.NbtCompound;
import net.minecraft.particle.DustParticleEffect;
import net.minecraft.registry.tag.DamageTypeTags;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.Hand;
import net.minecraft.util.Pair;
Expand Down Expand Up @@ -205,8 +206,11 @@ private void tryUseTotem(DamageSource source, CallbackInfoReturnable<Boolean> ci
transformationComponent.getTransformation().onRemoved(playerEntity);
transformationComponent.setTransformation(BSMTransformations.WEREPYRE);
transformationComponent.getTransformation().onAdded(playerEntity);
PlayerLookup.tracking(playerEntity).forEach(foundPlayer -> SpawnSmokeParticlesPacket.send(foundPlayer, playerEntity));
SpawnSmokeParticlesPacket.send(playerEntity, playerEntity);
if (playerEntity instanceof ServerPlayerEntity serverPlayerEntity) {
PlayerLookup.tracking(playerEntity).forEach(foundPlayer -> SpawnSmokeParticlesPacket.send(foundPlayer, playerEntity));
SpawnSmokeParticlesPacket.send(serverPlayerEntity, playerEntity);
}

playerEntity.getWorld().playSound(null, playerEntity.getBlockPos(), BWSoundEvents.ENTITY_GENERIC_CURSE, playerEntity.getSoundCategory(), 1, 1);
int variant = -1;
if (source.getSource() instanceof WerepyreEntity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.entity.EntityType;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand Down Expand Up @@ -59,8 +60,10 @@ private static void useAbility(PlayerEntity player, boolean forced, CallbackInfo
boolean isInAlternateForm = BWComponents.TRANSFORMATION_COMPONENT.get(player).isAlternateForm();
ScaleData width = BWScaleTypes.MODIFY_WIDTH_TYPE.getScaleData(player);
ScaleData height = BWScaleTypes.MODIFY_HEIGHT_TYPE.getScaleData(player);
PlayerLookup.tracking(player).forEach((foundPlayer) -> SpawnSmokeParticlesPacket.send(foundPlayer, player));
SpawnSmokeParticlesPacket.send(player, player);
if (player instanceof ServerPlayerEntity serverPlayerEntity) {
PlayerLookup.tracking(player).forEach(foundPlayer -> SpawnSmokeParticlesPacket.send(foundPlayer, player));
SpawnSmokeParticlesPacket.send(serverPlayerEntity, player);
}
world.playSound(null, player.getBlockPos(), BWSoundEvents.ENTITY_GENERIC_TRANSFORM, player.getSoundCategory(), 1.0F, 1.0F);
BWComponents.TRANSFORMATION_COMPONENT.get(player).setAlternateForm(!isInAlternateForm);
if (isInAlternateForm) {
Expand Down

0 comments on commit 5929817

Please sign in to comment.