update: version 1.3.0

This commit is contained in:
nimsolated
2026-03-03 00:51:25 -08:00
parent f75f1ea3f6
commit e8cba12868
39 changed files with 1100 additions and 9 deletions

View File

@@ -21,6 +21,8 @@ import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModTabs;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModMobEffects;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModMenus;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModItems;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModFluids;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModFluidTypes;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModEntities;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModEnchantments;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModBlocks;
@@ -56,6 +58,8 @@ public class NimsRandomBullshitMod {
NimsRandomBullshitModMobEffects.REGISTRY.register(bus);
NimsRandomBullshitModMenus.REGISTRY.register(bus);
NimsRandomBullshitModFluids.REGISTRY.register(bus);
NimsRandomBullshitModFluidTypes.REGISTRY.register(bus);
// Start of user code block mod init
// End of user code block mod init

View File

@@ -0,0 +1,36 @@
package net.mcreator.nimsrandombullshit.block;
import net.minecraft.world.level.material.PushReaction;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.world.level.Level;
import net.minecraft.util.RandomSource;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.core.BlockPos;
import net.mcreator.nimsrandombullshit.procedures.NetherrackJuiceOnTickUpdateProcedure;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModFluids;
public class NetherrackJuiceBlock extends LiquidBlock {
public NetherrackJuiceBlock() {
super(() -> NimsRandomBullshitModFluids.NETHERRACK_JUICE.get(),
BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED).strength(100f).noCollission().noLootTable().liquid().pushReaction(PushReaction.DESTROY).sound(SoundType.EMPTY).replaceable());
}
@Override
public void onPlace(BlockState blockstate, Level world, BlockPos pos, BlockState oldState, boolean moving) {
super.onPlace(blockstate, world, pos, oldState, moving);
world.scheduleTick(pos, this, 1);
}
@Override
public void tick(BlockState blockstate, ServerLevel world, BlockPos pos, RandomSource random) {
super.tick(blockstate, world, pos, random);
NetherrackJuiceOnTickUpdateProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ());
world.scheduleTick(pos, this, 1);
}
}

View File

@@ -0,0 +1,49 @@
package net.mcreator.nimsrandombullshit.fluid;
import net.minecraftforge.fluids.ForgeFlowingFluid;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.LiquidBlock;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModItems;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModFluids;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModFluidTypes;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModBlocks;
public abstract class NetherrackJuiceFluid extends ForgeFlowingFluid {
public static final ForgeFlowingFluid.Properties PROPERTIES = new ForgeFlowingFluid.Properties(() -> NimsRandomBullshitModFluidTypes.NETHERRACK_JUICE_TYPE.get(), () -> NimsRandomBullshitModFluids.NETHERRACK_JUICE.get(),
() -> NimsRandomBullshitModFluids.FLOWING_NETHERRACK_JUICE.get()).explosionResistance(100f).bucket(() -> NimsRandomBullshitModItems.NETHERRACK_JUICE_BUCKET.get())
.block(() -> (LiquidBlock) NimsRandomBullshitModBlocks.NETHERRACK_JUICE.get());
private NetherrackJuiceFluid() {
super(PROPERTIES);
}
public static class Source extends NetherrackJuiceFluid {
public int getAmount(FluidState state) {
return 8;
}
public boolean isSource(FluidState state) {
return true;
}
}
public static class Flowing extends NetherrackJuiceFluid {
protected void createFluidStateDefinition(StateDefinition.Builder<Fluid, FluidState> builder) {
super.createFluidStateDefinition(builder);
builder.add(LEVEL);
}
public int getAmount(FluidState state) {
return state.getValue(LEVEL);
}
public boolean isSource(FluidState state) {
return false;
}
}
}

View File

