RPK更换弹鼓,调整音效,重制动画,优化武器切换动画流程
This commit is contained in:
parent
e759939003
commit
c23a46ee00
20 changed files with 6340 additions and 6529 deletions
|
@ -45,11 +45,11 @@ public class RpkItemModel extends GeoModel<RpkItem> {
|
|||
double zp = 0;
|
||||
zp = player.getPersistentData().getDouble("zoomposz");
|
||||
|
||||
gun.setPosX(2.13f * (float) p);
|
||||
gun.setPosX(1.69f * (float) p);
|
||||
|
||||
gun.setPosY(0.545f * (float) p - (float) (0.6f * zp));
|
||||
gun.setPosY(-0.33f * (float) p - (float) (0.6f * zp));
|
||||
|
||||
gun.setPosZ(5.0f * (float) p + (float) (0.5f * zp));
|
||||
gun.setPosZ(3.2f * (float) p + (float) (0.5f * zp));
|
||||
|
||||
gun.setRotZ((float) (0.05f * zp));
|
||||
|
||||
|
@ -63,12 +63,11 @@ public class RpkItemModel extends GeoModel<RpkItem> {
|
|||
|
||||
button.setScaleZ(1f - (0.3f * (float) p));
|
||||
|
||||
gun.setRotZ(-0.087f * (float) p + (float) (0.05f * zp));
|
||||
|
||||
CoreGeoBone holo = getAnimationProcessor().getBone("holo");
|
||||
if (gun.getPosX() > 1.8) {
|
||||
holo.setScaleX(1);
|
||||
holo.setScaleY(1);
|
||||
if (gun.getPosX() > 1.65f) {
|
||||
holo.setScaleX(0.9f);
|
||||
holo.setScaleY(0.9f);
|
||||
hide.setScaleX(0);
|
||||
hide.setScaleY(0);
|
||||
hide.setScaleZ(0);
|
||||
|
|
|
@ -141,7 +141,7 @@ public class LivingEntityEventHandler {
|
|||
if (newStack.getItem() != oldStack.getItem()) {
|
||||
stopGunReloadSound(serverLevel, oldGun);
|
||||
|
||||
newStack.getOrCreateTag().putDouble("drawtime", 0);
|
||||
newStack.getOrCreateTag().putDouble("draw", 1);
|
||||
player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
||||
capability.zoom = false;
|
||||
capability.syncPlayerVariables(player);
|
||||
|
@ -157,7 +157,7 @@ public class LivingEntityEventHandler {
|
|||
!newStack.getOrCreateTag().getUUID("gun_uuid").equals(oldStack.getOrCreateTag().getUUID("gun_uuid"))) {
|
||||
stopGunReloadSound(serverLevel, oldGun);
|
||||
|
||||
newStack.getOrCreateTag().putDouble("drawtime", 0);
|
||||
newStack.getOrCreateTag().putDouble("draw", 1);
|
||||
player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
||||
capability.zoom = false;
|
||||
capability.syncPlayerVariables(player);
|
||||
|
|
|
@ -242,17 +242,17 @@ public class PlayerReloadProcedure {
|
|||
&& !(player.getCooldowns().isOnCooldown(player.getMainHandItem().getItem()))
|
||||
&& tag.getDouble("reloading") == 0
|
||||
&& (entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).rifleAmmo > 0
|
||||
&& tag.getDouble("ammo") < 51) {
|
||||
&& tag.getDouble("ammo") < 76) {
|
||||
if (tag.getDouble("ammo") > 0) {
|
||||
tag.putDouble("reloading", 1);
|
||||
tag.putDouble("emptyreload", 0);
|
||||
tag.putDouble("id", (Mth.nextDouble(RandomSource.create(), 1, 1919810)));
|
||||
tag.putDouble("reloadtime", 41);
|
||||
tag.putDouble("reloadtime", 66);
|
||||
} else if (tag.getDouble("ammo") == 0) {
|
||||
tag.putDouble("reloading", 1);
|
||||
tag.putDouble("emptyreload", 1);
|
||||
tag.putDouble("id", (Mth.nextDouble(RandomSource.create(), 1, 1919810)));
|
||||
tag.putDouble("reloadtime", 57);
|
||||
tag.putDouble("reloadtime", 83);
|
||||
}
|
||||
}
|
||||
if (player.getMainHandItem().getItem() == TargetModItems.SENTINEL.get()
|
||||
|
|
|
@ -19,7 +19,7 @@ public class RpkWuPinZaiBeiBaoZhongShiMeiKeFaShengProcedure {
|
|||
itemstack.getOrCreateTag().putDouble("reloadtime", 0);
|
||||
}
|
||||
if (itemstack.getOrCreateTag().getDouble("reloading") == 1 && itemstack.getOrCreateTag().getDouble("ammo") == 0) {
|
||||
if (itemstack.getOrCreateTag().getDouble("reloadtime") == 57) {
|
||||
if (itemstack.getOrCreateTag().getDouble("reloadtime") == 83) {
|
||||
entity.getPersistentData().putDouble("id", id);
|
||||
if (!entity.level().isClientSide() && entity.getServer() != null) {
|
||||
entity.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, entity.position(), entity.getRotationVector(), entity.level() instanceof ServerLevel ? (ServerLevel) entity.level() : null, 4,
|
||||
|
@ -40,7 +40,7 @@ public class RpkWuPinZaiBeiBaoZhongShiMeiKeFaShengProcedure {
|
|||
GunReload.reload(entity, GunInfo.Type.RIFLE);
|
||||
}
|
||||
} else if (itemstack.getOrCreateTag().getDouble("reloading") == 1 && itemstack.getOrCreateTag().getDouble("ammo") > 0) {
|
||||
if (itemstack.getOrCreateTag().getDouble("reloadtime") == 41) {
|
||||
if (itemstack.getOrCreateTag().getDouble("reloadtime") == 66) {
|
||||
entity.getPersistentData().putDouble("id", id);
|
||||
if (!entity.level().isClientSide() && entity.getServer() != null) {
|
||||
entity.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, entity.position(), entity.getRotationVector(), entity.level() instanceof ServerLevel ? (ServerLevel) entity.level() : null, 4,
|
||||
|
|
|
@ -1,33 +1,37 @@
|
|||
package net.mcreator.target.procedures;
|
||||
|
||||
import net.mcreator.target.init.TargetModItems;
|
||||
import net.mcreator.target.network.TargetModVariables;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
public class WeaponDrawLightProcedure {
|
||||
public static void execute(Entity entity, ItemStack itemstack) {
|
||||
if (entity == null)
|
||||
return;
|
||||
if (itemstack.getOrCreateTag().getDouble("drawtime") == 1) {
|
||||
{
|
||||
boolean _setval = false;
|
||||
entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
||||
capability.zooming = _setval;
|
||||
capability.syncPlayerVariables(entity);
|
||||
});
|
||||
}
|
||||
if (entity instanceof Player _player)
|
||||
_player.getCooldowns().addCooldown(itemstack.getItem(), 13);
|
||||
public static void execute(Entity entity, ItemStack itemStack) {
|
||||
if (entity == null) return;
|
||||
CompoundTag tag = itemStack.getOrCreateTag();
|
||||
Item mainHandItem = (entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getItem();
|
||||
if (tag.getDouble("draw") == 1) {
|
||||
tag.putDouble("draw", 0);
|
||||
tag.putDouble("drawtime", 0);
|
||||
if (entity instanceof Player _player)
|
||||
_player.getCooldowns().addCooldown(itemStack.getItem(), 11);
|
||||
entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
||||
capability.zooming = false;
|
||||
capability.syncPlayerVariables(entity);
|
||||
});
|
||||
}
|
||||
|
||||
if (mainHandItem == itemStack.getItem()) {
|
||||
if (tag.getDouble("drawtime") < 11) {
|
||||
tag.putDouble("drawtime", (tag.getDouble("drawtime") + 1));
|
||||
}
|
||||
if (itemstack.getOrCreateTag().getDouble("fireanim") > 0) {
|
||||
itemstack.getOrCreateTag().putDouble("fireanim", (itemstack.getOrCreateTag().getDouble("fireanim") - 1));
|
||||
}
|
||||
if ((entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getItem() == itemstack.getItem()) {
|
||||
if (itemstack.getOrCreateTag().getDouble("drawtime") < 11) {
|
||||
itemstack.getOrCreateTag().putDouble("drawtime", (itemstack.getOrCreateTag().getDouble("drawtime") + 1));
|
||||
}
|
||||
}
|
||||
if (tag.getDouble("fireanim") > 0) {
|
||||
tag.putDouble("fireanim", (tag.getDouble("fireanim") - 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,9 @@ public class WeaponDrawProcedure {
|
|||
if (entity == null) return;
|
||||
CompoundTag tag = itemStack.getOrCreateTag();
|
||||
Item mainHandItem = (entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getItem();
|
||||
|
||||
if (tag.getDouble("drawtime") == 1) {
|
||||
if (tag.getDouble("draw") == 1) {
|
||||
tag.putDouble("draw", 0);
|
||||
tag.putDouble("drawtime", 0);
|
||||
entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
||||
capability.zooming = false;
|
||||
capability.syncPlayerVariables(entity);
|
||||
|
@ -29,6 +30,7 @@ public class WeaponDrawProcedure {
|
|||
tag.putDouble("gj", 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (mainHandItem == itemStack.getItem()) {
|
||||
if (tag.getDouble("drawtime") < 16) {
|
||||
tag.putDouble("drawtime", (tag.getDouble("drawtime") + 1));
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package net.mcreator.target.procedures;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
|
@ -9,30 +11,31 @@ import net.mcreator.target.network.TargetModVariables;
|
|||
import net.mcreator.target.init.TargetModItems;
|
||||
|
||||
public class WeapondrawhaveyProcedure {
|
||||
public static void execute(Entity entity, ItemStack itemstack) {
|
||||
if (entity == null)
|
||||
return;
|
||||
if (itemstack.getOrCreateTag().getDouble("drawtime") == 1) {
|
||||
{
|
||||
boolean _setval = false;
|
||||
entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
||||
capability.zooming = _setval;
|
||||
capability.syncPlayerVariables(entity);
|
||||
});
|
||||
}
|
||||
public static void execute(Entity entity, ItemStack itemStack) {
|
||||
if (entity == null) return;
|
||||
CompoundTag tag = itemStack.getOrCreateTag();
|
||||
Item mainHandItem = (entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getItem();
|
||||
if (tag.getDouble("draw") == 1) {
|
||||
tag.putDouble("draw", 0);
|
||||
tag.putDouble("drawtime", 0);
|
||||
entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
||||
capability.zooming = false;
|
||||
capability.syncPlayerVariables(entity);
|
||||
});
|
||||
if (entity instanceof Player _player)
|
||||
_player.getCooldowns().addCooldown(itemstack.getItem(), 32);
|
||||
if (itemstack.getItem() == TargetModItems.M_60.get() && itemstack.getOrCreateTag().getDouble("ammo") <= 5) {
|
||||
itemstack.getOrCreateTag().putDouble("empty", 1);
|
||||
_player.getCooldowns().addCooldown(itemStack.getItem(), 29);
|
||||
if (itemStack.getItem() == TargetModItems.M_60.get() && tag.getDouble("ammo") <= 5) {
|
||||
tag.putDouble("empty", 1);
|
||||
}
|
||||
}
|
||||
if ((entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getItem() == itemstack.getItem()) {
|
||||
if (itemstack.getOrCreateTag().getDouble("drawtime") < 29) {
|
||||
itemstack.getOrCreateTag().putDouble("drawtime", (itemstack.getOrCreateTag().getDouble("drawtime") + 1));
|
||||
|
||||
if (mainHandItem == itemStack.getItem()) {
|
||||
if (tag.getDouble("drawtime") < 29) {
|
||||
tag.putDouble("drawtime", (tag.getDouble("drawtime") + 1));
|
||||
}
|
||||
}
|
||||
if (itemstack.getOrCreateTag().getDouble("fireanim") > 0) {
|
||||
itemstack.getOrCreateTag().putDouble("fireanim", (itemstack.getOrCreateTag().getDouble("fireanim") - 1));
|
||||
if (tag.getDouble("fireanim") > 0) {
|
||||
tag.putDouble("fireanim", (tag.getDouble("fireanim") - 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -31,15 +31,10 @@
|
|||
]
|
||||
},
|
||||
"firstperson_righthand": {
|
||||
"rotation": [
|
||||
0,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"translation": [
|
||||
1.75,
|
||||
-12.75,
|
||||
-18.25
|
||||
-0.25,
|
||||
-10,
|
||||
-14.25
|
||||
],
|
||||
"scale": [
|
||||
4,
|
||||
|
@ -52,6 +47,11 @@
|
|||
-1,
|
||||
3,
|
||||
2.5
|
||||
],
|
||||
"scale": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"ground": {
|
||||
|
@ -68,19 +68,19 @@
|
|||
},
|
||||
"gui": {
|
||||
"rotation": [
|
||||
30,
|
||||
-145,
|
||||
0
|
||||
165.69,
|
||||
-39.63,
|
||||
178.66
|
||||
],
|
||||
"translation": [
|
||||
0,
|
||||
0.25,
|
||||
-2.75,
|
||||
-1,
|
||||
0
|
||||
],
|
||||
"scale": [
|
||||
3.5,
|
||||
3.5,
|
||||
3.5
|
||||
0.6,
|
||||
0.6,
|
||||
0.6
|
||||
]
|
||||
},
|
||||
"fixed": {
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Binary file not shown.
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 42 KiB |
Binary file not shown.
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 7.8 KiB |
|
@ -8,7 +8,7 @@
|
|||
"damage": 8.75,
|
||||
"headshot": 2,
|
||||
"velocity": 35,
|
||||
"mag": 50,
|
||||
"mag": 75,
|
||||
"projectileamount": 1,
|
||||
"fire_interval": 2
|
||||
}
|
Loading…
Add table
Reference in a new issue