Update to 1.21.4
This commit is contained in:
@@ -122,7 +122,7 @@ public class PlasticGun implements ModInitializer {
|
||||
bullets.add(new BulletItem("force_container", 99, 0, 888, false, 0, 1));
|
||||
|
||||
// Guns
|
||||
guns.add(new Gun("forcegun", 0, 4, 5, 10, 10, 888, 5, 0, 4, 0f, 0f, 5f, 10f, 0, 0)); // 0
|
||||
guns.add(new Gun("forcegun", 0, 4, 5, 10, 10, 888, 5, 0, 10, 0f, 0f, 5f, 10f, 0, 0)); // 0
|
||||
guns.add(new Gun("p2022", 0.2, 12, 5, 10, 41, 9, 10, 0, 0, 1f, 4, 0.1f, 0.25f, -1, 1)); // 1.8
|
||||
guns.add(new Gun("colt_1903", 0.3, 10, 5, 8, 38, 32, 10, 0, 0, 1, 3, 0.1f, 0.3f, -1, 1)); // 3
|
||||
guns.add(new Gun("ak_47", 0.2, 4, 5, 30, 45, 762, 0, 0, 0, 1f, 2, 0.2f, 0.4f, -1, 1)); // 9
|
||||
@@ -131,8 +131,8 @@ public class PlasticGun implements ModInitializer {
|
||||
guns.add(new Gun("colt_peacemaker", 0.6, 8, 5, 6, 43, 45, 10, 0, 0, 0.9f, 2, 0.2f, 0.5f, -1, 1)); // 4.8
|
||||
guns.add(new Gun("tokarev_tt_33", 0.7, 10, 5, 8, 45, 762, 10, 0, 0, 1.5f, 2.5f, 0.25f, 0.5f, -1, 1)); // 7
|
||||
guns.add(new Gun("357_revolver", 1, 8, 5, 6, 45, 357, 20, 0, 0, 2, 4, 0.2f, 0.5f, -1, 1)); // 8
|
||||
guns.add(new Gun("awp", 1, 4, 20, 1, 75, 762, 40, 0, 0, 2f, 8, 0.3f, 0.6f, -1, 1)); // 4
|
||||
guns.add(new Gun("rpg9", 2, 4, 20, 1, 10, 999, 20, 20, 0, 3f, 0.5f, 1, 2, -1, 1)); // 8
|
||||
guns.add(new Gun("awp", 1, 4, 20, 1, 75, 762, 40, 0, 0, 4f, 16f, 0.3f, 0.6f, -2, 2)); // 4
|
||||
guns.add(new Gun("rpg9", 2, 4, 20, 1, 10, 999, 20, 10, 0, 3f, 0.5f, 1, 2, -1, 1)); // 8
|
||||
|
||||
|
||||
grenades.add(new GrenadeItem("grenade_m18", 1, 0.1f, 0.2f, 50, false, false, 0, 0, 100, 15, 30)); // 0.02
|
||||
|
@@ -5,6 +5,8 @@ import net.minecraft.component.type.LoreComponent;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.text.Text;
|
||||
import systems.brn.plasticgun.lib.SimpleItem;
|
||||
|
||||
@@ -28,8 +30,8 @@ public class BulletItem extends SimpleItem {
|
||||
Text.translatable("gun.description.explosion_coefficient", explosionPowerCoefficient),
|
||||
Text.translatable("gun.description.repulsion_efficient", repulsionPowerCoefficient),
|
||||
Text.translatable(isIncendiary ? "gun.description.incendiary_yes" : "gun.description.incendiary_no")
|
||||
))
|
||||
)
|
||||
)))
|
||||
.registryKey(RegistryKey.of(RegistryKeys.ITEM, id(path)))
|
||||
,
|
||||
id(path),
|
||||
Items.STICK);
|
||||
|
@@ -1,11 +1,12 @@
|
||||
package systems.brn.plasticgun.defence;
|
||||
|
||||
import dev.emi.trinkets.api.TrinketsApi;
|
||||
import net.minecraft.component.DataComponentTypes;
|
||||
import net.minecraft.component.type.LoreComponent;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.text.Text;
|
||||
import systems.brn.plasticgun.lib.TrinketPolymerItem;
|
||||
import systems.brn.plasticgun.lib.WeaponDamageType;
|
||||
@@ -25,11 +26,10 @@ public class WeaponArmor extends TrinketPolymerItem {
|
||||
Text.translatable("gun.description.armor.grenade", (int) ((1 - grenadeDamageCoefficient) * 100)),
|
||||
Text.translatable("gun.description.armor.fragmentation_grenade", (int) ((1 - fragmentationDamageCoefficient) * 100)),
|
||||
Text.translatable("gun.description.armor.shuriken", (int) ((1 - shurikenDamageCoefficient) * 100))
|
||||
)))
|
||||
))).registryKey(RegistryKey.of(RegistryKeys.ITEM, id(name)))
|
||||
, name)
|
||||
;
|
||||
Registry.register(Registries.ITEM, id(name), this);
|
||||
TrinketsApi.registerTrinket(this, this);
|
||||
resistances.put(WeaponDamageType.BULLET, bulletDamageCoefficient);
|
||||
resistances.put(WeaponDamageType.FRAGMENTATION_GRENADE, fragmentationDamageCoefficient);
|
||||
resistances.put(WeaponDamageType.GRENADE, grenadeDamageCoefficient);
|
||||
|
@@ -8,6 +8,8 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
@@ -57,6 +59,7 @@ public class GrenadeItem extends SimpleItem implements PolymerItem {
|
||||
Text.translatable("gun.description.effect_radius", effectRadius),
|
||||
Text.translatable("gun.description.particle_count", smokeCount)
|
||||
)))
|
||||
.registryKey(RegistryKey.of(RegistryKeys.ITEM, id(path)))
|
||||
.maxDamage(explosionTarget + 1)
|
||||
, id(path), Items.STICK
|
||||
);
|
||||
|
@@ -10,6 +10,8 @@ import net.minecraft.item.*;
|
||||
import net.minecraft.network.packet.s2c.play.PositionFlag;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
@@ -28,6 +30,8 @@ import systems.brn.plasticgun.lib.SimpleItem;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.Math.abs;
|
||||
import static java.lang.Math.max;
|
||||
import static systems.brn.plasticgun.PlasticGun.bullets;
|
||||
import static systems.brn.plasticgun.PlasticGun.itemBulletItemMap;
|
||||
import static systems.brn.plasticgun.lib.GunComponents.*;
|
||||
@@ -73,6 +77,7 @@ public class Gun extends SimpleItem implements PolymerItem {
|
||||
Text.translatable("gun.description.explosion_power", explosionPowerGun),
|
||||
Text.translatable("gun.description.repulsion_power", repulsionPowerGun)
|
||||
)))
|
||||
.registryKey(RegistryKey.of(RegistryKeys.ITEM, id(path)))
|
||||
.maxDamage(clipSize + 1)
|
||||
, id(path), Items.WOODEN_SWORD
|
||||
);
|
||||
@@ -242,7 +247,7 @@ public class Gun extends SimpleItem implements PolymerItem {
|
||||
stack.set(DataComponentTypes.LORE, newLore);
|
||||
}
|
||||
|
||||
public void doRecoil(LivingEntity entity) {
|
||||
public int doRecoil(LivingEntity entity) {
|
||||
if (entity.getEntityWorld() instanceof ServerWorld serverWorld) {
|
||||
Random rng = entity.getWorld().getRandom();
|
||||
// Get the entity's current position and yaw
|
||||
@@ -250,19 +255,22 @@ public class Gun extends SimpleItem implements PolymerItem {
|
||||
float yaw = entity.getYaw();
|
||||
float newPitch = entity.getPitch();
|
||||
Vec3d currentLook = entity.getRotationVector().multiply(-1);
|
||||
newPitch -= verticalRecoilMin + rng.nextFloat() * (verticalRecoilMax - verticalRecoilMin);
|
||||
yaw -= (float) (horizontalRecoilMin + rng.nextFloat() * (horizontalRecoilMax - horizontalRecoilMin));
|
||||
|
||||
|
||||
float yawChange = verticalRecoilMin + rng.nextFloat() * (verticalRecoilMax - verticalRecoilMin);
|
||||
float pitchChange = (float) (horizontalRecoilMin + rng.nextFloat() * (horizontalRecoilMax - horizontalRecoilMin));
|
||||
newPitch -= yawChange;
|
||||
yaw -= pitchChange;
|
||||
entity.teleport(serverWorld, pos.x, pos.y, pos.z, PositionFlag.ROT, yaw, newPitch, true);
|
||||
double velocityRecoil = rng.nextDouble() * (velocityRecoilMax - velocityRecoilMin);
|
||||
if (velocityRecoil > 0) {
|
||||
entity.setVelocity(currentLook.multiply(velocityRecoil));
|
||||
}
|
||||
return (int) ((abs(yawChange) + abs(pitchChange) + abs(velocityRecoil) + max(abs(yawChange), max(abs(pitchChange), abs(velocityRecoil)))) / 4f) * 40;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void shoot(ServerWorld world, LivingEntity user, Hand hand) {
|
||||
public int shoot(ServerWorld world, LivingEntity user, Hand hand) {
|
||||
int stunLen = 0;
|
||||
if (!world.isClient()) {
|
||||
ItemStack stack = user.getStackInHand(hand);
|
||||
int currentReload = stack.getOrDefault(GUN_LOADING_COMPONENT, 1);
|
||||
@@ -280,7 +288,7 @@ public class Gun extends SimpleItem implements PolymerItem {
|
||||
world.playSound(null, user.getX(), user.getY(), user.getZ(), SoundEvents.ENTITY_GENERIC_EXPLODE.value(), SoundCategory.PLAYERS, 0.1f, 1.2f);
|
||||
chamber.decrement(1);
|
||||
stack.set(GUN_COOLDOWN_COMPONENT, cooldownTarget);
|
||||
doRecoil(user);
|
||||
stunLen = doRecoil(user);
|
||||
if (chamber.isEmpty()) {
|
||||
stack.remove(GUN_AMMO_COMPONENT);
|
||||
} else {
|
||||
@@ -291,6 +299,7 @@ public class Gun extends SimpleItem implements PolymerItem {
|
||||
}
|
||||
updateDamage(stack);
|
||||
}
|
||||
return stunLen;
|
||||
}
|
||||
|
||||
private @NotNull BulletEntity getBulletEntity(LivingEntity entity, Hand hand, BulletItem bullet, ItemStack chamber) {
|
||||
|
@@ -157,7 +157,7 @@ public class WeaponShootGoal<T extends HostileEntity & RangedAttackMob> extends
|
||||
ItemStack chamber = gunStack.getOrDefault(GUN_AMMO_COMPONENT, ItemStack.EMPTY).copy();
|
||||
if (!chamber.isEmpty() && currentReload == 1 && currentCooldown == 0 && lockedTicks >= 10) {
|
||||
if (this.actor.getEntityWorld() instanceof ServerWorld serverWorld) {
|
||||
gun.shoot(serverWorld, this.actor, gunHand);
|
||||
this.targetSeeingTicker -= gun.shoot(serverWorld, this.actor, gunHand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,13 +3,15 @@ package systems.brn.plasticgun.lib;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
|
||||
import static systems.brn.plasticgun.lib.Util.id;
|
||||
|
||||
public class CraftingItem extends SimpleItem{
|
||||
|
||||
public CraftingItem(String name) {
|
||||
super(new Settings(), id(name), Items.STICK);
|
||||
super(new Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, id(name))), id(name), Items.STICK);
|
||||
Registry.register(Registries.ITEM, id(name), this);
|
||||
}
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@ import net.minecraft.world.World;
|
||||
import systems.brn.plasticgun.grenades.GrenadeEntity;
|
||||
import systems.brn.plasticgun.grenades.GrenadeItem;
|
||||
import systems.brn.plasticgun.packets.ModDetect;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static systems.brn.plasticgun.PlasticGun.*;
|
||||
@@ -29,7 +30,7 @@ import static systems.brn.plasticgun.lib.GunComponents.*;
|
||||
public class EventHandler {
|
||||
public static ActionResult onItemUse(PlayerEntity playerEntity, World world, Hand hand) {
|
||||
if (playerEntity instanceof ServerPlayerEntity serverPlayerEntity) {
|
||||
if (!world.isClient && !clientsWithMod.contains(serverPlayerEntity)) {
|
||||
if (!world.isClient) {
|
||||
rightClickWithItem(serverPlayerEntity, hand);
|
||||
}
|
||||
}
|
||||
@@ -108,10 +109,8 @@ public class EventHandler {
|
||||
if (!world.isClient) {
|
||||
for (ServerPlayerEntity player : world.getPlayers()) {
|
||||
Hand hand = player.getActiveHand();
|
||||
if (!clientsWithMod.contains(player)) {
|
||||
if (player.handSwinging && player.handSwingTicks == -1) {
|
||||
leftClickWithItem(player, hand);
|
||||
}
|
||||
if (player.handSwinging && player.handSwingTicks == -1) {
|
||||
leftClickWithItem(player, hand);
|
||||
}
|
||||
tickItemUpdate(player);
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@ package systems.brn.plasticgun.lib;
|
||||
|
||||
import eu.pb4.polymer.core.api.item.PolymerItem;
|
||||
import eu.pb4.polymer.core.api.item.SimplePolymerItem;
|
||||
import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.util.Identifier;
|
||||
import xyz.nucleoid.packettweaker.PacketContext;
|
||||
@@ -14,7 +13,7 @@ public abstract class SimpleItem extends SimplePolymerItem implements PolymerIte
|
||||
public SimpleItem(Settings settings, Identifier identifier, Item replacement) {
|
||||
super(settings, replacement);
|
||||
this.identifier = identifier;
|
||||
this.polymerModel = PolymerResourcePackUtils.getBridgedModelId(identifier.withPath("item/" + identifier.getPath()));
|
||||
this.polymerModel = identifier.withPath("item/" + identifier.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,29 +1,23 @@
|
||||
package systems.brn.plasticgun.lib;
|
||||
|
||||
import dev.emi.trinkets.TrinketSlot;
|
||||
import dev.emi.trinkets.api.*;
|
||||
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.event.GameEvent;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import static systems.brn.plasticgun.lib.Util.id;
|
||||
|
||||
public class TrinketPolymerItem extends SimpleItem implements Trinket {
|
||||
public class TrinketPolymerItem extends SimpleItem {
|
||||
|
||||
public TrinketPolymerItem(Item.Settings settings, String name) {
|
||||
super(settings, id(name), Items.STICK);
|
||||
TrinketsApi.registerTrinket(this, this);
|
||||
super(settings.equippable(EquipmentSlot.CHEST), id(name), Items.STICK);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,31 +34,8 @@ public class TrinketPolymerItem extends SimpleItem implements Trinket {
|
||||
}
|
||||
|
||||
public static boolean equipItem(LivingEntity user, ItemStack stack) {
|
||||
Optional<TrinketComponent> optional = TrinketsApi.getTrinketComponent(user);
|
||||
if (optional.isPresent()) {
|
||||
TrinketComponent comp = optional.get();
|
||||
for (Map<String, TrinketInventory> group : comp.getInventory().values()) {
|
||||
for (TrinketInventory inv : group.values()) {
|
||||
for (int i = 0; i < inv.size(); i++) {
|
||||
if (inv.getStack(i).isEmpty()) {
|
||||
SlotReference ref = new SlotReference(inv, i);
|
||||
if (TrinketSlot.canInsert(stack, ref, user)) {
|
||||
ItemStack newStack = stack.copy();
|
||||
inv.setStack(i, newStack);
|
||||
Trinket trinket = TrinketsApi.getTrinket(stack.getItem());
|
||||
RegistryEntry<SoundEvent> soundEvent = trinket.getEquipSound(stack, ref, user);
|
||||
if (!stack.isEmpty() && soundEvent != null) {
|
||||
user.emitGameEvent(GameEvent.EQUIP);
|
||||
user.playSound(soundEvent.value(), 1.0F, 1.0F);
|
||||
}
|
||||
stack.setCount(0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
user.equipStack(EquipmentSlot.CHEST, stack);
|
||||
user.playSound(SoundEvents.ITEM_ARMOR_EQUIP_CHAIN.value());
|
||||
return false;
|
||||
}
|
||||
}
|
@@ -1,14 +1,11 @@
|
||||
package systems.brn.plasticgun.lib;
|
||||
|
||||
import dev.emi.trinkets.api.SlotReference;
|
||||
import dev.emi.trinkets.api.TrinketComponent;
|
||||
import dev.emi.trinkets.api.TrinketInventory;
|
||||
import dev.emi.trinkets.api.TrinketsApi;
|
||||
import eu.pb4.polymer.virtualentity.api.tracker.DisplayTrackedData;
|
||||
import net.fabricmc.fabric.api.loot.v3.LootTableEvents;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.data.DataTracker;
|
||||
import net.minecraft.entity.decoration.DisplayEntity;
|
||||
@@ -27,7 +24,6 @@ import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Pair;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
@@ -165,36 +161,26 @@ public class Util {
|
||||
}
|
||||
|
||||
public static double getFinalDamage(LivingEntity livingEntity, WeaponDamageType damageType, double damage) {
|
||||
Optional<TrinketComponent> trinketComponentTemp = TrinketsApi.getTrinketComponent(livingEntity);
|
||||
if (trinketComponentTemp.isPresent()) {
|
||||
TrinketComponent trinketComponent = trinketComponentTemp.get();
|
||||
for (WeaponArmor weaponArmor : weaponArmors) {
|
||||
if (weaponArmor.resistances.containsKey(damageType)) {
|
||||
for (WeaponArmor weaponArmor : weaponArmors) {
|
||||
if (weaponArmor.resistances.containsKey(damageType)) {
|
||||
|
||||
List<Pair<SlotReference, ItemStack>> vestsComponents = trinketComponent.getEquipped(weaponArmor);
|
||||
if (!vestsComponents.isEmpty()) {
|
||||
Pair<SlotReference, ItemStack> vestComponent = vestsComponents.getFirst();
|
||||
TrinketInventory trinketInventory = vestComponent.getLeft().inventory();
|
||||
int currentDamage = vestComponent.getRight().getDamage();
|
||||
int maxDamage = vestComponent.getRight().getMaxDamage();
|
||||
double reducedDamage = 0;
|
||||
if (currentDamage < maxDamage) {
|
||||
double coefficient = weaponArmor.resistances.get(damageType);
|
||||
reducedDamage = (1 - coefficient) * damage;
|
||||
damage *= coefficient;
|
||||
}
|
||||
|
||||
int nextDamage = currentDamage + (int) reducedDamage;
|
||||
int inventoryIndex = vestComponent.getLeft().index();
|
||||
ItemStack vestStack = trinketInventory.getStack(inventoryIndex);
|
||||
if (nextDamage >= maxDamage) {
|
||||
vestStack.setCount(0);
|
||||
} else {
|
||||
vestStack.setDamage(nextDamage);
|
||||
}
|
||||
trinketInventory.setStack(inventoryIndex, vestStack);
|
||||
}
|
||||
ItemStack chestStack = livingEntity.getEquippedStack(EquipmentSlot.CHEST);
|
||||
int currentDamage = chestStack.getDamage();
|
||||
int maxDamage = chestStack.getMaxDamage();
|
||||
double reducedDamage = 0;
|
||||
if (currentDamage < maxDamage) {
|
||||
double coefficient = weaponArmor.resistances.get(damageType);
|
||||
reducedDamage = (1 - coefficient) * damage;
|
||||
damage *= coefficient;
|
||||
}
|
||||
|
||||
int nextDamage = currentDamage + (int) reducedDamage;
|
||||
if (nextDamage >= maxDamage) {
|
||||
chestStack.setCount(0);
|
||||
} else {
|
||||
chestStack.setDamage(nextDamage);
|
||||
}
|
||||
livingEntity.equipStack(EquipmentSlot.CHEST, chestStack);
|
||||
}
|
||||
}
|
||||
return damage;
|
||||
@@ -304,6 +290,7 @@ public class Util {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void addItemToLootTable(RegistryKey<LootTable> tableId, Item item, Integer weight) {
|
||||
LootTableEvents.MODIFY.register((key, tableBuilder, source, wrapperLookup) -> {
|
||||
if (source.isBuiltin() && tableId.equals(key)) {
|
||||
@@ -311,7 +298,8 @@ public class Util {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static int getAfterWeight(float coeff, int weight) {
|
||||
return (int) Math.ceil(coeff * weight);
|
||||
return (int) Math.ceil(coeff * weight);
|
||||
}
|
||||
}
|
@@ -8,6 +8,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
@@ -35,6 +37,7 @@ public class ShurikenItem extends SimpleItem implements PolymerItem {
|
||||
Text.translatable("gun.description.speed", speed),
|
||||
Text.translatable("gun.description.damage_with_coefficient_max_speed", speed, speed * damage)
|
||||
)))
|
||||
.registryKey(RegistryKey.of(RegistryKeys.ITEM, id(path)))
|
||||
, id(path), Items.WOODEN_PICKAXE
|
||||
);
|
||||
Registry.register(Registries.ITEM, id(path), this);
|
||||
|
Reference in New Issue
Block a user