@@ -0,0 +1,66 @@
package net.mcreator.nimsrandombullshit.fluid.types;
import org.joml.Vector3f;
import net.minecraftforge.fluids.FluidType;
import net.minecraftforge.common.SoundActions;
import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions;
import net.minecraft.world.level.Level;
import net.minecraft.world.entity.Entity;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.client.renderer.FogRenderer;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.Minecraft;
import net.minecraft.client.Camera;
import java.util.function.Consumer;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.shaders.FogShape;
public class NetherrackJuiceFluidType extends FluidType {
public NetherrackJuiceFluidType() {
super(FluidType.Properties.create().fallDistanceModifier(0F).canExtinguish(true).supportsBoating(true).canHydrate(true).motionScale(0.007D).temperature(666).canConvertToSource(true).sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL)
.sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY).sound(SoundActions.FLUID_VAPORIZE, SoundEvents.FIRE_EXTINGUISH));
}
@Override
public void initializeClient(Consumer<IClientFluidTypeExtensions> consumer) {
consumer.accept(new IClientFluidTypeExtensions() {
private static final ResourceLocation STILL_TEXTURE = new ResourceLocation("nims_random_bullshit:block/netherrack_juice");
private static final ResourceLocation FLOWING_TEXTURE = new ResourceLocation("nims_random_bullshit:block/netherrack_juice_flowing");
private static final ResourceLocation RENDER_OVERLAY_TEXTURE = new ResourceLocation("nims_random_bullshit:textures/netherrack_juice_overlay.png");
@Override
public ResourceLocation getStillTexture() {
return STILL_TEXTURE;
}
@Override
public ResourceLocation getFlowingTexture() {
return FLOWING_TEXTURE;
}
@Override
public ResourceLocation getRenderOverlayTexture(Minecraft mc) {
return RENDER_OVERLAY_TEXTURE;
}
@Override
public Vector3f modifyFogColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, Vector3f fluidFogColor) {
return new Vector3f(0.2f, 0f, 0f);
}
public void modifyFogRender(Camera camera, FogRenderer.FogMode mode, float renderDistance, float partialTick, float nearDistance, float farDistance, FogShape shape) {
Entity entity = camera.getEntity();
Level world = entity.level();
RenderSystem.setShaderFogShape(FogShape.SPHERE);
RenderSystem.setShaderFogStart(0f);
RenderSystem.setShaderFogEnd(6f);
}
});
}
}

View File

@@ -13,6 +13,7 @@ import net.minecraft.world.level.block.Block;
import net.mcreator.nimsrandombullshit.block.QuadraCondensedNetherrackBlock;
import net.mcreator.nimsrandombullshit.block.PentaCondensedNetherrackBlock;
import net.mcreator.nimsrandombullshit.block.OreMinerBlock;
import net.mcreator.nimsrandombullshit.block.NetherrackJuiceBlock;
import net.mcreator.nimsrandombullshit.block.HexaCondensedNetherrackBlock;
import net.mcreator.nimsrandombullshit.block.CondensedNetherrackBlock;
import net.mcreator.nimsrandombullshit.block.CondensedCondensedNetherrackBlock;
@@ -30,6 +31,7 @@ public class NimsRandomBullshitModBlocks {
public static final RegistryObject<Block> PENTA_CONDENSED_NETHERRACK = REGISTRY.register("penta_condensed_netherrack", () -> new PentaCondensedNetherrackBlock());
public static final RegistryObject<Block> HEXA_CONDENSED_NETHERRACK = REGISTRY.register("hexa_condensed_netherrack", () -> new HexaCondensedNetherrackBlock());
public static final RegistryObject<Block> ORE_MINER = REGISTRY.register("ore_miner", () -> new OreMinerBlock());
public static final RegistryObject<Block> NETHERRACK_JUICE = REGISTRY.register("netherrack_juice", () -> new NetherrackJuiceBlock());
// Start of user code block custom blocks
// End of user code block custom blocks
}

View File

@@ -0,0 +1,18 @@
/*
* MCreator note: This file will be REGENERATED on each build.
*/
package net.mcreator.nimsrandombullshit.init;
import net.minecraftforge.registries.RegistryObject;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.fluids.FluidType;
import net.mcreator.nimsrandombullshit.fluid.types.NetherrackJuiceFluidType;
import net.mcreator.nimsrandombullshit.NimsRandomBullshitMod;
public class NimsRandomBullshitModFluidTypes {
public static final DeferredRegister<FluidType> REGISTRY = DeferredRegister.create(ForgeRegistries.Keys.FLUID_TYPES, NimsRandomBullshitMod.MODID);
public static final RegistryObject<FluidType> NETHERRACK_JUICE_TYPE = REGISTRY.register("netherrack_juice", () -> new NetherrackJuiceFluidType());
}

View File

