Skip to content

Commit

Permalink
Update to Minecraft 1.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
realguyman committed Jan 8, 2023
1 parent 45dedac commit e077ce4
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 38 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
org.gradle.jvmargs = -Xmx1G

minecraft = 1.19
mappings = 1.19+build.4
minecraft = 1.19.3
mappings = 1.19.3+build.5
fabric_loader = 0.14.12
fabric_api = 0.58.0+1.19
cloth_config = 8.2.88
mod_menu = 4.0.4
fabric_api = 0.72.0+1.19.3
cloth_config = 9.0.94
mod_menu = 5.0.2

version = 0.11.2+1.19
group = io.github.realguyman
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import me.shedaniel.autoconfig.serializer.GsonConfigSerializer;
import me.shedaniel.autoconfig.serializer.PartitioningSerializer;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.item.ItemGroups;
import net.minecraft.item.Items;

public class TotallyLitModInitializer implements ModInitializer {
public static final String IDENTIFIER = "totally_lit";
Expand All @@ -16,6 +19,13 @@ public class TotallyLitModInitializer implements ModInitializer {
public void onInitialize() {
new BlockRegistry();
new ItemRegistry();

ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(listener -> {
listener.addAfter(Items.TORCH, ItemRegistry.UNLIT_TORCH);
listener.addAfter(Items.SOUL_TORCH, ItemRegistry.UNLIT_SOUL_TORCH, ItemRegistry.GLOWSTONE_TORCH);
listener.addAfter(Items.LANTERN, ItemRegistry.UNLIT_LANTERN);
listener.addAfter(Items.SOUL_LANTERN, ItemRegistry.UNLIT_SOUL_LANTERN, ItemRegistry.GLOWSTONE_LANTERN);
});
}

public static Configuration getConfiguration() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.WallStandingBlockItem;
import net.minecraft.item.VerticallyAttachableBlockItem;
import net.minecraft.util.math.Direction;

public class LitTorchItem extends WallStandingBlockItem {
public class LitTorchItem extends VerticallyAttachableBlockItem {
private final Item unlitItem;

public LitTorchItem(Block standingBlock, Block wallBlock, Settings settings, Item unlitItem) {
super(standingBlock, wallBlock, settings);
public LitTorchItem(Block standingBlock, Block wallBlock, Settings settings, Direction verticalAttachmentDirection, Item unlitItem) {
super(standingBlock, wallBlock, settings, verticalAttachmentDirection);
this.unlitItem = unlitItem;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUsageContext;
import net.minecraft.item.WallStandingBlockItem;
import net.minecraft.item.VerticallyAttachableBlockItem;
import net.minecraft.util.ActionResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.World;

public class UnlitTorchItem extends WallStandingBlockItem {
public class UnlitTorchItem extends VerticallyAttachableBlockItem {
private final Item litItem;

public UnlitTorchItem(Block standing, Block wall, Settings settings, Item litItem) {
super(standing, wall, settings);
public UnlitTorchItem(Block standing, Block wall, Settings settings, Direction verticalAttachmentDirection, Item litItem) {
super(standing, wall, settings, verticalAttachmentDirection);
this.litItem = litItem;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import net.minecraft.block.*;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.CampfireBlockEntity;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.tag.BlockTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.tick.WorldTickScheduler;
Expand Down Expand Up @@ -46,7 +46,7 @@ private void randomTick(BlockState state, ServerWorld world, BlockPos pos, Rando
Block block = state.getBlock();

if (!scheduler.isQueued(pos, block) && !scheduler.isTicking(pos, block)) {
world.createAndScheduleBlockTick(pos, block, TotallyLitModInitializer.getConfiguration().candleConfiguration.burnDuration * 6_000);
world.scheduleBlockTick(pos, block, TotallyLitModInitializer.getConfiguration().candleConfiguration.burnDuration * 6_000);
}
}

Expand All @@ -59,7 +59,7 @@ private void randomTick(BlockState state, ServerWorld world, BlockPos pos, Rando
Block block = state.getBlock();

if (!scheduler.isQueued(pos, block) && !scheduler.isTicking(pos, block)) {
world.createAndScheduleBlockTick(pos, block, TotallyLitModInitializer.getConfiguration().jackOLanternConfiguration.burnDuration * 6_000);
world.scheduleBlockTick(pos, block, TotallyLitModInitializer.getConfiguration().jackOLanternConfiguration.burnDuration * 6_000);
}
}

Expand All @@ -72,7 +72,7 @@ private void randomTick(BlockState state, ServerWorld world, BlockPos pos, Rando
Block block = state.getBlock();

if (!scheduler.isQueued(pos, block) && !scheduler.isTicking(pos, block)) {
world.createAndScheduleBlockTick(pos, block, TotallyLitModInitializer.getConfiguration().lanternConfiguration.burnDuration * 6_000);
world.scheduleBlockTick(pos, block, TotallyLitModInitializer.getConfiguration().lanternConfiguration.burnDuration * 6_000);
}
}

Expand All @@ -85,7 +85,7 @@ private void randomTick(BlockState state, ServerWorld world, BlockPos pos, Rando
Block block = state.getBlock();

if (!scheduler.isQueued(pos, block) && !scheduler.isTicking(pos, block)) {
world.createAndScheduleBlockTick(pos, block, TotallyLitModInitializer.getConfiguration().torchConfiguration.burnDuration * 6_000);
world.scheduleBlockTick(pos, block, TotallyLitModInitializer.getConfiguration().torchConfiguration.burnDuration * 6_000);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.tag.BlockTags;
import net.minecraft.util.math.BlockBox;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.LanternBlock;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

public class BlockRegistry {
public static final Block GLOWSTONE_TORCH = add("glowstone_torch", new NoParticleTorchBlock(Settings.copy(Blocks.TORCH)));
Expand All @@ -21,6 +22,6 @@ public class BlockRegistry {
public static final Block UNLIT_WALL_TORCH = add("unlit_wall_torch", new UnlitWallTorchBlock(Settings.copy(Blocks.WALL_TORCH).luminance(state -> 0).dropsLike(UNLIT_TORCH), Blocks.WALL_TORCH));

private static Block add(String path, Block block) {
return Registry.register(Registry.BLOCK, new Identifier(TotallyLitModInitializer.IDENTIFIER, path), block);
return Registry.register(Registries.BLOCK, new Identifier(TotallyLitModInitializer.IDENTIFIER, path), block);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@
import io.github.realguyman.totally_lit.api.item.UnlitLanternItem;
import io.github.realguyman.totally_lit.api.item.UnlitTorchItem;
import net.minecraft.item.*;
import net.minecraft.item.Items;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.math.Direction;

public class ItemRegistry {
public static final Item GLOWSTONE_TORCH = add("glowstone_torch", new WallStandingBlockItem(BlockRegistry.GLOWSTONE_TORCH, BlockRegistry.GLOWSTONE_WALL_TORCH, new Item.Settings().group(ItemGroup.DECORATIONS)));
public static final Item GLOWSTONE_LANTERN = add("glowstone_lantern", new BlockItem(BlockRegistry.GLOWSTONE_LANTERN, new Item.Settings().group(ItemGroup.DECORATIONS)));
public static final Item UNLIT_LANTERN = add("unlit_lantern", new UnlitLanternItem(BlockRegistry.UNLIT_LANTERN, new Item.Settings().group(ItemGroup.DECORATIONS), Items.LANTERN));
public static final Item UNLIT_SOUL_LANTERN = add("unlit_soul_lantern", new UnlitLanternItem(BlockRegistry.UNLIT_SOUL_LANTERN, new Item.Settings().group(ItemGroup.DECORATIONS), Items.SOUL_LANTERN));
public static final Item UNLIT_SOUL_TORCH = add("unlit_soul_torch", new UnlitTorchItem(BlockRegistry.UNLIT_SOUL_TORCH, BlockRegistry.UNLIT_SOUL_WALL_TORCH, new Item.Settings().group(ItemGroup.DECORATIONS), Items.SOUL_TORCH));
public static final Item UNLIT_TORCH = add("unlit_torch", new UnlitTorchItem(BlockRegistry.UNLIT_TORCH, BlockRegistry.UNLIT_WALL_TORCH, new Item.Settings().group(ItemGroup.DECORATIONS), Items.TORCH));
public static final Item GLOWSTONE_TORCH = add("glowstone_torch", new VerticallyAttachableBlockItem(BlockRegistry.GLOWSTONE_TORCH, BlockRegistry.GLOWSTONE_WALL_TORCH, new Item.Settings(), Direction.DOWN));
public static final Item GLOWSTONE_LANTERN = add("glowstone_lantern", new BlockItem(BlockRegistry.GLOWSTONE_LANTERN, new Item.Settings()));
public static final Item UNLIT_LANTERN = add("unlit_lantern", new UnlitLanternItem(BlockRegistry.UNLIT_LANTERN, new Item.Settings(), Items.LANTERN));
public static final Item UNLIT_SOUL_LANTERN = add("unlit_soul_lantern", new UnlitLanternItem(BlockRegistry.UNLIT_SOUL_LANTERN, new Item.Settings(), Items.SOUL_LANTERN));
public static final Item UNLIT_SOUL_TORCH = add("unlit_soul_torch", new UnlitTorchItem(BlockRegistry.UNLIT_SOUL_TORCH, BlockRegistry.UNLIT_SOUL_WALL_TORCH, new Item.Settings(), Direction.DOWN, Items.SOUL_TORCH));
public static final Item UNLIT_TORCH = add("unlit_torch", new UnlitTorchItem(BlockRegistry.UNLIT_TORCH, BlockRegistry.UNLIT_WALL_TORCH, new Item.Settings(), Direction.DOWN, Items.TORCH));

private static Item add(String path, Item item) {
return Registry.register(Registry.ITEM, new Identifier(TotallyLitModInitializer.IDENTIFIER, path), item);
return Registry.register(Registries.ITEM, new Identifier(TotallyLitModInitializer.IDENTIFIER, path), item);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import net.minecraft.block.Block;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.Item;
import net.minecraft.tag.TagKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

public class TagRegistry {
public static final TagKey<Block> TORCH_IGNITER_BLOCKS = TagKey.of(Registry.BLOCK_KEY, new Identifier(TotallyLitModInitializer.IDENTIFIER, "torch_igniters"));
public static final TagKey<Fluid> TORCH_IGNITER_FLUIDS = TagKey.of(Registry.FLUID_KEY, new Identifier(TotallyLitModInitializer.IDENTIFIER, "torch_igniters"));
public static final TagKey<Item> TORCH_IGNITER_ITEMS = TagKey.of(Registry.ITEM_KEY, new Identifier(TotallyLitModInitializer.IDENTIFIER, "torch_igniters"));
public static final TagKey<Block> TORCH_IGNITER_BLOCKS = TagKey.of(RegistryKeys.BLOCK, new Identifier(TotallyLitModInitializer.IDENTIFIER, "torch_igniters"));
public static final TagKey<Fluid> TORCH_IGNITER_FLUIDS = TagKey.of(RegistryKeys.FLUID, new Identifier(TotallyLitModInitializer.IDENTIFIER, "torch_igniters"));
public static final TagKey<Item> TORCH_IGNITER_ITEMS = TagKey.of(RegistryKeys.ITEM, new Identifier(TotallyLitModInitializer.IDENTIFIER, "torch_igniters"));
}
8 changes: 4 additions & 4 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
},
"depends": {
"java": ">=17",
"minecraft": ["1.19", "1.19.1", "1.19.2"],
"fabricloader": ">=0.14.6",
"fabric": "*",
"cloth-config": "^8.0.0"
"minecraft": "1.19.3",
"fabricloader": ">=0.14.12",
"fabric-api": "*",
"cloth-config": "^9.0.0"
},
"conflicts": {
"fading": "*",
Expand Down

0 comments on commit e077ce4

Please sign in to comment.