mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-17 10:24:23 +01:00
Clean up
This commit is contained in:
parent
c21e492482
commit
f511e2b346
2 changed files with 5 additions and 15 deletions
|
@ -31,31 +31,21 @@ import net.minecraft.world.World;
|
||||||
public class AmuletItem extends WearableItem {
|
public class AmuletItem extends WearableItem {
|
||||||
|
|
||||||
private final int maxEnergy;
|
private final int maxEnergy;
|
||||||
private final float drain;
|
|
||||||
|
|
||||||
private final ImmutableMultimap<EntityAttribute, EntityAttributeModifier> modifiers;
|
private final ImmutableMultimap<EntityAttribute, EntityAttributeModifier> modifiers;
|
||||||
|
|
||||||
public AmuletItem(FabricItemSettings settings, int maxEnergy, int drainRate) {
|
public AmuletItem(FabricItemSettings settings, int maxEnergy) {
|
||||||
this(settings, maxEnergy, drainRate, ImmutableMultimap.builder());
|
this(settings, maxEnergy, ImmutableMultimap.builder());
|
||||||
}
|
}
|
||||||
|
|
||||||
public AmuletItem(FabricItemSettings settings, int maxEnergy, int drainRate, ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> modifiers) {
|
public AmuletItem(FabricItemSettings settings, int maxEnergy, ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> modifiers) {
|
||||||
super(settings);
|
super(settings);
|
||||||
this.maxEnergy = maxEnergy;
|
this.maxEnergy = maxEnergy;
|
||||||
drain = ((float)drainRate / (float)maxEnergy) / 10;
|
|
||||||
|
|
||||||
this.modifiers = modifiers.build();
|
this.modifiers = modifiers.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
|
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
|
||||||
/*if (world.isClient) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (isChargable() && entity instanceof LivingEntity && ((LivingEntity) entity).getEquippedStack(EquipmentSlot.CHEST) == stack) {
|
|
||||||
consumeEnergy(stack, drain);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (this == UItems.PEGASUS_AMULET
|
if (this == UItems.PEGASUS_AMULET
|
||||||
&& entity.world.getTime() % 6 == 0
|
&& entity.world.getTime() % 6 == 0
|
||||||
&& entity instanceof LivingEntity
|
&& entity instanceof LivingEntity
|
||||||
|
|
|
@ -64,11 +64,11 @@ public interface UItems {
|
||||||
AmuletItem PEGASUS_AMULET = register("pegasus_amulet", new AmuletItem(new FabricItemSettings()
|
AmuletItem PEGASUS_AMULET = register("pegasus_amulet", new AmuletItem(new FabricItemSettings()
|
||||||
.maxDamage(890)
|
.maxDamage(890)
|
||||||
.rarity(Rarity.UNCOMMON)
|
.rarity(Rarity.UNCOMMON)
|
||||||
.group(ItemGroup.DECORATIONS), 900, 10));
|
.group(ItemGroup.DECORATIONS), 900));
|
||||||
/*AmuletItem ALICORN_AMULET = register("alicorn_amulet", new AmuletItem(new AmuletItem.Settings("alicorn_amulet")
|
/*AmuletItem ALICORN_AMULET = register("alicorn_amulet", new AmuletItem(new AmuletItem.Settings("alicorn_amulet")
|
||||||
.toughness(900000000)
|
.toughness(900000000)
|
||||||
.resistance(90000000)
|
.resistance(90000000)
|
||||||
.group(ItemGroup.DECORATIONS), 0, 0));*/
|
.group(ItemGroup.DECORATIONS), 0));*/
|
||||||
|
|
||||||
static <T extends Item> T register(String name, T item) {
|
static <T extends Item> T register(String name, T item) {
|
||||||
ITEMS.add(item);
|
ITEMS.add(item);
|
||||||
|
|
Loading…
Reference in a new issue