优化粒子效果显示方法
This commit is contained in:
parent
6fe095c170
commit
5edcfe5399
1 changed files with 16 additions and 17 deletions
|
@ -2,12 +2,15 @@ package net.mcreator.superbwarfare.network.message;
|
||||||
|
|
||||||
import net.mcreator.superbwarfare.entity.*;
|
import net.mcreator.superbwarfare.entity.*;
|
||||||
import net.mcreator.superbwarfare.event.GunEventHandler;
|
import net.mcreator.superbwarfare.event.GunEventHandler;
|
||||||
import net.mcreator.superbwarfare.init.*;
|
import net.mcreator.superbwarfare.init.ModEnchantments;
|
||||||
|
import net.mcreator.superbwarfare.init.ModItems;
|
||||||
|
import net.mcreator.superbwarfare.init.ModSounds;
|
||||||
|
import net.mcreator.superbwarfare.init.ModTags;
|
||||||
import net.mcreator.superbwarfare.network.ModVariables;
|
import net.mcreator.superbwarfare.network.ModVariables;
|
||||||
import net.mcreator.superbwarfare.tools.ItemNBTTool;
|
import net.mcreator.superbwarfare.tools.ItemNBTTool;
|
||||||
|
import net.mcreator.superbwarfare.tools.ParticleTool;
|
||||||
import net.mcreator.superbwarfare.tools.SoundTool;
|
import net.mcreator.superbwarfare.tools.SoundTool;
|
||||||
import net.minecraft.commands.CommandSource;
|
import net.minecraft.core.particles.ParticleTypes;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.FriendlyByteBuf;
|
import net.minecraft.network.FriendlyByteBuf;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
@ -283,13 +286,11 @@ public class FireMessage {
|
||||||
level.addFreshEntity(gunGrenadeEntity);
|
level.addFreshEntity(gunGrenadeEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 移除指令
|
if (player.level() instanceof ServerLevel serverLevel) {
|
||||||
if (!player.level().isClientSide() && player.getServer() != null) {
|
ParticleTool.sendParticle(serverLevel, ParticleTypes.CLOUD, player.getX() + 1.8 * player.getLookAngle().x,
|
||||||
player.getServer().getCommands().performPrefixedCommand(
|
player.getY() + player.getBbHeight() - 0.1 + 1.8 * player.getLookAngle().y,
|
||||||
new CommandSourceStack(CommandSource.NULL, player.position(), player.getRotationVector(), (ServerLevel) player.level(), 4, player.getName().getString(), player.getDisplayName(),
|
player.getZ() + 1.8 * player.getLookAngle().z,
|
||||||
player.getServer(), player),
|
4, 0.1, 0.1, 0.1, 0.002, true);
|
||||||
("particle minecraft:cloud" + (" " + (player.getX() + 1.8 * player.getLookAngle().x)) + (" " + (player.getY() + player.getBbHeight() - 0.1 + 1.8 * player.getLookAngle().y))
|
|
||||||
+ (" " + (player.getZ() + 1.8 * player.getLookAngle().z)) + " 0.1 0.1 0.1 0.002 4 force @s"));
|
|
||||||
}
|
}
|
||||||
player.getCooldowns().addCooldown(stack.getItem(), 2);
|
player.getCooldowns().addCooldown(stack.getItem(), 2);
|
||||||
|
|
||||||
|
@ -326,13 +327,11 @@ public class FireMessage {
|
||||||
level.addFreshEntity(rocketEntity);
|
level.addFreshEntity(rocketEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 移除指令
|
if (player.level() instanceof ServerLevel serverLevel) {
|
||||||
if (player.getServer() != null) {
|
ParticleTool.sendParticle(serverLevel, ParticleTypes.CLOUD, player.getX() + 1.8 * player.getLookAngle().x,
|
||||||
player.getServer().getCommands().performPrefixedCommand(
|
player.getY() + player.getBbHeight() - 0.1 + 1.8 * player.getLookAngle().y,
|
||||||
new CommandSourceStack(CommandSource.NULL, player.position(), player.getRotationVector(), (ServerLevel) player.level(), 4, player.getName().getString(), player.getDisplayName(),
|
player.getZ() + 1.8 * player.getLookAngle().z,
|
||||||
player.level().getServer(), player),
|
30, 0.4, 0.4, 0.4, 0.005, true);
|
||||||
("particle minecraft:cloud" + (" " + (player.getX() + 1.8 * player.getLookAngle().x)) + (" " + (player.getY() + player.getBbHeight() - 0.1 + 1.8 * player.getLookAngle().y))
|
|
||||||
+ (" " + (player.getZ() + 1.8 * player.getLookAngle().z)) + " 0.4 0.4 0.4 0.005 30 force @s"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag.getInt("ammo") == 1) {
|
if (tag.getInt("ammo") == 1) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue