fix notch delay

This commit is contained in:
Sunskimmer822 2022-03-04 13:45:15 -08:00
parent fc913a0f4e
commit 8ab4e6ba90
7 changed files with 8 additions and 45 deletions

View File

@ -8,9 +8,6 @@ import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.world.World;
import java.util.concurrent.TimeUnit;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
@ -31,11 +28,6 @@ public class fragileHeartCharm extends Item {
Playerentity.sendMessage(new LiteralText("You have " + availableSlots + "charm notches left."), false);
Playerentity.addStatusEffect(new StatusEffectInstance(StatusEffects.HEALTH_BOOST, 20*1000000, 2));
Playerentity.getMainHandStack().damage(50,Playerentity,e-> e.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND));
try {
TimeUnit.SECONDS.sleep(100);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
availableSlots++;
} else if (availableSlots < 1) {

View File

@ -1,7 +1,5 @@
package net.serenas.shitmod;
import java.util.concurrent.TimeUnit;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
@ -29,11 +27,6 @@ public class fragileStrengthCharm extends Item{
PlayerEntity.sendMessage(new LiteralText("You have " + availableSlots + "charm notches left."), false);
PlayerEntity.addStatusEffect(new StatusEffectInstance(StatusEffects.STRENGTH, 20*1000000, 2));
PlayerEntity.getMainHandStack().damage(50,PlayerEntity,e-> e.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND));
try {
TimeUnit.SECONDS.sleep(5);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
availableSlots++;
} else if (availableSlots < 1) {

View File

@ -1,7 +1,5 @@
package net.serenas.shitmod;
import java.util.concurrent.TimeUnit;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
@ -28,11 +26,6 @@ public class kingsoul extends Item {
PlayerEntity.sendMessage(new LiteralText("You have " + availableSlots + "charm notches left."), false);
PlayerEntity.getHungerManager().add(1, 1);
PlayerEntity.getMainHandStack().damage(1,PlayerEntity,e-> e.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND));
try {
TimeUnit.SECONDS.sleep(5);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
availableSlots++;
} else if (availableSlots < 1) {

View File

@ -1,8 +1,5 @@
package net.serenas.shitmod;
import java.util.concurrent.TimeUnit;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
@ -30,11 +27,6 @@ public class stalwartShell extends Item{
PlayerEntity.sendMessage(new LiteralText("You have " + availableSlots + "charm notches left."), false);
PlayerEntity.addStatusEffect(new StatusEffectInstance(StatusEffects.RESISTANCE, 20, 5));
PlayerEntity.getMainHandStack().damage(1,PlayerEntity,e-> e.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND));
try {
TimeUnit.SECONDS.sleep(15);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
availableSlots++;
} else if (availableSlots < 1) {

View File

@ -1,5 +1,7 @@
package net.serenas.shitmod;
import java.util.concurrent.TimeUnit;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -17,6 +19,11 @@ public class totemOfEquivalency extends Item {
@Override
public TypedActionResult<ItemStack> use(World World, PlayerEntity PlayerEntity, Hand Hand) {
PlayerEntity.kill();
try {
TimeUnit.SECONDS.sleep(10);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
return new TypedActionResult<ItemStack>(ActionResult.SUCCESS, PlayerEntity.getStackInHand(Hand));
}
}

View File

@ -1,7 +1,5 @@
package net.serenas.shitmod;
import java.util.concurrent.TimeUnit;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
@ -26,13 +24,8 @@ public class unbreakableHeartCharm extends Item {
if (availableSlots > 0) {
availableSlots--;
PlayerEntity.sendMessage(new LiteralText("You have " + availableSlots + "charm notches left."), false);
PlayerEntity.sendMessage(new LiteralText("You have " + availableSlots + " charm notches left."), false);
PlayerEntity.addStatusEffect(new StatusEffectInstance(StatusEffects.HEALTH_BOOST, 20*1000000, 4));
try {
TimeUnit.SECONDS.sleep(5);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
availableSlots++;
} else if (availableSlots < 1) {

View File

@ -1,7 +1,5 @@
package net.serenas.shitmod;
import java.util.concurrent.TimeUnit;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
@ -28,11 +26,6 @@ public class unbreakableStrengthCharm extends Item {
availableSlots--;
PlayerEntity.sendMessage(new LiteralText("You have " + availableSlots + "charm notches left."), false);
PlayerEntity.addStatusEffect(new StatusEffectInstance(StatusEffects.STRENGTH, 20*1000000, 3));
try {
TimeUnit.SECONDS.sleep(5);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
availableSlots++;
} else if (availableSlots < 1) {