@@ -0,0 +1,36 @@
/*
* MCreator note: This file will be REGENERATED on each build.
*/
package net.mcreator.nimsrandombullshit.init;
import net.minecraftforge.registries.RegistryObject;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.FlowingFluid;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
import net.mcreator.nimsrandombullshit.fluid.NetherrackJuiceFluid;
import net.mcreator.nimsrandombullshit.NimsRandomBullshitMod;
public class NimsRandomBullshitModFluids {
public static final DeferredRegister<Fluid> REGISTRY = DeferredRegister.create(ForgeRegistries.FLUIDS, NimsRandomBullshitMod.MODID);
public static final RegistryObject<FlowingFluid> NETHERRACK_JUICE = REGISTRY.register("netherrack_juice", () -> new NetherrackJuiceFluid.Source());
public static final RegistryObject<FlowingFluid> FLOWING_NETHERRACK_JUICE = REGISTRY.register("flowing_netherrack_juice", () -> new NetherrackJuiceFluid.Flowing());
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public static class FluidsClientSideHandler {
@SubscribeEvent
public static void clientSetup(FMLClientSetupEvent event) {
ItemBlockRenderTypes.setRenderLayer(NETHERRACK_JUICE.get(), RenderType.translucent());
ItemBlockRenderTypes.setRenderLayer(FLOWING_NETHERRACK_JUICE.get(), RenderType.translucent());
}
}
}

View File

@@ -13,10 +13,13 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.BlockItem;
import net.mcreator.nimsrandombullshit.item.StarWandItem;
import net.mcreator.nimsrandombullshit.item.StarItem;
import net.mcreator.nimsrandombullshit.item.ShitItem;
import net.mcreator.nimsrandombullshit.item.SandDustItem;
import net.mcreator.nimsrandombullshit.item.NetherrackitePickaxeItem;
import net.mcreator.nimsrandombullshit.item.NetherrackiteItem;
import net.mcreator.nimsrandombullshit.item.NetherrackJuiceItem;
import net.mcreator.nimsrandombullshit.item.MagicFleshItem;
import net.mcreator.nimsrandombullshit.item.MagicDustItem;
import net.mcreator.nimsrandombullshit.item.LapisLazuliNuggetItem;
@@ -46,6 +49,9 @@ public class NimsRandomBullshitModItems {
public static final RegistryObject<Item> ORE_MINER = block(NimsRandomBullshitModBlocks.ORE_MINER);
public static final RegistryObject<Item> GHOUL_SPAWN_EGG = REGISTRY.register("ghoul_spawn_egg", () -> new ForgeSpawnEggItem(NimsRandomBullshitModEntities.GHOUL, -16777216, -13421773, new Item.Properties()));
public static final RegistryObject<Item> GRAVEDIGGER = REGISTRY.register("gravedigger", () -> new GravediggerItem());
public static final RegistryObject<Item> STAR = REGISTRY.register("star", () -> new StarItem());
public static final RegistryObject<Item> STAR_WAND = REGISTRY.register("star_wand", () -> new StarWandItem());
public static final RegistryObject<Item> NETHERRACK_JUICE_BUCKET = REGISTRY.register("netherrack_juice_bucket", () -> new NetherrackJuiceItem());
// Start of user code block custom items
// End of user code block custom items

View File

@@ -34,11 +34,14 @@ public class NimsRandomBullshitModTabs {
tabData.accept(NimsRandomBullshitModItems.NETHERRACKITE_PICKAXE.get());
tabData.accept(NimsRandomBullshitModItems.SHIT.get());
tabData.accept(NimsRandomBullshitModItems.GRAVEDIGGER.get());
tabData.accept(NimsRandomBullshitModItems.STAR_WAND.get());
tabData.accept(NimsRandomBullshitModItems.NETHERRACK_JUICE_BUCKET.get());
} else if (tabData.getTabKey() == CreativeModeTabs.INGREDIENTS) {
tabData.accept(NimsRandomBullshitModItems.NETHERRACKITE.get());
tabData.accept(NimsRandomBullshitModItems.SAND_DUST.get());
tabData.accept(NimsRandomBullshitModItems.LAPIS_LAZULI_NUGGET.get());
tabData.accept(NimsRandomBullshitModItems.MAGIC_DUST.get());
tabData.accept(NimsRandomBullshitModItems.STAR.get());
} else if (tabData.getTabKey() == CreativeModeTabs.FOOD_AND_DRINKS) {
tabData.accept(NimsRandomBullshitModItems.MAGIC_FLESH.get());
tabData.accept(NimsRandomBullshitModItems.GOLDEN_BERRIES.get());

View File

@@ -0,0 +1,15 @@
package net.mcreator.nimsrandombullshit.item;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.BucketItem;
import net.mcreator.nimsrandombullshit.init.NimsRandomBullshitModFluids;
public class NetherrackJuiceItem extends BucketItem {
public NetherrackJuiceItem() {
super(NimsRandomBullshitModFluids.NETHERRACK_JUICE, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1).rarity(Rarity.COMMON));
}
}

View File

@@ -0,0 +1,21 @@
package net.mcreator.nimsrandombullshit.item;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Item;
public class StarItem extends Item {
public StarItem() {
super(new Item.Properties().stacksTo(64).fireResistant().rarity(Rarity.EPIC));
}
@Override
@OnlyIn(Dist.CLIENT)
public boolean isFoil(ItemStack itemstack) {
return true;
}
}

View File

@@ -0,0 +1,77 @@
package net.mcreator.nimsrandombullshit.item;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.Level;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Item;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.InteractionHand;
import net.minecraft.core.BlockPos;
import net.mcreator.nimsrandombullshit.procedures.StarWandRightclickedProcedure;
import com.google.common.collect.Multimap;
import com.google.common.collect.ImmutableMultimap;
public class StarWandItem extends Item {
public StarWandItem() {
super(new Item.Properties().durability(0).fireResistant());
}
@Override
public float getDestroySpeed(ItemStack itemstack, BlockState blockstate) {
return 1;
}
@Override
public boolean mineBlock(ItemStack itemstack, Level world, BlockState blockstate, BlockPos pos, LivingEntity entity) {
itemstack.hurtAndBreak(1, entity, i -> i.broadcastBreakEvent(EquipmentSlot.MAINHAND));
return true;
}
@Override
public boolean hurtEnemy(ItemStack itemstack, LivingEntity entity, LivingEntity sourceentity) {
itemstack.hurtAndBreak(2, entity, i -> i.broadcastBreakEvent(EquipmentSlot.MAINHAND));
return true;
}
@Override
public InteractionResultHolder<ItemStack> use(Level world, Player entity, InteractionHand hand) {
InteractionResultHolder<ItemStack> ar = super.use(world, entity, hand);
StarWandRightclickedProcedure.execute(world, entity.getX(), entity.getY(), entity.getZ(), entity, ar.getObject());
return ar;
}
@Override
public int getEnchantmentValue() {
return 1;
}
@Override
public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot equipmentSlot) {
if (equipmentSlot == EquipmentSlot.MAINHAND) {
ImmutableMultimap.Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder();
builder.putAll(super.getDefaultAttributeModifiers(equipmentSlot));
builder.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Tool modifier", -1f, AttributeModifier.Operation.ADDITION));
builder.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Tool modifier", -3, AttributeModifier.Operation.ADDITION));
return builder.build();
}
return super.getDefaultAttributeModifiers(equipmentSlot);
}
@Override
@OnlyIn(Dist.CLIENT)
public boolean isFoil(ItemStack itemstack) {
return true;
}
}

