修改弹药盒属性
This commit is contained in:
parent
606adcb490
commit
1fa92f5205
9 changed files with 23 additions and 46 deletions
|
@ -1,8 +1,8 @@
|
|||
package com.atsuishio.superbwarfare.item.common.ammo;
|
||||
|
||||
import com.atsuishio.superbwarfare.init.ModSounds;
|
||||
import com.atsuishio.superbwarfare.network.ModVariables;
|
||||
import com.atsuishio.superbwarfare.tools.ItemNBTTool;
|
||||
import com.atsuishio.superbwarfare.init.ModSounds;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
@ -22,6 +22,7 @@ import java.text.DecimalFormat;
|
|||
import java.util.List;
|
||||
|
||||
public class AmmoBox extends Item {
|
||||
|
||||
public AmmoBox() {
|
||||
super(new Properties().stacksTo(1));
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.atsuishio.superbwarfare.tools.GunInfo;
|
|||
import net.minecraft.world.item.Item;
|
||||
|
||||
public class HandgunAmmo extends AmmoSupplierItem {
|
||||
|
||||
public HandgunAmmo() {
|
||||
super(GunInfo.Type.HANDGUN, 5, new Item.Properties());
|
||||
}
|
||||
|
|
|
@ -3,26 +3,19 @@ package com.atsuishio.superbwarfare.item.common.ammo;
|
|||
import com.atsuishio.superbwarfare.tools.GunInfo;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HandgunAmmoBox extends AmmoSupplierItem {
|
||||
|
||||
public HandgunAmmoBox() {
|
||||
super(GunInfo.Type.HANDGUN, 30, new Item.Properties());
|
||||
}
|
||||
|
||||
@Override
|
||||
public UseAnim getUseAnimation(ItemStack itemstack) {
|
||||
return UseAnim.EAT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseDuration(ItemStack itemstack) {
|
||||
return 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack itemstack, Level world, List<Component> list, TooltipFlag flag) {
|
||||
list.add(Component.translatable("des.superbwarfare.handgun_ammo_box").withStyle(ChatFormatting.GRAY));
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.atsuishio.superbwarfare.tools.GunInfo;
|
|||
import net.minecraft.world.item.Item;
|
||||
|
||||
public class RifleAmmo extends AmmoSupplierItem {
|
||||
|
||||
public RifleAmmo() {
|
||||
super(GunInfo.Type.RIFLE, 5, new Item.Properties());
|
||||
}
|
||||
|
|
|
@ -3,26 +3,19 @@ package com.atsuishio.superbwarfare.item.common.ammo;
|
|||
import com.atsuishio.superbwarfare.tools.GunInfo;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RifleAmmoBox extends AmmoSupplierItem {
|
||||
|
||||
public RifleAmmoBox() {
|
||||
super(GunInfo.Type.RIFLE, 30, new Item.Properties());
|
||||
}
|
||||
|
||||
@Override
|
||||
public UseAnim getUseAnimation(ItemStack itemstack) {
|
||||
return UseAnim.EAT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseDuration(ItemStack itemstack) {
|
||||
return 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack itemstack, Level world, List<Component> list, TooltipFlag flag) {
|
||||
list.add(Component.translatable("des.superbwarfare.rifle_ammo_box").withStyle(ChatFormatting.GRAY));
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.atsuishio.superbwarfare.tools.GunInfo;
|
|||
import net.minecraft.world.item.Item;
|
||||
|
||||
public class ShotgunAmmo extends AmmoSupplierItem {
|
||||
|
||||
public ShotgunAmmo() {
|
||||
super(GunInfo.Type.SHOTGUN, 2, new Item.Properties());
|
||||
}
|
||||
|
|
|
@ -3,24 +3,17 @@ package com.atsuishio.superbwarfare.item.common.ammo;
|
|||
import com.atsuishio.superbwarfare.tools.GunInfo;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ShotgunAmmoBox extends AmmoSupplierItem {
|
||||
|
||||
public ShotgunAmmoBox() {
|
||||
super(GunInfo.Type.SHOTGUN, 12, new Item.Properties().stacksTo(8));
|
||||
}
|
||||
|
||||
@Override
|
||||
public UseAnim getUseAnimation(ItemStack itemstack) {
|
||||
return UseAnim.EAT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseDuration(ItemStack itemstack) {
|
||||
return 16;
|
||||
super(GunInfo.Type.SHOTGUN, 12, new Item.Properties());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.atsuishio.superbwarfare.tools.GunInfo;
|
|||
import net.minecraft.world.item.Item;
|
||||
|
||||
public class SniperAmmo extends AmmoSupplierItem {
|
||||
|
||||
public SniperAmmo() {
|
||||
super(GunInfo.Type.SNIPER, 2, new Item.Properties());
|
||||
}
|
||||
|
|
|
@ -3,26 +3,19 @@ package com.atsuishio.superbwarfare.item.common.ammo;
|
|||
import com.atsuishio.superbwarfare.tools.GunInfo;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SniperAmmoBox extends AmmoSupplierItem {
|
||||
|
||||
public SniperAmmoBox() {
|
||||
super(GunInfo.Type.SNIPER, 12, new Item.Properties());
|
||||
}
|
||||
|
||||
@Override
|
||||
public UseAnim getUseAnimation(ItemStack itemstack) {
|
||||
return UseAnim.EAT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseDuration(ItemStack itemstack) {
|
||||
return 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack itemstack, Level world, List<Component> list, TooltipFlag flag) {
|
||||
list.add(Component.translatable("des.superbwarfare.sniper_ammo_box").withStyle(ChatFormatting.GRAY));
|
||||
|
|
Loading…
Add table
Reference in a new issue