mirror of
https://github.com/nimsolated/Nims-Random-BS.git
synced 2026-04-02 10:20:42 -07:00
update: version 1.3.1
This commit is contained in:
@@ -23,149 +23,177 @@ public class OreMinerMineButtonPressedProcedure {
|
||||
if (entity == null)
|
||||
return;
|
||||
double oreMinerRoll = 0;
|
||||
if ((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).getItem() == Items.DIAMOND_PICKAXE) {
|
||||
if (world instanceof Level _level) {
|
||||
if (!_level.isClientSide()) {
|
||||
_level.playSound(null, BlockPos.containing(x, y, z), ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.stone.break")), SoundSource.BLOCKS, (float) 0.8, (float) Mth.nextDouble(RandomSource.create(), 0.9, 1.1));
|
||||
if (!world.isClientSide()) {
|
||||
if ((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).getItem() == Items.DIAMOND_PICKAXE
|
||||
&& !(entity instanceof Player _plrCldCheck4 && _plrCldCheck4.getCooldowns()
|
||||
.isOnCooldown((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).getItem()))) {
|
||||
if (world instanceof Level _level) {
|
||||
if (!_level.isClientSide()) {
|
||||
_level.playSound(null, BlockPos.containing(x, y, z), ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.amethyst_block.break")), SoundSource.BLOCKS, 1, (float) Mth.nextDouble(RandomSource.create(), 0.75, 0.85));
|
||||
} else {
|
||||
_level.playLocalSound(x, y, z, ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.amethyst_block.break")), SoundSource.BLOCKS, 1, (float) Mth.nextDouble(RandomSource.create(), 0.75, 0.85), false);
|
||||
}
|
||||
}
|
||||
{
|
||||
ItemStack _ist = (entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY);
|
||||
if (_ist.hurt(15, RandomSource.create(), null)) {
|
||||
_ist.shrink(1);
|
||||
_ist.setDamageValue(0);
|
||||
}
|
||||
}
|
||||
oreMinerRoll = Math.random();
|
||||
if (oreMinerRoll < 0.4) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.COAL).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(1) + Mth.nextInt(RandomSource.create(), 1, 3)));
|
||||
((Slot) _slots.get(1)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
if (entity instanceof Player _player)
|
||||
_player.getCooldowns()
|
||||
.addCooldown((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).getItem(), 6);
|
||||
} else if (oreMinerRoll < 0.6) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.RAW_COPPER).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(2) + Mth.nextInt(RandomSource.create(), 2, 4)));
|
||||
((Slot) _slots.get(2)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
if (entity instanceof Player _player)
|
||||
_player.getCooldowns()
|
||||
.addCooldown((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).getItem(), 8);
|
||||
} else if (oreMinerRoll < 0.7) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.RAW_IRON).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(3) + 1));
|
||||
((Slot) _slots.get(3)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
if (entity instanceof Player _player)
|
||||
_player.getCooldowns()
|
||||
.addCooldown((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).getItem(), 8);
|
||||
} else if (oreMinerRoll < 0.78) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.RAW_GOLD).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(4) + 1));
|
||||
((Slot) _slots.get(4)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
if (entity instanceof Player _player)
|
||||
_player.getCooldowns()
|
||||
.addCooldown((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).getItem(), 10);
|
||||
} else if (oreMinerRoll < 0.81) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.DIAMOND).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(5) + Mth.nextInt(RandomSource.create(), 1, 2)));
|
||||
((Slot) _slots.get(5)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
if (entity instanceof Player _player)
|
||||
_player.getCooldowns()
|
||||
.addCooldown((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).getItem(), 14);
|
||||
} else if (oreMinerRoll < 0.84) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.EMERALD).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(6) + Mth.nextInt(RandomSource.create(), 1, 2)));
|
||||
((Slot) _slots.get(6)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
if (entity instanceof Player _player)
|
||||
_player.getCooldowns()
|
||||
.addCooldown((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).getItem(), 14);
|
||||
} else if (oreMinerRoll < 0.985) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.REDSTONE).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(7) + Mth.nextInt(RandomSource.create(), 3, 6)));
|
||||
((Slot) _slots.get(7)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
if (entity instanceof Player _player)
|
||||
_player.getCooldowns()
|
||||
.addCooldown((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).getItem(), 9);
|
||||
} else {
|
||||
_level.playLocalSound(x, y, z, ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.stone.break")), SoundSource.BLOCKS, (float) 0.8, (float) Mth.nextDouble(RandomSource.create(), 0.9, 1.1), false);
|
||||
}
|
||||
}
|
||||
{
|
||||
ItemStack _ist = (entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY);
|
||||
if (_ist.hurt(1, RandomSource.create(), null)) {
|
||||
_ist.shrink(1);
|
||||
_ist.setDamageValue(0);
|
||||
}
|
||||
}
|
||||
oreMinerRoll = Math.random();
|
||||
if (oreMinerRoll < 0.125) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.COAL).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.NETHERITE_SCRAP).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(1) + Mth.nextInt(RandomSource.create(), 1, 3)));
|
||||
((Slot) _slots.get(1)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
} else if (oreMinerRoll < 0.25) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.RAW_COPPER).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(2) + Mth.nextInt(RandomSource.create(), 2, 4)));
|
||||
((Slot) _slots.get(2)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
} else if (oreMinerRoll < 0.375) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.RAW_IRON).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(3) + 1));
|
||||
((Slot) _slots.get(3)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
} else if (oreMinerRoll < 0.5) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.RAW_GOLD).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(4) + 1));
|
||||
((Slot) _slots.get(4)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
} else if (oreMinerRoll < 0.625) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.DIAMOND).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(5) + Mth.nextInt(RandomSource.create(), 1, 2)));
|
||||
((Slot) _slots.get(5)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
} else if (oreMinerRoll < 0.75) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.EMERALD).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(6) + Mth.nextInt(RandomSource.create(), 1, 2)));
|
||||
((Slot) _slots.get(6)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
} else if (oreMinerRoll < 0.875) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.REDSTONE).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(7) + Mth.nextInt(RandomSource.create(), 3, 6)));
|
||||
((Slot) _slots.get(7)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
} else {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack _setstack = new ItemStack(Items.NETHERITE_SCRAP).copy();
|
||||
_setstack.setCount((int) (new Object() {
|
||||
public int getAmount(int sltid) {
|
||||
if (entity instanceof Player _player && _player.containerMenu instanceof Supplier _current && _current.get() instanceof Map _slots) {
|
||||
ItemStack stack = ((Slot) _slots.get(sltid)).getItem();
|
||||
if (stack != null)
|
||||
return stack.getCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}.getAmount(8) + 1));
|
||||
((Slot) _slots.get(8)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}.getAmount(8) + 1));
|
||||
((Slot) _slots.get(8)).set(_setstack);
|
||||
_player.containerMenu.broadcastChanges();
|
||||
}
|
||||
if (entity instanceof Player _player)
|
||||
_player.getCooldowns()
|
||||
.addCooldown((entity instanceof Player _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr && _splr.get() instanceof Map _slt ? ((Slot) _slt.get(0)).getItem() : ItemStack.EMPTY).getItem(), 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "building",
|
||||
"pattern": [
|
||||
"aaa",
|
||||
"aaa"
|
||||
],
|
||||
"key": {
|
||||
"a": {
|
||||
"item": "nims_random_bullshit:shit"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "nims_random_bullshit:broken_glass",
|
||||
"count": 16
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user