View File

@@ -0,0 +1,132 @@
package net.mcreator.nimsrandombullshit.procedures;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraft.world.level.block.state.properties.Property;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.Level;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Mth;
import net.minecraft.sounds.SoundSource;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.BlockPos;
import java.util.Map;
public class NetherrackJuiceOnTickUpdateProcedure {
public static void execute(LevelAccessor world, double x, double y, double z) {
if ((world.getFluidState(BlockPos.containing(x + 1, y, z)).createLegacyBlock()).getBlock() == Blocks.LAVA) {
{
BlockPos _bp = BlockPos.containing(x + 1, y, z);
BlockState _bs = Blocks.NETHERRACK.defaultBlockState();
BlockState _bso = world.getBlockState(_bp);
for (Map.Entry<Property<?>, Comparable<?>> entry : _bso.getValues().entrySet()) {
Property _property = _bs.getBlock().getStateDefinition().getProperty(entry.getKey().getName());
if (_property != null && _bs.getValue(_property) != null)
try {
_bs = _bs.setValue(_property, (Comparable) entry.getValue());
} catch (Exception e) {
}
}
world.setBlock(_bp, _bs, 3);
}
if (world instanceof Level _level) {
if (!_level.isClientSide()) {
_level.playSound(null, BlockPos.containing(x, y, z), ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.lava.extinguish")), SoundSource.BLOCKS, (float) 0.7, (float) Mth.nextDouble(RandomSource.create(), 1.2, 2));
} else {
_level.playLocalSound(x, y, z, ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.lava.extinguish")), SoundSource.BLOCKS, (float) 0.7, (float) Mth.nextDouble(RandomSource.create(), 1.2, 2), false);
}
}
} else if ((world.getFluidState(BlockPos.containing(x - 1, y, z)).createLegacyBlock()).getBlock() == Blocks.LAVA) {
{
BlockPos _bp = BlockPos.containing(x - 1, y, z);
BlockState _bs = Blocks.NETHERRACK.defaultBlockState();
BlockState _bso = world.getBlockState(_bp);
for (Map.Entry<Property<?>, Comparable<?>> entry : _bso.getValues().entrySet()) {
Property _property = _bs.getBlock().getStateDefinition().getProperty(entry.getKey().getName());
if (_property != null && _bs.getValue(_property) != null)
try {
_bs = _bs.setValue(_property, (Comparable) entry.getValue());
} catch (Exception e) {
}
}
world.setBlock(_bp, _bs, 3);
}
if (world instanceof Level _level) {
if (!_level.isClientSide()) {
_level.playSound(null, BlockPos.containing(x, y, z), ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.lava.extinguish")), SoundSource.BLOCKS, (float) 0.7, (float) Mth.nextDouble(RandomSource.create(), 1.2, 2));
} else {
_level.playLocalSound(x, y, z, ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.lava.extinguish")), SoundSource.BLOCKS, (float) 0.7, (float) Mth.nextDouble(RandomSource.create(), 1.2, 2), false);
}
}
} else if ((world.getFluidState(BlockPos.containing(x, y, z + 1)).createLegacyBlock()).getBlock() == Blocks.LAVA) {
{
BlockPos _bp = BlockPos.containing(x, y, z + 1);
BlockState _bs = Blocks.NETHERRACK.defaultBlockState();
BlockState _bso = world.getBlockState(_bp);
for (Map.Entry<Property<?>, Comparable<?>> entry : _bso.getValues().entrySet()) {
Property _property = _bs.getBlock().getStateDefinition().getProperty(entry.getKey().getName());
if (_property != null && _bs.getValue(_property) != null)
try {
_bs = _bs.setValue(_property, (Comparable) entry.getValue());
} catch (Exception e) {
}
}
world.setBlock(_bp, _bs, 3);
}
if (world instanceof Level _level) {
if (!_level.isClientSide()) {
_level.playSound(null, BlockPos.containing(x, y, z), ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.lava.extinguish")), SoundSource.BLOCKS, (float) 0.7, (float) Mth.nextDouble(RandomSource.create(), 1.2, 2));
} else {
_level.playLocalSound(x, y, z, ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.lava.extinguish")), SoundSource.BLOCKS, (float) 0.7, (float) Mth.nextDouble(RandomSource.create(), 1.2, 2), false);
}
}
} else if ((world.getFluidState(BlockPos.containing(x, y, z - 1)).createLegacyBlock()).getBlock() == Blocks.LAVA) {
{
BlockPos _bp = BlockPos.containing(x, y, z - 1);
BlockState _bs = Blocks.NETHERRACK.defaultBlockState();
BlockState _bso = world.getBlockState(_bp);
for (Map.Entry<Property<?>, Comparable<?>> entry : _bso.getValues().entrySet()) {
Property _property = _bs.getBlock().getStateDefinition().getProperty(entry.getKey().getName());
if (_property != null && _bs.getValue(_property) != null)
try {
_bs = _bs.setValue(_property, (Comparable) entry.getValue());
} catch (Exception e) {
}
}
world.setBlock(_bp, _bs, 3);
}
if (world instanceof Level _level) {
if (!_level.isClientSide()) {
_level.playSound(null, BlockPos.containing(x, y, z), ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.lava.extinguish")), SoundSource.BLOCKS, (float) 0.7, (float) Mth.nextDouble(RandomSource.create(), 1.2, 2));
} else {
_level.playLocalSound(x, y, z, ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.lava.extinguish")), SoundSource.BLOCKS, (float) 0.7, (float) Mth.nextDouble(RandomSource.create(), 1.2, 2), false);
}
}
} else if ((world.getFluidState(BlockPos.containing(x, y - 1, z)).createLegacyBlock()).getBlock() == Blocks.LAVA) {
{
BlockPos _bp = BlockPos.containing(x, y - 1, z);
BlockState _bs = Blocks.NETHERRACK.defaultBlockState();
BlockState _bso = world.getBlockState(_bp);
for (Map.Entry<Property<?>, Comparable<?>> entry : _bso.getValues().entrySet()) {
Property _property = _bs.getBlock().getStateDefinition().getProperty(entry.getKey().getName());
if (_property != null && _bs.getValue(_property) != null)
try {
_bs = _bs.setValue(_property, (Comparable) entry.getValue());
} catch (Exception e) {
}
}
world.setBlock(_bp, _bs, 3);
}
if (world instanceof Level _level) {
if (!_level.isClientSide()) {
_level.playSound(null, BlockPos.containing(x, y, z), ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.lava.extinguish")), SoundSource.BLOCKS, (float) 0.7, (float) Mth.nextDouble(RandomSource.create(), 1.2, 2));
} else {
_level.playLocalSound(x, y, z, ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.lava.extinguish")), SoundSource.BLOCKS, (float) 0.7, (float) Mth.nextDouble(RandomSource.create(), 1.2, 2), false);
}
}
}
}
}

View File

@@ -0,0 +1,75 @@
package net.mcreator.nimsrandombullshit.procedures;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Mth;
import net.minecraft.sounds.SoundSource;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.BlockPos;
import java.util.Comparator;
public class StarWandRightclickedProcedure {
public static void execute(LevelAccessor world, double x, double y, double z, Entity entity, ItemStack itemstack) {
if (entity == null)
return;
Entity rightClickedEntity = null;
rightClickedEntity = (Entity) world.getEntitiesOfClass(LivingEntity.class,
AABB.ofSize(
new Vec3((entity.level().clip(new ClipContext(entity.getEyePosition(1f), entity.getEyePosition(1f).add(entity.getViewVector(1f).scale(5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)).getBlockPos().getX()),
(entity.level().clip(new ClipContext(entity.getEyePosition(1f), entity.getEyePosition(1f).add(entity.getViewVector(1f).scale(5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)).getBlockPos().getY()),
(entity.level().clip(new ClipContext(entity.getEyePosition(1f), entity.getEyePosition(1f).add(entity.getViewVector(1f).scale(5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)).getBlockPos().getZ())),
4, 4, 4),
e -> true).stream().sorted(new Object() {
Comparator<Entity> compareDistOf(double _x, double _y, double _z) {
return Comparator.comparingDouble(_entcnd -> _entcnd.distanceToSqr(_x, _y, _z));
}
}.compareDistOf((entity.level().clip(new ClipContext(entity.getEyePosition(1f), entity.getEyePosition(1f).add(entity.getViewVector(1f).scale(5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)).getBlockPos().getX()),
(entity.level().clip(new ClipContext(entity.getEyePosition(1f), entity.getEyePosition(1f).add(entity.getViewVector(1f).scale(5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)).getBlockPos().getY()),
(entity.level().clip(new ClipContext(entity.getEyePosition(1f), entity.getEyePosition(1f).add(entity.getViewVector(1f).scale(5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)).getBlockPos().getZ())))
.findFirst().orElse(null);
if (!(rightClickedEntity == null)) {
if ((rightClickedEntity instanceof LivingEntity _livEnt ? _livEnt.getHealth() : -1) == (rightClickedEntity instanceof LivingEntity _livEnt ? _livEnt.getMaxHealth() : -1)) {
if (rightClickedEntity instanceof LivingEntity _entity && !_entity.level().isClientSide())
_entity.addEffect(new MobEffectInstance(MobEffects.ABSORPTION, 300, 1, false, false));
if (entity instanceof Player _player)
_player.getCooldowns().addCooldown(itemstack.getItem(), 40);
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.resonate")), SoundSource.NEUTRAL, 3,
(float) (2 * ((Mth.nextInt(RandomSource.create(), 2, 24) - 12) / 12)));
} else {
_level.playLocalSound(x, y, z, ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.amethyst_block.resonate")), SoundSource.NEUTRAL, 3, (float) (2 * ((Mth.nextInt(RandomSource.create(), 2, 24) - 12) / 12)),
false);
}
}
} else {
if (rightClickedEntity instanceof LivingEntity _entity)
_entity.setHealth((float) ((rightClickedEntity instanceof LivingEntity _livEnt ? _livEnt.getHealth() : -1) + 3));
if (entity instanceof Player _player)
_player.getCooldowns().addCooldown(itemstack.getItem(), 40);
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.resonate")), SoundSource.NEUTRAL, 3,
(float) (2 * ((Mth.nextInt(RandomSource.create(), 2, 24) - 12) / 12)));
} else {
_level.playLocalSound(x, y, z, ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.amethyst_block.resonate")), SoundSource.NEUTRAL, 3, (float) (2 * ((Mth.nextInt(RandomSource.create(), 2, 24) - 12) / 12)),
false);
}
}
}
}
}
}