From bbfad9303a135b1ab74296655c0c77347042ee0e Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Fri, 6 Mar 2020 19:21:27 -0500 Subject: [PATCH] 1.0.9 Update Particles --- CHANGELOG.md | 3 ++ build.gradle | 51 +++++++++---------- gradle.properties | 2 +- .../sorcerycraft/entity/SpellEntity.java | 20 ++++---- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50feb3d..0e44dc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ### Changelog +**1.0.9** +* Update Particles + **1.0.8** * Update to 20w10a * Add the ```/spell learn```, ```/spell add```, and ```/spell remove``` commands diff --git a/build.gradle b/build.gradle index dfc05ac..71b0a73 100644 --- a/build.gradle +++ b/build.gradle @@ -19,20 +19,19 @@ dependencies { minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" } processResources { - inputs.property "version", version + inputs.property 'version', version from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" - expand "version": version + include 'fabric.mod.json' + expand 'version': version } from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" + exclude 'fabric.mod.json' } } @@ -40,14 +39,14 @@ processResources { // this fixes some edge cases with special characters not displaying correctly // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html tasks.withType(JavaCompile) { - options.encoding = "UTF-8" + options.encoding = 'UTF-8' } // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task // if it is present. // If you remove this task, sources will not be generated. task sourcesJar(type: Jar, dependsOn: classes) { - classifier "sources" + classifier 'sources' from sourceSets.main.allSource } @@ -55,27 +54,27 @@ jar { from "LICENSE" } -curseforge { - if (project.hasProperty('curseforge.api_key')) { +if (project.hasProperty('curseforge.api_key')) { + curseforge { apiKey = project.getProperty('curseforge.api_key') - } - project { - id = project.curseforge_id - changelog = 'A changelog can be found at https://gitea.thebrokenrail.com/TheBrokenRail/SorceryCraft/src/branch/master/CHANGELOG.md' - releaseType = 'release' - addGameVersion project.simple_minecraft_version - addGameVersion 'Fabric' - mainArtifact(remapJar) { - displayName = "SorceryCraft v${version} for ${project.minecraft_version}" + project { + id = project.curseforge_id + changelog = 'A changelog can be found at https://gitea.thebrokenrail.com/TheBrokenRail/SorceryCraft/src/branch/master/CHANGELOG.md' + releaseType = 'release' + addGameVersion project.simple_minecraft_version + addGameVersion 'Fabric' + mainArtifact(remapJar) { + displayName = "SorceryCraft v${version} for ${project.minecraft_version}" + } + afterEvaluate { + uploadTask.dependsOn('remapJar') + } + relations { + requiredDependency 'fabric-api' + } } - afterEvaluate { - uploadTask.dependsOn('remapJar') + options { + forgeGradleIntegration = false } - relations { - requiredDependency 'fabric-api' - } - } - options { - forgeGradleIntegration = false } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index da5c94a..183b5f2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G loader_version = 0.7.8+build.186 # Mod Properties - mod_version = 1.0.8 + mod_version = 1.0.9 maven_group = com.thebrokenrail archives_base_name = sorcerycraft diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/entity/SpellEntity.java b/src/main/java/com/thebrokenrail/sorcerycraft/entity/SpellEntity.java index b88a7f9..a357428 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/entity/SpellEntity.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/entity/SpellEntity.java @@ -16,6 +16,9 @@ import net.minecraft.item.Item; import net.minecraft.network.Packet; import net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket; import net.minecraft.particle.ParticleTypes; +import net.minecraft.server.command.ParticleCommand; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; @@ -23,7 +26,9 @@ import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.HitResult; import net.minecraft.world.World; +import java.util.List; import java.util.Map; +import java.util.Objects; public class SpellEntity extends ThrownItemEntity { public SpellEntity(EntityType entityType, World world) { @@ -74,16 +79,6 @@ public class SpellEntity extends ThrownItemEntity { } } - @Override - @Environment(EnvType.CLIENT) - public void handleStatus(byte status) { - if (status == 0) { - for (int i = 0; i < 12; i++) { - getEntityWorld().addParticle(ParticleTypes.WITCH, getX(), getY(), getZ(), 0.0d, 0.0d, 0.0d); - } - } - } - @Override public void tick() { super.tick(); @@ -110,7 +105,10 @@ public class SpellEntity extends ThrownItemEntity { } } if (!getEntityWorld().isClient()) { - getEntityWorld().sendEntityStatus(this, (byte) 0); + List viewers = Objects.requireNonNull(getServer()).getPlayerManager().getPlayerList(); + for (ServerPlayerEntity viewer : viewers) { + ((ServerWorld) getEntityWorld()).spawnParticles(viewer, ParticleTypes.WITCH, true, getX(), getY(), getZ(), 8, 0.01d, 0.01d, 0.01d, 0.5d); + } } }