1.0.9
All checks were successful
SorceryCraft/pipeline/head This commit looks good

Update Particles
This commit is contained in:
TheBrokenRail 2020-03-06 19:21:27 -05:00
parent abc16c2bbb
commit bbfad9303a
4 changed files with 38 additions and 38 deletions

View File

@ -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

View File

@ -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
}
}

View File

@ -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

View File

@ -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<SpellEntity> 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<ServerPlayerEntity> 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);
}
}
}