diff --git a/src/main/java/com/possible_triangle/brazier/Content.java b/src/main/java/com/possible_triangle/brazier/Content.java index b0ac020..355b718 100644 --- a/src/main/java/com/possible_triangle/brazier/Content.java +++ b/src/main/java/com/possible_triangle/brazier/Content.java @@ -3,13 +3,13 @@ import com.possible_triangle.brazier.block.BrazierBlock; import com.possible_triangle.brazier.block.LazyTorchBlock; import com.possible_triangle.brazier.block.LazyWallTorchBlock; +import com.possible_triangle.brazier.block.SpawnPowder; import com.possible_triangle.brazier.block.tile.BrazierTile; import com.possible_triangle.brazier.block.tile.render.BrazierRenderer; import com.possible_triangle.brazier.entity.Crazed; import com.possible_triangle.brazier.entity.CrazedFlame; import com.possible_triangle.brazier.entity.render.CrazedFlameRenderer; import com.possible_triangle.brazier.entity.render.CrazedRender; -import com.possible_triangle.brazier.item.Flame; import com.possible_triangle.brazier.item.LazySpawnEgg; import com.possible_triangle.brazier.item.LivingTorch; import com.possible_triangle.brazier.particle.FlameParticle; @@ -23,6 +23,7 @@ import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; +import net.minecraft.item.Rarity; import net.minecraft.particles.BasicParticleType; import net.minecraft.particles.ParticleType; import net.minecraft.tags.BlockTags; @@ -49,19 +50,24 @@ import java.util.function.Supplier; import java.util.stream.Stream; +import static com.possible_triangle.brazier.Brazier.MODID; + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class Content { - public static final ITag BRAZIER_BASE_BLOCKS = BlockTags.makeWrapperTag(new ResourceLocation(Brazier.MODID, "brazier_base_blocks").toString()); - public static final ITag> BRAZIER_WHITELIST = EntityTypeTags.func_232896_a_(new ResourceLocation(Brazier.MODID, "brazier_whitelist").toString()); - public static final ITag> BRAZIER_BLACKLIST = EntityTypeTags.func_232896_a_(new ResourceLocation(Brazier.MODID, "brazier_blacklist").toString()); - public static final ITag TORCHES = ItemTags.makeWrapperTag(new ResourceLocation(Brazier.MODID, "torches").toString()); + public static final ITag BRAZIER_BASE_BLOCKS = BlockTags.makeWrapperTag(new ResourceLocation(MODID, "brazier_base_blocks").toString()); + public static final ITag> BRAZIER_WHITELIST = EntityTypeTags.func_232896_a_(new ResourceLocation(MODID, "brazier_whitelist").toString()); + public static final ITag> BRAZIER_BLACKLIST = EntityTypeTags.func_232896_a_(new ResourceLocation(MODID, "brazier_blacklist").toString()); + public static final ITag TORCHES = ItemTags.makeWrapperTag(new ResourceLocation(MODID, "torches").toString()); + + public static final ITag ASH_TAG = ItemTags.makeWrapperTag(new ResourceLocation(MODID, "ash").toString()); + public static final ITag WARPED_WART_TAG = ItemTags.makeWrapperTag(new ResourceLocation(MODID, "warped_wart").toString()); - public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Brazier.MODID); - public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, Brazier.MODID); - public static final DeferredRegister> TILES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, Brazier.MODID); - public static final DeferredRegister> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, Brazier.MODID); - public static final DeferredRegister> PARTICLES = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, Brazier.MODID); + public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID); + public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID); + public static final DeferredRegister> TILES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, MODID); + public static final DeferredRegister> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, MODID); + public static final DeferredRegister> PARTICLES = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, MODID); public static final RegistryObject FLAME_PARTICLE = PARTICLES.register("flame", () -> new BasicParticleType(false)); @@ -73,9 +79,13 @@ public class Content { public static final RegistryObject LIVING_TORCH_BLOCK = BLOCKS.register("living_torch", () -> new LazyTorchBlock(FLAME_PARTICLE)); public static final RegistryObject LIVING_TORCH_BLOCK_WALL = BLOCKS.register("living_wall_torch", () -> new LazyWallTorchBlock(FLAME_PARTICLE)); - public static final RegistryObject LIVING_FLAME = ITEMS.register("living_flame", Flame::new); + public static final RegistryObject LIVING_FLAME = ITEMS.register("living_flame", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS).rarity(Rarity.UNCOMMON))); public static final RegistryObject LIVING_TORCH = ITEMS.register("living_torch", LivingTorch::new); + public static final RegistryObject ASH = ITEMS.register("ash", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS))); + public static final RegistryObject WARPED_NETHERWART = ITEMS.register("warped_nether_wart", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS))); + public static final RegistryObject SPAWN_POWDER = registerBlock("spawn_powder", SpawnPowder::new, p -> p.group(ItemGroup.MATERIALS)); + public static final RegistryObject> CRAZED = ENTITIES.register("crazed", () -> EntityType.Builder.create(Crazed::new, EntityClassification.MONSTER) .setCustomClientFactory((s, w) -> new Crazed(w)) .immuneToFire().build("crazed")); @@ -142,5 +152,7 @@ public static void clientSetup(Minecraft mc) { .forEach(b -> RenderTypeLookup.setRenderLayer(b, RenderType.getCutout())); BRAZIER_TILE.ifPresent(tile -> ClientRegistry.bindTileEntityRenderer(tile, BrazierRenderer::new)); + + SPAWN_POWDER.ifPresent(b -> RenderTypeLookup.setRenderLayer(b, RenderType.getCutout())); } } \ No newline at end of file diff --git a/src/main/java/com/possible_triangle/brazier/block/BrazierBlock.java b/src/main/java/com/possible_triangle/brazier/block/BrazierBlock.java index f16fd8a..fb4dc1f 100644 --- a/src/main/java/com/possible_triangle/brazier/block/BrazierBlock.java +++ b/src/main/java/com/possible_triangle/brazier/block/BrazierBlock.java @@ -2,6 +2,7 @@ import com.possible_triangle.brazier.Content; import com.possible_triangle.brazier.block.tile.BrazierTile; +import com.possible_triangle.brazier.config.BrazierConfig; import net.minecraft.block.Block; import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; @@ -81,6 +82,15 @@ public static boolean prevents(SpawnReason reason) { @SubscribeEvent public static void mobSpawn(LivingSpawnEvent.CheckSpawn event) { BlockPos pos = new BlockPos(event.getX(), event.getY(), event.getZ()); + + // Check for spawn powder + if(BrazierConfig.SERVER.SPAWN_POWDER.get()) { + Block block = event.getWorld().getBlockState(pos).getBlock(); + if(Content.SPAWN_POWDER.filter(block::equals).isPresent()) { + return; + } + } + if (prevents(event.getSpawnReason()) && prevents(event.getEntity()) && BrazierTile.inRange(pos)) event.setResult(Event.Result.DENY); } diff --git a/src/main/java/com/possible_triangle/brazier/block/LazyWallTorchBlock.java b/src/main/java/com/possible_triangle/brazier/block/LazyWallTorchBlock.java index c233b92..e98a674 100644 --- a/src/main/java/com/possible_triangle/brazier/block/LazyWallTorchBlock.java +++ b/src/main/java/com/possible_triangle/brazier/block/LazyWallTorchBlock.java @@ -2,10 +2,10 @@ import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; -import net.minecraft.block.TorchBlock; import net.minecraft.block.WallTorchBlock; import net.minecraft.particles.IParticleData; import net.minecraft.particles.ParticleTypes; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; @@ -26,11 +26,13 @@ public LazyWallTorchBlock(Supplier particle) { @OnlyIn(Dist.CLIENT) @Override public void animateTick(BlockState state, World world, BlockPos pos, Random rand) { + Direction direction = state.get(HORIZONTAL_FACING); double d0 = (double)pos.getX() + 0.5D; double d1 = (double)pos.getY() + 0.7D; double d2 = (double)pos.getZ() + 0.5D; - world.addParticle(ParticleTypes.SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D); - world.addParticle(this.particle.get(), d0, d1, d2, 0.0D, 0.0D, 0.0D); + Direction direction1 = direction.getOpposite(); + world.addParticle(ParticleTypes.SMOKE, d0 + 0.27D * (double)direction1.getXOffset(), d1 + 0.22D, d2 + 0.27D * (double)direction1.getZOffset(), 0.0D, 0.0D, 0.0D); + world.addParticle(this.particle.get(), d0 + 0.27D * (double)direction1.getXOffset(), d1 + 0.22D, d2 + 0.27D * (double)direction1.getZOffset(), 0.0D, 0.0D, 0.0D); } } diff --git a/src/main/java/com/possible_triangle/brazier/block/SpawnPowder.java b/src/main/java/com/possible_triangle/brazier/block/SpawnPowder.java new file mode 100644 index 0000000..b737a1e --- /dev/null +++ b/src/main/java/com/possible_triangle/brazier/block/SpawnPowder.java @@ -0,0 +1,42 @@ +package com.possible_triangle.brazier.block; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.material.Material; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.IWorld; +import net.minecraft.world.IWorldReader; + +public class SpawnPowder extends Block { + + private static final VoxelShape SHAPE = Block.makeCuboidShape(2.0D, 0.0D, 2.0D, 14.0D, 1.0D, 14.0D); + + public SpawnPowder() { + super(Properties.create(Material.MISCELLANEOUS) + .doesNotBlockMovement() + .zeroHardnessAndResistance() + .func_235838_a_($ -> 1) + ); + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + return SHAPE; + } + + @Override + public boolean isValidPosition(BlockState state, IWorldReader world, BlockPos pos) { + BlockState below = world.getBlockState(pos.down()); + return below.isSolidSide(world, pos.down(), Direction.UP); + } + + public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState neighbor, IWorld world, BlockPos block, BlockPos facingPos) { + return !state.isValidPosition(world, block) ? Blocks.AIR.getDefaultState() : super.updatePostPlacement(state, facing, neighbor, world, block, facingPos); + } + +} diff --git a/src/main/java/com/possible_triangle/brazier/block/tile/BrazierTile.java b/src/main/java/com/possible_triangle/brazier/block/tile/BrazierTile.java index 9967ee9..247deb0 100644 --- a/src/main/java/com/possible_triangle/brazier/block/tile/BrazierTile.java +++ b/src/main/java/com/possible_triangle/brazier/block/tile/BrazierTile.java @@ -14,7 +14,6 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.vector.Vector3d; -import net.minecraft.util.math.vector.Vector3f; import net.minecraft.world.server.ServerWorld; import java.util.HashMap; @@ -41,6 +40,7 @@ public static boolean isBorder(Vector3d pos) { public static boolean inRange(BlockPos pos) { synchronized (BRAZIERS) { return BRAZIERS.entrySet().stream().anyMatch(e -> { + if(!BrazierConfig.SERVER.PROTECT_ABOVE.get() && e.getKey().getY() < pos.getY()) return false; double dist = DistanceHandler.getDistance(pos, e.getKey()); int maxDist = e.getValue() * e.getValue(); return dist <= maxDist; diff --git a/src/main/java/com/possible_triangle/brazier/config/BrazierServerConfig.java b/src/main/java/com/possible_triangle/brazier/config/BrazierServerConfig.java index aa25464..4e18076 100644 --- a/src/main/java/com/possible_triangle/brazier/config/BrazierServerConfig.java +++ b/src/main/java/com/possible_triangle/brazier/config/BrazierServerConfig.java @@ -11,6 +11,9 @@ public class BrazierServerConfig { public final ForgeConfigSpec.IntValue MAX_HEIGHT; public final ForgeConfigSpec.IntValue RANGE_PER_LEVEL; public final ForgeConfigSpec.IntValue BASE_RANGE; + public final ForgeConfigSpec.BooleanValue PROTECT_ABOVE; + + public final ForgeConfigSpec.BooleanValue SPAWN_POWDER; public final ForgeConfigSpec.EnumValue DISTANCE_CALC; @@ -39,6 +42,16 @@ public BrazierServerConfig(ForgeConfigSpec.Builder builder) { .translation("config.brazier.distanceCalc") .defineEnum("distanceCalc", DistanceHandler.Type.CYLINDER); + PROTECT_ABOVE = builder + .comment("Should the brazier protect blocks above it too?") + .translation("config.brazier.protectAbove") + .define("protectAbove", false); + + SPAWN_POWDER = builder + .comment("Enable to spawn powder block?") + .translation("config.brazier.spawnPowder") + .define("spawnPowder", true); + builder.pop().comment("Options related to the acquisition of the living flame").push("acquisition"); JUNGLE_LOOT = builder diff --git a/src/main/java/com/possible_triangle/brazier/data/Blocks.java b/src/main/java/com/possible_triangle/brazier/data/Blocks.java index 08e78ec..81392e4 100644 --- a/src/main/java/com/possible_triangle/brazier/data/Blocks.java +++ b/src/main/java/com/possible_triangle/brazier/data/Blocks.java @@ -18,13 +18,17 @@ public Blocks(DataGenerator generator, ExistingFileHelper fileHelper) { super(generator, Brazier.MODID, fileHelper); } + private ResourceLocation extend(ResourceLocation in, String with) { + return new ResourceLocation(in.getNamespace(), in.getPath() + with); + } + @Override protected void registerStatesAndModels() { Content.BRAZIER.ifPresent(b -> getVariantBuilder(b).forAllStates(s -> { boolean lit = s.get(BrazierBlock.LIT); ResourceLocation r = blockTexture(b); - ResourceLocation model = lit ? new ResourceLocation(r.getNamespace(), r.getPath() + "_lit") : r; + ResourceLocation model = lit ? extend(r, "_lit") : r; return ConfiguredModel.builder() .modelFile(this.models().getExistingFile(model)) .build(); @@ -57,5 +61,16 @@ protected void registerStatesAndModels() { } ); + Content.SPAWN_POWDER.ifPresent(b -> simpleBlock(b, + models().getBuilder(b.getRegistryName().getPath()) + .texture("particle", blockTexture(b)) + .texture("texture", blockTexture(b)) + .element().from(0, 0.25F, 0).to(16, 0.25F, 16) + .shade(false) + .face(Direction.UP).texture("#texture").uvs(0, 0, 16, 16).end() + .face(Direction.DOWN).texture("#texture").uvs(0, 16, 16, 0).end() + .end().ao(false) + )); + } } diff --git a/src/main/java/com/possible_triangle/brazier/data/Items.java b/src/main/java/com/possible_triangle/brazier/data/Items.java index 521ffd8..4f91422 100644 --- a/src/main/java/com/possible_triangle/brazier/data/Items.java +++ b/src/main/java/com/possible_triangle/brazier/data/Items.java @@ -23,7 +23,7 @@ protected void registerModels() { .map(ResourceLocation::getPath) .ifPresent(b -> this.withExistingParent(b, modLoc("block/" + b))); - Stream.of(Content.LIVING_FLAME).forEach(c -> c + Stream.of(Content.LIVING_FLAME, Content.SPAWN_POWDER, Content.WARPED_NETHERWART, Content.ASH).forEach(c -> c .map(ForgeRegistryEntry::getRegistryName) .map(ResourceLocation::getPath) .ifPresent(i -> singleTexture(i, mcLoc("item/generated"), "layer0", modLoc("item/" + i))) diff --git a/src/main/java/com/possible_triangle/brazier/data/Loot.java b/src/main/java/com/possible_triangle/brazier/data/Loot.java index 4ef41b9..27dd3c6 100644 --- a/src/main/java/com/possible_triangle/brazier/data/Loot.java +++ b/src/main/java/com/possible_triangle/brazier/data/Loot.java @@ -1,12 +1,21 @@ package com.possible_triangle.brazier.data; import com.possible_triangle.brazier.Content; +import net.minecraft.advancements.criterion.StatePropertiesPredicate; +import net.minecraft.block.Blocks; +import net.minecraft.block.NetherWartBlock; import net.minecraft.data.DataGenerator; +import net.minecraft.entity.EntityType; import net.minecraft.item.Items; import net.minecraft.loot.*; +import net.minecraft.loot.conditions.BlockStateProperty; +import net.minecraft.loot.conditions.RandomChance; import net.minecraft.loot.conditions.SurvivesExplosion; +import net.minecraft.loot.functions.LootingEnchantBonus; +import net.minecraft.loot.functions.SetCount; import net.minecraftforge.event.LootTableLoadEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.fml.common.Mod; @@ -21,6 +30,8 @@ public Loot(DataGenerator generator) { @SubscribeEvent public static void onLootLoaded(LootTableLoadEvent event) { + boolean noNetherEx = !ModList.get().isLoaded("nether_extension"); + if (event.getName().equals(LootTables.CHESTS_JUNGLE_TEMPLE)) { Content.LIVING_FLAME.ifPresent(flame -> event.getTable().addPool(LootPool.builder() @@ -28,6 +39,23 @@ public static void onLootLoaded(LootTableLoadEvent event) { .addEntry(EmptyLootEntry.func_216167_a().weight(1)) .build()) ); + } else if (event.getName().equals(EntityType.WITHER_SKELETON.getLootTable()) && !noNetherEx) { + Content.ASH.ifPresent(ash -> event.getTable().addPool(LootPool.builder() + .addEntry(ItemLootEntry.builder(ash) + .acceptFunction(SetCount.builder(RandomValueRange.of(-1, 1))) + .acceptFunction(LootingEnchantBonus.builder(RandomValueRange.of(0, 1))) + ) + .build()) + ); + } else if (event.getName().equals(Blocks.NETHER_WART.getLootTable())) { + Content.WARPED_NETHERWART.ifPresent(wart -> event.getTable().addPool(LootPool.builder() + .addEntry(ItemLootEntry.builder(wart).acceptFunction(SetCount.builder(RandomValueRange.of(-1, 1)) + .acceptCondition(RandomChance.builder(0.02F)) + .acceptCondition(BlockStateProperty.builder(Blocks.NETHER_WART) + .fromProperties(StatePropertiesPredicate.Builder.newBuilder().withIntProp(NetherWartBlock.AGE, 3))) + )) + .build()) + ); } } @@ -39,7 +67,7 @@ protected void addTables() { ).setParameterSet(LootParameterSets.ENTITY) )); - Stream.of(Content.BRAZIER, Content.LIVING_TORCH_BLOCK, Content.LIVING_TORCH_BLOCK_WALL) + Stream.of(Content.BRAZIER, Content.LIVING_TORCH_BLOCK, Content.LIVING_TORCH_BLOCK_WALL, Content.SPAWN_POWDER) .filter(RegistryObject::isPresent).map(RegistryObject::get) .forEach(block -> lootTables.put(block.getLootTable(), LootTable.builder() .addLootPool(LootPool.builder().rolls(ConstantRange.of(1)) diff --git a/src/main/java/com/possible_triangle/brazier/data/Recipes.java b/src/main/java/com/possible_triangle/brazier/data/Recipes.java index 6355294..7303708 100644 --- a/src/main/java/com/possible_triangle/brazier/data/Recipes.java +++ b/src/main/java/com/possible_triangle/brazier/data/Recipes.java @@ -6,9 +6,12 @@ import net.minecraft.item.Item; import net.minecraft.item.Items; import net.minecraft.item.crafting.Ingredient; +import net.minecraft.util.ResourceLocation; import java.util.function.Consumer; +import static com.possible_triangle.brazier.Brazier.MODID; + public class Recipes extends RecipeProvider { public Recipes(DataGenerator generator) { @@ -17,24 +20,44 @@ public Recipes(DataGenerator generator) { @Override protected void registerRecipes(Consumer consumer) { - Content.BRAZIER.ifPresent(brazier -> { - Item flame = Content.LIVING_FLAME.orElse(Items.BLAZE_POWDER); - ShapedRecipeBuilder.shapedRecipe(brazier) - .patternLine("BFB") - .patternLine("SSS") - .key('B', Blocks.IRON_BARS) - .key('S', Blocks.field_235406_np_) - .key('F', flame) - .addCriterion("collected_flame", hasItem(flame)) - .build(consumer); - }); + Item flame = Content.LIVING_FLAME.orElse(Items.BLAZE_POWDER); + + Content.BRAZIER.ifPresent(brazier -> + ShapedRecipeBuilder.shapedRecipe(brazier) + .patternLine("BFB") + .patternLine("SSS") + .key('B', Blocks.IRON_BARS) + .key('S', Blocks.field_235406_np_) + .key('F', flame) + .addCriterion("collected_flame", hasItem(flame)) + .build(consumer) + ); Content.LIVING_TORCH.ifPresent(torch -> ShapelessRecipeBuilder.shapelessRecipe(torch, 2) .addIngredient(torch) .addIngredient(Ingredient.fromTag(Content.TORCHES)) - .addCriterion("collected_flame", hasItem(torch)) + .addCriterion("collected_torch", hasItem(torch)) .build(consumer) ); + + Content.SPAWN_POWDER.ifPresent(powder -> + ShapelessRecipeBuilder.shapelessRecipe(powder, 6) + .addIngredient(Ingredient.fromTag(Content.ASH_TAG), 4) + .addIngredient(Items.CHARCOAL, 1) + .addIngredient(Content.WARPED_NETHERWART.orElse(Items.NETHER_WART)) + .addCriterion("collected_flame", hasItem(flame)) + .addCriterion("collected_ash", hasItem(Content.ASH_TAG)) + .build(consumer) + ); + + ShapedRecipeBuilder.shapedRecipe(Blocks.field_235374_mn_) + .patternLine("xxx") + .patternLine("xxx") + .patternLine("xxx") + .key('x', Content.WARPED_WART_TAG) + .addCriterion("collected_wart", hasItem(Content.WARPED_WART_TAG)) + .build(consumer, new ResourceLocation(MODID, "warped_warp_block")); + } } diff --git a/src/main/java/com/possible_triangle/brazier/item/BrazierIndicator.java b/src/main/java/com/possible_triangle/brazier/item/BrazierIndicator.java index 9c1d33b..5dc2d4e 100644 --- a/src/main/java/com/possible_triangle/brazier/item/BrazierIndicator.java +++ b/src/main/java/com/possible_triangle/brazier/item/BrazierIndicator.java @@ -19,19 +19,19 @@ static void playerTick(TickEvent.PlayerTickEvent event) { Stream items = Stream.of(event.player.getHeldItemOffhand(), event.player.getHeldItemMainhand()); if (items.map(ItemStack::getItem).anyMatch(BrazierIndicator.class::isInstance)) { - int step = 4; + int step = 3; float radius = 5F; for (int i = -step; i <= step; i++) { float ry = i / (float) step; double y = event.player.prevPosY + ry * (radius / 2) + 1; - for (float r = 0; r < radius; r += 0.1F) { - int degSteps = (int) (1 - r / radius) * 78 + 12; + for (float r = 0; r < radius; r += 0.2F) { + int degSteps = (int) (1 - r / radius) * 33 + 12; for (int deg = 0; deg < 360; deg += degSteps) { float rad = (float) ((deg + i + event.player.ticksExisted) / 180F * Math.PI); double x = event.player.prevPosX + MathHelper.sin(rad) * r; double z = event.player.prevPosZ + MathHelper.cos(rad) * r; if (BrazierTile.isBorder(new Vector3d(x, y, z))) { - world.spawnParticle(Content.FLAME_PARTICLE.get(), x, y, z, 1, 0, 0.1, 0, 0.01); + world.spawnParticle(Content.FLAME_PARTICLE.get(), x, y, z, 1, 0, 0.2, 0, 0.01); } } } diff --git a/src/main/java/com/possible_triangle/brazier/item/Flame.java b/src/main/java/com/possible_triangle/brazier/item/Flame.java deleted file mode 100644 index 5ff89c8..0000000 --- a/src/main/java/com/possible_triangle/brazier/item/Flame.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.possible_triangle.brazier.item; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemGroup; -import net.minecraft.item.Rarity; - -public class Flame extends Item { - - public Flame() { - super((new Item.Properties()).group(ItemGroup.MATERIALS).rarity(Rarity.UNCOMMON)); - } - -} diff --git a/src/main/java/com/possible_triangle/brazier/particle/FlameParticle.java b/src/main/java/com/possible_triangle/brazier/particle/FlameParticle.java index 69ab868..09fd957 100644 --- a/src/main/java/com/possible_triangle/brazier/particle/FlameParticle.java +++ b/src/main/java/com/possible_triangle/brazier/particle/FlameParticle.java @@ -1,11 +1,8 @@ package com.possible_triangle.brazier.particle; -import com.possible_triangle.brazier.item.Flame; import net.minecraft.client.particle.*; import net.minecraft.client.world.ClientWorld; import net.minecraft.particles.BasicParticleType; -import net.minecraft.particles.IParticleData; -import net.minecraft.particles.ParticleTypes; import net.minecraft.util.math.MathHelper; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; diff --git a/src/main/resources/assets/brazier/Brazier.cubik b/src/main/resources/assets/brazier/Brazier.cubik new file mode 100644 index 0000000..f60025c Binary files /dev/null and b/src/main/resources/assets/brazier/Brazier.cubik differ diff --git a/src/main/resources/assets/brazier/blockstates/spawn_powder.json b/src/main/resources/assets/brazier/blockstates/spawn_powder.json new file mode 100644 index 0000000..695c9e5 --- /dev/null +++ b/src/main/resources/assets/brazier/blockstates/spawn_powder.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "brazier:block/spawn_powder" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brazier/lang/en_us.json b/src/main/resources/assets/brazier/lang/en_us.json index c4ee5ee..69d3339 100644 --- a/src/main/resources/assets/brazier/lang/en_us.json +++ b/src/main/resources/assets/brazier/lang/en_us.json @@ -1,9 +1,12 @@ { "block.brazier.brazier": "Brazier", "block.brazier.living_torch": "Living Torch", + "block.brazier.spawn_powder": "Cursed Ash", "item.brazier.living_flame": "Living Flame", "entity.brazier.crazed_flame": "Crazed Flame", "item.brazier.crazed_spawn_egg": "Crazed Spawn Egg", + "item.brazier.ash": "Ash", + "item.brazier.warped_nether_wart": "Warped Netherwart", "entity.brazier.crazed": "Crazed", "advancements.brazier.place_brazier.title": "Begone, demon!", "advancements.brazier.place_brazier.description": "Place a brazier down and drive away the monsters of the night", diff --git a/src/main/resources/assets/brazier/models/block/spawn_powder.json b/src/main/resources/assets/brazier/models/block/spawn_powder.json new file mode 100644 index 0000000..b1c6165 --- /dev/null +++ b/src/main/resources/assets/brazier/models/block/spawn_powder.json @@ -0,0 +1,36 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "brazier:block/spawn_powder", + "texture": "brazier:block/spawn_powder" + }, + "elements": [ + { + "from": [ + 0, + 0.25, + 0 + ], + "to": [ + 16, + 0.25, + 16 + ], + "shade": false, + "faces": { + "down": { + "texture": "#texture", + "uv": [ + 0.0, + 16.0, + 16.0, + 0.0 + ] + }, + "up": { + "texture": "#texture" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/brazier/models/item/ash.json b/src/main/resources/assets/brazier/models/item/ash.json new file mode 100644 index 0000000..2961aaa --- /dev/null +++ b/src/main/resources/assets/brazier/models/item/ash.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "brazier:item/ash" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brazier/models/item/spawn_powder.json b/src/main/resources/assets/brazier/models/item/spawn_powder.json new file mode 100644 index 0000000..6d7a081 --- /dev/null +++ b/src/main/resources/assets/brazier/models/item/spawn_powder.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "brazier:item/spawn_powder" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brazier/models/item/warped_nether_wart.json b/src/main/resources/assets/brazier/models/item/warped_nether_wart.json new file mode 100644 index 0000000..7443384 --- /dev/null +++ b/src/main/resources/assets/brazier/models/item/warped_nether_wart.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "brazier:item/warped_nether_wart" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brazier/textures/block/spawn_powder.png b/src/main/resources/assets/brazier/textures/block/spawn_powder.png new file mode 100644 index 0000000..8fb2050 Binary files /dev/null and b/src/main/resources/assets/brazier/textures/block/spawn_powder.png differ diff --git a/src/main/resources/assets/brazier/textures/block/spawn_powder.xcf b/src/main/resources/assets/brazier/textures/block/spawn_powder.xcf new file mode 100644 index 0000000..05f8108 Binary files /dev/null and b/src/main/resources/assets/brazier/textures/block/spawn_powder.xcf differ diff --git a/src/main/resources/assets/brazier/textures/item/ash.png b/src/main/resources/assets/brazier/textures/item/ash.png new file mode 100644 index 0000000..96048b8 Binary files /dev/null and b/src/main/resources/assets/brazier/textures/item/ash.png differ diff --git a/src/main/resources/assets/brazier/textures/item/spawn_powder.png b/src/main/resources/assets/brazier/textures/item/spawn_powder.png new file mode 100644 index 0000000..539dfe3 Binary files /dev/null and b/src/main/resources/assets/brazier/textures/item/spawn_powder.png differ diff --git a/src/main/resources/assets/brazier/textures/item/warped_nether_wart.png b/src/main/resources/assets/brazier/textures/item/warped_nether_wart.png new file mode 100644 index 0000000..7b79c43 Binary files /dev/null and b/src/main/resources/assets/brazier/textures/item/warped_nether_wart.png differ diff --git a/src/main/resources/data/brazier/loot_tables/blocks/spawn_powder.json b/src/main/resources/data/brazier/loot_tables/blocks/spawn_powder.json new file mode 100644 index 0000000..26befe9 --- /dev/null +++ b/src/main/resources/data/brazier/loot_tables/blocks/spawn_powder.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "brazier:spawn_powder" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/brazier/recipes/spawn_powder.json b/src/main/resources/data/brazier/recipes/spawn_powder.json new file mode 100644 index 0000000..a828b08 --- /dev/null +++ b/src/main/resources/data/brazier/recipes/spawn_powder.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "brazier:ash" + }, + { + "tag": "brazier:ash" + }, + { + "tag": "brazier:ash" + }, + { + "tag": "brazier:ash" + }, + { + "item": "minecraft:charcoal" + }, + { + "item": "brazier:warped_nether_wart" + } + ], + "result": { + "item": "brazier:spawn_powder", + "count": 6 + } +} \ No newline at end of file diff --git a/src/main/resources/data/brazier/recipes/warped_warp_block.json b/src/main/resources/data/brazier/recipes/warped_warp_block.json new file mode 100644 index 0000000..8eeb74a --- /dev/null +++ b/src/main/resources/data/brazier/recipes/warped_warp_block.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "xxx", + "xxx", + "xxx" + ], + "key": { + "x": { + "tag": "brazier:warped_wart" + } + }, + "result": { + "item": "minecraft:warped_wart_block" + } +} \ No newline at end of file diff --git a/src/main/resources/data/brazier/tags/entity_types/brazier_blacklist.json b/src/main/resources/data/brazier/tags/entity_types/brazier_blacklist.json index a22514f..56f95e1 100644 --- a/src/main/resources/data/brazier/tags/entity_types/brazier_blacklist.json +++ b/src/main/resources/data/brazier/tags/entity_types/brazier_blacklist.json @@ -1,5 +1,8 @@ { "replace": false, "values": [ + "minecraft:slime", + "minecraft:magma_cube", + "minecraft:hoglin" ] } \ No newline at end of file diff --git a/src/main/resources/data/brazier/tags/entity_types/brazier_whitelist.json b/src/main/resources/data/brazier/tags/entity_types/brazier_whitelist.json index a22514f..5e8aecc 100644 --- a/src/main/resources/data/brazier/tags/entity_types/brazier_whitelist.json +++ b/src/main/resources/data/brazier/tags/entity_types/brazier_whitelist.json @@ -1,5 +1,4 @@ { "replace": false, - "values": [ - ] + "values": [] } \ No newline at end of file diff --git a/src/main/resources/data/brazier/tags/items/ash.json b/src/main/resources/data/brazier/tags/items/ash.json new file mode 100644 index 0000000..f863a99 --- /dev/null +++ b/src/main/resources/data/brazier/tags/items/ash.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "brazier:ash" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/brazier/tags/items/warped_wart.json b/src/main/resources/data/brazier/tags/items/warped_wart.json new file mode 100644 index 0000000..1e68d7c --- /dev/null +++ b/src/main/resources/data/brazier/tags/items/warped_wart.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "brazier:warped_nether_wart" + ] +} \ No newline at end of file