Skip to content

Commit

Permalink
Fixed server not loading particle
Browse files Browse the repository at this point in the history
  • Loading branch information
Protoxy22 committed Aug 10, 2021
1 parent 96368c8 commit c560a16
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ minecraft {
}
}

repositories {
maven {
url 'http://maven.dynamx.fr/artifactory/DynamXRepo'
}
}

dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
Expand All @@ -88,6 +94,8 @@ repositories {
}
}



// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ item.prototype.tactical_vest_lv1_tan.name=Tactical Vest Lv.1
item.prototype.tactical_vest_lv2_black.name=Tactical Vest Lv.2
item.prototype.tactical_vest_lv2_green.name=Tactical Vest Lv.2
item.prototype.tactical_vest_lv2_tan.name=Tactical Vest Lv.2
item.prototype.uniform_chest.name=Uniform Chest
item.prototype.uniform_feet.name=Uniform Boots
item.prototype.uniform_legs.name=Uniform Pants
item.prototype.uniform_chest.name=Uniform Chest
item.prototype.vest.name=Vest
item.prototype.12gauge.name=12 Gauge Shell
item.prototype.12sluggauge.name=12 Slug Gauge Shot
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/modularwarfare/client/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.modularwarfare.common.grenades.ItemGrenade;
import com.modularwarfare.common.guns.*;
import com.modularwarfare.common.particle.EntityBloodFX;
import com.modularwarfare.common.particle.ParticleExplosion;
import com.modularwarfare.common.type.BaseType;
import com.modularwarfare.objects.SoundEntry;
import com.modularwarfare.utility.MWResourcePack;
Expand Down Expand Up @@ -974,4 +975,10 @@ public void resetSens() {
ClientRenderHooks.isAiming = false;
}

@Override
public void spawnExplosionParticle(World world, double x, double y, double z) {
final Particle explosionParticle = new ParticleExplosion(world, x, y, z);
Minecraft.getMinecraft().effectRenderer.addEffect(explosionParticle);
}

}
4 changes: 4 additions & 0 deletions src/main/java/com/modularwarfare/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ public <T> T loadModel(String s, String shortName, Class<T> typeClass) {
return null;
}

public void spawnExplosionParticle(World par1World, double par2, double par4, double par6) {
}


public void reloadModels(boolean reloadSkins) {
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.modularwarfare.common.entity.grenades;

import com.modularwarfare.ModularWarfare;
import com.modularwarfare.common.grenades.GrenadeType;
import com.modularwarfare.common.init.ModSounds;
import com.modularwarfare.common.particle.EntityBloodFX;
import com.modularwarfare.common.particle.ParticleExplosion;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.Particle;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.MoverType;
Expand All @@ -20,11 +17,9 @@
import net.minecraft.world.Explosion;
import net.minecraft.world.World;


public class EntityGrenade extends Entity {

private static final DataParameter GRENADE_NAME = EntityDataManager.createKey(EntityGrenade.class, DataSerializers.STRING);
private static final DataParameter GRENADE_TYPE = EntityDataManager.createKey(EntityGrenade.class, DataSerializers.STRING);

public EntityLivingBase thrower;
public GrenadeType grenadeType;
Expand Down Expand Up @@ -110,8 +105,7 @@ public void onUpdate() {
Explosion explosion = new Explosion(this.world, grenadeType.throwerVulnerable ? null : thrower, posX, posY, posZ, grenadeType.explosionPower, false, grenadeType.damageWorld);
explosion.doExplosionA();
explosion.doExplosionB(true);
final Particle explosionParticle = new ParticleExplosion(world, this.posX, this.posY, this.posZ);
Minecraft.getMinecraft().effectRenderer.addEffect(explosionParticle);
ModularWarfare.PROXY.spawnExplosionParticle(this.world, this.posX, this.posY, this.posZ);
}
exploded = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
public class EntitySmokeGrenade extends EntityGrenade {

private static final DataParameter GRENADE_NAME = EntityDataManager.createKey(EntitySmokeGrenade.class, DataSerializers.STRING);
private static final DataParameter GRENADE_TYPE = EntityDataManager.createKey(EntitySmokeGrenade.class, DataSerializers.STRING);

public float smokeTime = 12 * 20;

Expand Down

0 comments on commit c560a16

Please sign in to comment.