调整武器初始化方法
This commit is contained in:
parent
9274d3e291
commit
9c6ec28882
9 changed files with 142 additions and 50 deletions
|
@ -1,9 +1,7 @@
|
||||||
package net.mcreator.target.init;
|
package net.mcreator.target.init;
|
||||||
|
|
||||||
import net.mcreator.target.TargetMod;
|
import net.mcreator.target.TargetMod;
|
||||||
import net.mcreator.target.item.gun.Abekiri;
|
import net.mcreator.target.item.gun.*;
|
||||||
import net.mcreator.target.item.gun.Trachelium;
|
|
||||||
import net.mcreator.target.item.gun.VectorItem;
|
|
||||||
import net.minecraft.core.registries.Registries;
|
import net.minecraft.core.registries.Registries;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.item.CreativeModeTab;
|
import net.minecraft.world.item.CreativeModeTab;
|
||||||
|
@ -25,10 +23,12 @@ public class TargetModTabs {
|
||||||
.icon(() -> new ItemStack(TargetModItems.TASER.get()))
|
.icon(() -> new ItemStack(TargetModItems.TASER.get()))
|
||||||
.displayItems(
|
.displayItems(
|
||||||
(param, output) -> {
|
(param, output) -> {
|
||||||
output.accept(TargetModItems.TASER.get());
|
output.accept(Taser.getGunInstance());
|
||||||
output.accept(Abekiri.getGunInstance());
|
output.accept(Abekiri.getGunInstance());
|
||||||
output.accept(Trachelium.getGunInstance());
|
output.accept(Trachelium.getGunInstance());
|
||||||
output.accept(VectorItem.getGunInstance());
|
output.accept(VectorItem.getGunInstance());
|
||||||
|
|
||||||
|
output.accept(Aa12Item.getGunInstance());
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.build());
|
.build());
|
||||||
|
|
|
@ -4,7 +4,9 @@ import com.google.common.collect.HashMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
import net.mcreator.target.TargetMod;
|
import net.mcreator.target.TargetMod;
|
||||||
import net.mcreator.target.client.renderer.item.Aa12ItemRenderer;
|
import net.mcreator.target.client.renderer.item.Aa12ItemRenderer;
|
||||||
|
import net.mcreator.target.init.TargetModItems;
|
||||||
import net.mcreator.target.procedures.Aa12WuPinZaiBeiBaoZhongShiMeiKeFaShengProcedure;
|
import net.mcreator.target.procedures.Aa12WuPinZaiBeiBaoZhongShiMeiKeFaShengProcedure;
|
||||||
|
import net.mcreator.target.tools.ItemNBTTool;
|
||||||
import net.mcreator.target.tools.RarityTool;
|
import net.mcreator.target.tools.RarityTool;
|
||||||
import net.mcreator.target.tools.TooltipTool;
|
import net.mcreator.target.tools.TooltipTool;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -168,5 +170,35 @@ public class Aa12Item extends GunItem implements GeoItem {
|
||||||
public void inventoryTick(ItemStack itemstack, Level world, Entity entity, int slot, boolean selected) {
|
public void inventoryTick(ItemStack itemstack, Level world, Entity entity, int slot, boolean selected) {
|
||||||
super.inventoryTick(itemstack, world, entity, slot, selected);
|
super.inventoryTick(itemstack, world, entity, slot, selected);
|
||||||
Aa12WuPinZaiBeiBaoZhongShiMeiKeFaShengProcedure.execute(entity, itemstack);
|
Aa12WuPinZaiBeiBaoZhongShiMeiKeFaShengProcedure.execute(entity, itemstack);
|
||||||
|
|
||||||
|
if (!ItemNBTTool.getBoolean(itemstack, "init", false)) {
|
||||||
|
initGun(itemstack, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemStack getGunInstance() {
|
||||||
|
ItemStack stack = new ItemStack(TargetModItems.AA_12.get());
|
||||||
|
|
||||||
|
initGun(stack, true);
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initGun(ItemStack stack, boolean isCreative) {
|
||||||
|
stack.getOrCreateTag().putDouble("zoomspeed", 0.95);
|
||||||
|
stack.getOrCreateTag().putDouble("zoom", 1.25);
|
||||||
|
stack.getOrCreateTag().putDouble("autorifle", 1);
|
||||||
|
stack.getOrCreateTag().putDouble("dev", 3.5);
|
||||||
|
stack.getOrCreateTag().putDouble("shotgun", 1);
|
||||||
|
stack.getOrCreateTag().putDouble("recoilx", 0.016);
|
||||||
|
stack.getOrCreateTag().putDouble("recoily", 0.007);
|
||||||
|
stack.getOrCreateTag().putDouble("damage", 1.5);
|
||||||
|
stack.getOrCreateTag().putDouble("headshot", 1.5);
|
||||||
|
stack.getOrCreateTag().putDouble("velocity", 16);
|
||||||
|
stack.getOrCreateTag().putDouble("mag", 25);
|
||||||
|
stack.getOrCreateTag().putBoolean("init", true);
|
||||||
|
|
||||||
|
if (isCreative) {
|
||||||
|
stack.getOrCreateTag().putDouble("ammo", stack.getOrCreateTag().getDouble("mag"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,21 +154,22 @@ public class Abekiri extends GunItem implements GeoItem {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void inventoryTick(ItemStack itemstack, Level world, Entity entity, int slot, boolean selected) {
|
public void inventoryTick(ItemStack itemstack, Level world, Entity entity, int slot, boolean selected) {
|
||||||
|
super.inventoryTick(itemstack, world, entity, slot, selected);
|
||||||
AbekiriWuPinZaiBeiBaoZhongShiMeiKeFaShengProcedure.execute(entity, itemstack);
|
AbekiriWuPinZaiBeiBaoZhongShiMeiKeFaShengProcedure.execute(entity, itemstack);
|
||||||
|
|
||||||
if (!ItemNBTTool.getBoolean(itemstack, "init", false)) {
|
if (!ItemNBTTool.getBoolean(itemstack, "init", false)) {
|
||||||
initGun(itemstack);
|
initGun(itemstack, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack getGunInstance() {
|
public static ItemStack getGunInstance() {
|
||||||
ItemStack stack = new ItemStack(TargetModItems.ABEKIRI.get());
|
ItemStack stack = new ItemStack(TargetModItems.ABEKIRI.get());
|
||||||
|
|
||||||
initGun(stack);
|
initGun(stack, true);
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void initGun(ItemStack stack) {
|
private static void initGun(ItemStack stack, boolean isCreative) {
|
||||||
stack.getOrCreateTag().putDouble("zoomspeed", 1.4);
|
stack.getOrCreateTag().putDouble("zoomspeed", 1.4);
|
||||||
stack.getOrCreateTag().putDouble("zoom", 1.25);
|
stack.getOrCreateTag().putDouble("zoom", 1.25);
|
||||||
stack.getOrCreateTag().putDouble("dev", 5);
|
stack.getOrCreateTag().putDouble("dev", 5);
|
||||||
|
@ -180,5 +181,9 @@ public class Abekiri extends GunItem implements GeoItem {
|
||||||
stack.getOrCreateTag().putDouble("velocity", 15);
|
stack.getOrCreateTag().putDouble("velocity", 15);
|
||||||
stack.getOrCreateTag().putDouble("mag", 2);
|
stack.getOrCreateTag().putDouble("mag", 2);
|
||||||
stack.getOrCreateTag().putBoolean("init", true);
|
stack.getOrCreateTag().putBoolean("init", true);
|
||||||
|
|
||||||
|
if (isCreative) {
|
||||||
|
stack.getOrCreateTag().putDouble("ammo", stack.getOrCreateTag().getDouble("mag"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
package net.mcreator.target.item.gun;
|
package net.mcreator.target.item.gun;
|
||||||
|
|
||||||
|
import net.mcreator.target.tools.GunsTool;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
|
||||||
|
@ -15,4 +18,9 @@ public class GunItem extends Item {
|
||||||
public boolean canAttackBlock(BlockState p_41441_, Level p_41442_, BlockPos p_41443_, Player p_41444_) {
|
public boolean canAttackBlock(BlockState p_41441_, Level p_41442_, BlockPos p_41443_, Player p_41444_) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void inventoryTick(ItemStack p_41404_, Level p_41405_, Entity p_41406_, int p_41407_, boolean p_41408_) {
|
||||||
|
GunsTool.pvpModeCheck(p_41404_, p_41405_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.google.common.collect.Multimap;
|
||||||
import net.mcreator.target.init.TargetModItems;
|
import net.mcreator.target.init.TargetModItems;
|
||||||
import net.mcreator.target.client.renderer.item.TaserItemRenderer;
|
import net.mcreator.target.client.renderer.item.TaserItemRenderer;
|
||||||
import net.mcreator.target.procedures.TasercooldownProcedure;
|
import net.mcreator.target.procedures.TasercooldownProcedure;
|
||||||
|
import net.mcreator.target.tools.ItemNBTTool;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.model.HumanoidModel;
|
import net.minecraft.client.model.HumanoidModel;
|
||||||
import net.minecraft.client.player.LocalPlayer;
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
|
@ -153,6 +154,10 @@ public class Taser extends GunItem implements GeoItem {
|
||||||
itemstack.getOrCreateTag().putDouble("maxammo", getAmmoCount(player));
|
itemstack.getOrCreateTag().putDouble("maxammo", getAmmoCount(player));
|
||||||
}
|
}
|
||||||
TasercooldownProcedure.execute(entity, itemstack);
|
TasercooldownProcedure.execute(entity, itemstack);
|
||||||
|
|
||||||
|
if (!ItemNBTTool.getBoolean(itemstack, "init", false)) {
|
||||||
|
initGun(itemstack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getAmmoCount(Player player) {
|
public static double getAmmoCount(Player player) {
|
||||||
|
@ -169,4 +174,23 @@ public class Taser extends GunItem implements GeoItem {
|
||||||
protected static boolean check(ItemStack stack) {
|
protected static boolean check(ItemStack stack) {
|
||||||
return stack.getItem() == TargetModItems.TASER_ELECTRODE.get();
|
return stack.getItem() == TargetModItems.TASER_ELECTRODE.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ItemStack getGunInstance() {
|
||||||
|
ItemStack stack = new ItemStack(TargetModItems.TASER.get());
|
||||||
|
|
||||||
|
initGun(stack);
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initGun(ItemStack stack) {
|
||||||
|
stack.getOrCreateTag().putDouble("dev", 2);
|
||||||
|
stack.getOrCreateTag().putDouble("recoilx", 0.0001);
|
||||||
|
stack.getOrCreateTag().putDouble("recoily", 0.002);
|
||||||
|
stack.getOrCreateTag().putDouble("zoomspeed", 2.0);
|
||||||
|
stack.getOrCreateTag().putDouble("zoom", 1.25);
|
||||||
|
stack.getOrCreateTag().putDouble("damage", 5);
|
||||||
|
stack.getOrCreateTag().putDouble("velocity", 3);
|
||||||
|
stack.getOrCreateTag().putDouble("mag", 1);
|
||||||
|
stack.getOrCreateTag().putBoolean("init", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,11 +149,13 @@ public class Trachelium extends GunItem implements GeoItem {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void inventoryTick(ItemStack itemstack, Level world, Entity entity, int slot, boolean selected) {
|
public void inventoryTick(ItemStack itemstack, Level world, Entity entity, int slot, boolean selected) {
|
||||||
|
super.inventoryTick(itemstack, world, entity, slot, selected);
|
||||||
|
|
||||||
// TODO 把这坨procedure删了
|
// TODO 把这坨procedure删了
|
||||||
ReloadingProcedure.execute(entity, itemstack);
|
ReloadingProcedure.execute(entity, itemstack);
|
||||||
|
|
||||||
if (!ItemNBTTool.getBoolean(itemstack, "init", false)) {
|
if (!ItemNBTTool.getBoolean(itemstack, "init", false)) {
|
||||||
initGun(itemstack);
|
initGun(itemstack, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,11 +170,11 @@ public class Trachelium extends GunItem implements GeoItem {
|
||||||
public static ItemStack getGunInstance() {
|
public static ItemStack getGunInstance() {
|
||||||
ItemStack stack = new ItemStack(TargetModItems.TRACHELIUM.get());
|
ItemStack stack = new ItemStack(TargetModItems.TRACHELIUM.get());
|
||||||
|
|
||||||
initGun(stack);
|
initGun(stack, true);
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void initGun(ItemStack stack) {
|
private static void initGun(ItemStack stack, boolean isCreative) {
|
||||||
stack.getOrCreateTag().putDouble("zoomspeed", 1.7);
|
stack.getOrCreateTag().putDouble("zoomspeed", 1.7);
|
||||||
stack.getOrCreateTag().putDouble("zoom", 1.25);
|
stack.getOrCreateTag().putDouble("zoom", 1.25);
|
||||||
stack.getOrCreateTag().putDouble("dev", 3);
|
stack.getOrCreateTag().putDouble("dev", 3);
|
||||||
|
@ -184,5 +186,9 @@ public class Trachelium extends GunItem implements GeoItem {
|
||||||
stack.getOrCreateTag().putDouble("velocity", 60);
|
stack.getOrCreateTag().putDouble("velocity", 60);
|
||||||
stack.getOrCreateTag().putDouble("mag", 8);
|
stack.getOrCreateTag().putDouble("mag", 8);
|
||||||
stack.getOrCreateTag().putBoolean("init", true);
|
stack.getOrCreateTag().putBoolean("init", true);
|
||||||
|
|
||||||
|
if (isCreative) {
|
||||||
|
stack.getOrCreateTag().putDouble("ammo", stack.getOrCreateTag().getDouble("mag"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,10 +145,11 @@ public class VectorItem extends GunItem implements GeoItem {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void inventoryTick(ItemStack itemstack, Level world, Entity entity, int slot, boolean selected) {
|
public void inventoryTick(ItemStack itemstack, Level world, Entity entity, int slot, boolean selected) {
|
||||||
|
super.inventoryTick(itemstack, world, entity, slot, selected);
|
||||||
VectorWuPinZaiBeiBaoZhongShiMeiKeFaShengProcedure.execute(entity, itemstack);
|
VectorWuPinZaiBeiBaoZhongShiMeiKeFaShengProcedure.execute(entity, itemstack);
|
||||||
|
|
||||||
if (!ItemNBTTool.getBoolean(itemstack, "init", false)) {
|
if (!ItemNBTTool.getBoolean(itemstack, "init", false)) {
|
||||||
initGun(itemstack);
|
initGun(itemstack, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,13 +176,13 @@ public class VectorItem extends GunItem implements GeoItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack getGunInstance() {
|
public static ItemStack getGunInstance() {
|
||||||
ItemStack stack = new ItemStack(TargetModItems.TRACHELIUM.get());
|
ItemStack stack = new ItemStack(TargetModItems.VECTOR.get());
|
||||||
|
|
||||||
initGun(stack);
|
initGun(stack, true);
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void initGun(ItemStack stack) {
|
private static void initGun(ItemStack stack, boolean isCreative) {
|
||||||
stack.getOrCreateTag().putDouble("zoomspeed", 1.6);
|
stack.getOrCreateTag().putDouble("zoomspeed", 1.6);
|
||||||
stack.getOrCreateTag().putDouble("zoom", 1.25);
|
stack.getOrCreateTag().putDouble("zoom", 1.25);
|
||||||
stack.getOrCreateTag().putDouble("autorifle", 1);
|
stack.getOrCreateTag().putDouble("autorifle", 1);
|
||||||
|
@ -194,5 +195,9 @@ public class VectorItem extends GunItem implements GeoItem {
|
||||||
stack.getOrCreateTag().putDouble("velocity", 22);
|
stack.getOrCreateTag().putDouble("velocity", 22);
|
||||||
stack.getOrCreateTag().putDouble("mag", 33);
|
stack.getOrCreateTag().putDouble("mag", 33);
|
||||||
stack.getOrCreateTag().putBoolean("init", true);
|
stack.getOrCreateTag().putBoolean("init", true);
|
||||||
|
|
||||||
|
if (isCreative) {
|
||||||
|
stack.getOrCreateTag().putDouble("ammo", stack.getOrCreateTag().getDouble("mag"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,6 @@ import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
|
||||||
import net.mcreator.target.network.TargetModVariables;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,17 +35,6 @@ public class GunsDataProcedure {
|
||||||
itemstackiterator = (entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY);
|
itemstackiterator = (entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY);
|
||||||
|
|
||||||
if (itemstackiterator.is(ItemTags.create(new ResourceLocation("target:gun")))) {
|
if (itemstackiterator.is(ItemTags.create(new ResourceLocation("target:gun")))) {
|
||||||
|
|
||||||
if (!TargetModVariables.MapVariables.get(world).pvpmode) {
|
|
||||||
if (itemstackiterator.getOrCreateTag().getDouble("level") >= 10) {
|
|
||||||
itemstackiterator.getOrCreateTag().putDouble("damageadd", 1 + 0.05 * (itemstackiterator.getOrCreateTag().getDouble("level") - 10));
|
|
||||||
} else {
|
|
||||||
itemstackiterator.getOrCreateTag().putDouble("damageadd", 1);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
itemstackiterator.getOrCreateTag().putDouble("damageadd", 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemstackiterator.getItem() == TargetModItems.SKS.get()) {
|
if (itemstackiterator.getItem() == TargetModItems.SKS.get()) {
|
||||||
itemstackiterator.getOrCreateTag().putDouble("zoomspeed", 1);
|
itemstackiterator.getOrCreateTag().putDouble("zoomspeed", 1);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("zoom", 1.25);
|
itemstackiterator.getOrCreateTag().putDouble("zoom", 1.25);
|
||||||
|
@ -114,16 +101,16 @@ public class GunsDataProcedure {
|
||||||
itemstackiterator.getOrCreateTag().putDouble("velocity", 50);
|
itemstackiterator.getOrCreateTag().putDouble("velocity", 50);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("mag", 1);
|
itemstackiterator.getOrCreateTag().putDouble("mag", 1);
|
||||||
}
|
}
|
||||||
if (itemstackiterator.getItem() == TargetModItems.TASER.get()) {
|
// if (itemstackiterator.getItem() == TargetModItems.TASER.get()) {
|
||||||
itemstackiterator.getOrCreateTag().putDouble("dev", 2);
|
// itemstackiterator.getOrCreateTag().putDouble("dev", 2);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("recoilx", 0.0001);
|
// itemstackiterator.getOrCreateTag().putDouble("recoilx", 0.0001);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("recoily", 0.002);
|
// itemstackiterator.getOrCreateTag().putDouble("recoily", 0.002);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("zoomspeed", 2.0);
|
// itemstackiterator.getOrCreateTag().putDouble("zoomspeed", 2.0);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("zoom", 1.25);
|
// itemstackiterator.getOrCreateTag().putDouble("zoom", 1.25);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("damage", 5);
|
// itemstackiterator.getOrCreateTag().putDouble("damage", 5);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("velocity", 3);
|
// itemstackiterator.getOrCreateTag().putDouble("velocity", 3);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("mag", 1);
|
// itemstackiterator.getOrCreateTag().putDouble("mag", 1);
|
||||||
}
|
// }
|
||||||
if (itemstackiterator.getItem() == TargetModItems.M_79.get()) {
|
if (itemstackiterator.getItem() == TargetModItems.M_79.get()) {
|
||||||
itemstackiterator.getOrCreateTag().putDouble("zoomspeed", 0.95);
|
itemstackiterator.getOrCreateTag().putDouble("zoomspeed", 0.95);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("zoom", 1.25);
|
itemstackiterator.getOrCreateTag().putDouble("zoom", 1.25);
|
||||||
|
@ -181,19 +168,19 @@ public class GunsDataProcedure {
|
||||||
itemstackiterator.getOrCreateTag().putDouble("velocity", 45);
|
itemstackiterator.getOrCreateTag().putDouble("velocity", 45);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("mag", 30);
|
itemstackiterator.getOrCreateTag().putDouble("mag", 30);
|
||||||
}
|
}
|
||||||
if (itemstackiterator.getItem() == TargetModItems.AA_12.get()) {
|
// if (itemstackiterator.getItem() == TargetModItems.AA_12.get()) {
|
||||||
itemstackiterator.getOrCreateTag().putDouble("zoomspeed", 0.95);
|
// itemstackiterator.getOrCreateTag().putDouble("zoomspeed", 0.95);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("zoom", 1.25);
|
// itemstackiterator.getOrCreateTag().putDouble("zoom", 1.25);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("autorifle", 1);
|
// itemstackiterator.getOrCreateTag().putDouble("autorifle", 1);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("dev", 3.5);
|
// itemstackiterator.getOrCreateTag().putDouble("dev", 3.5);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("shotgun", 1);
|
// itemstackiterator.getOrCreateTag().putDouble("shotgun", 1);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("recoilx", 0.016);
|
// itemstackiterator.getOrCreateTag().putDouble("recoilx", 0.016);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("recoily", 0.007);
|
// itemstackiterator.getOrCreateTag().putDouble("recoily", 0.007);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("damage", 1.5);
|
// itemstackiterator.getOrCreateTag().putDouble("damage", 1.5);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("headshot", 1.5);
|
// itemstackiterator.getOrCreateTag().putDouble("headshot", 1.5);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("velocity", 16);
|
// itemstackiterator.getOrCreateTag().putDouble("velocity", 16);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("mag", 25);
|
// itemstackiterator.getOrCreateTag().putDouble("mag", 25);
|
||||||
}
|
// }
|
||||||
if (itemstackiterator.getItem() == TargetModItems.BOCEK.get()) {
|
if (itemstackiterator.getItem() == TargetModItems.BOCEK.get()) {
|
||||||
itemstackiterator.getOrCreateTag().putDouble("zoomspeed", 1);
|
itemstackiterator.getOrCreateTag().putDouble("zoomspeed", 1);
|
||||||
itemstackiterator.getOrCreateTag().putDouble("zoom", 2);
|
itemstackiterator.getOrCreateTag().putDouble("zoom", 2);
|
||||||
|
|
25
src/main/java/net/mcreator/target/tools/GunsTool.java
Normal file
25
src/main/java/net/mcreator/target/tools/GunsTool.java
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
package net.mcreator.target.tools;
|
||||||
|
|
||||||
|
import net.mcreator.target.network.TargetModVariables;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
|
||||||
|
public class GunsTool {
|
||||||
|
|
||||||
|
// TODO 通过配置/json/枚举类的方式来初始化枪械
|
||||||
|
public static void initGun(ItemStack stack) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void pvpModeCheck(ItemStack stack, Level level) {
|
||||||
|
if (!TargetModVariables.MapVariables.get(level).pvpmode) {
|
||||||
|
if (stack.getOrCreateTag().getDouble("level") >= 10) {
|
||||||
|
stack.getOrCreateTag().putDouble("damageadd", 1 + 0.05 * (stack.getOrCreateTag().getDouble("level") - 10));
|
||||||
|
} else {
|
||||||
|
stack.getOrCreateTag().putDouble("damageadd", 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stack.getOrCreateTag().putDouble("damageadd", 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue