Skip to content

Commit

Permalink
Merge pull request #4 from bl4ckscor3/1.19
Browse files Browse the repository at this point in the history
Update to 1.19
  • Loading branch information
realmayus committed Jul 21, 2022
2 parents 2f9010e + 6dc3eab commit 8167790
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 63 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ out/
# mpeltonen/sbt-idea plugin
.idea_modules/

# Eclipse
.settings/
bin/
.classpath
*.launch
.project

# JIRA plugin
atlassian-ide-plugin.xml

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Ever wondered what to do with glowing ink sacs aside from glowing item frames? A

Slightly brighter at light level 15, Aquatic Torches enable you to illuminate the entrance of your underwater bases and bring light to the vast darkness of the oceans.

It's available for Forge and [Fabric](https://github.com/realmayus/aquatictorches-fabric) on both 1.17 and 1.18.
It's available for Forge and [Fabric](https://github.com/realmayus/aquatictorches-fabric) on 1.17, 1.18, and 1.19.

## [More Info & Download on CurseForge](https://www.curseforge.com/minecraft/mc-mods/aquatic-torches)

Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ group = 'realmayus'
version = '1.1.0'

java {
archivesBaseName = 'aquatictorches-1.18'
archivesBaseName = 'aquatictorches-1.19'
toolchain.languageVersion = JavaLanguageVersion.of(17)
}

Expand All @@ -31,7 +31,7 @@ minecraft {
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'official', version: '1.18.1'
mappings channel: 'official', version: '1.19'

// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

Expand Down Expand Up @@ -126,7 +126,7 @@ dependencies {
// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.18.1-39.0.9'
minecraft 'net.minecraftforge:forge:1.19-41.0.64'

// Real mod deobf dependency examples - these get remapped to your current mappings
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 4 additions & 4 deletions src/main/java/realmayus/aquatictorches/AquaticTorchBlock.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package realmayus.aquatictorches;

import javax.annotation.Nullable;

import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.util.RandomSource;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
Expand All @@ -19,9 +22,6 @@
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;

import javax.annotation.Nullable;
import java.util.Random;

public class AquaticTorchBlock extends TorchBlock implements SimpleWaterloggedBlock {
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public static final IntegerProperty FLOWING_WATER = IntegerProperty.create("water_level", 1, 8);
Expand Down Expand Up @@ -65,7 +65,7 @@ public FluidState getFluidState(BlockState blockState) {
}

@Override
public void animateTick(BlockState blockState, Level level, BlockPos blockPos, Random random) {
public void animateTick(BlockState blockState, Level level, BlockPos blockPos, RandomSource random) {
double d0 = (double)blockPos.getX() + 0.5D;
double d1 = (double)blockPos.getY() + 0.7D;
double d2 = (double)blockPos.getZ() + 0.5D;
Expand Down
39 changes: 17 additions & 22 deletions src/main/java/realmayus/aquatictorches/AquaticTorches.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package realmayus.aquatictorches;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
Expand All @@ -8,38 +11,30 @@
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.Material;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.ObjectHolder;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;


@Mod("aquatictorches")
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public class AquaticTorches {

private static final Logger LOGGER = LogManager.getLogger();
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, "aquatictorches");
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, "aquatictorches");
public static final RegistryObject<AquaticTorchBlock> AQUATIC_TORCH = BLOCKS.register("aquatic_torch", () -> new AquaticTorchBlock(BlockBehaviour.Properties.of(Material.DECORATION).noCollission().instabreak().lightLevel((p_50886_) -> 15).sound(SoundType.WOOD), ParticleTypes.FLAME));
public static final RegistryObject<AquaticWallTorchBlock> AQUATIC_WALL_TORCH = BLOCKS.register("aquatic_wall_torch", () -> new AquaticWallTorchBlock(BlockBehaviour.Properties.of(Material.DECORATION).noCollission().instabreak().lightLevel((p_152607_) -> 15).sound(SoundType.WOOD).lootFrom(AQUATIC_TORCH), ParticleTypes.FLAME));
public static final RegistryObject<StandingAndWallBlockItem> AQUATIC_TORCH_ITEM = ITEMS.register("aquatic_torch", () -> new StandingAndWallBlockItem(AQUATIC_TORCH.get(), AQUATIC_WALL_TORCH.get(), new Item.Properties().tab(CreativeModeTab.TAB_DECORATIONS)));

public AquaticTorches() {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();

BLOCKS.register(modEventBus);
ITEMS.register(modEventBus);
LOGGER.info("Aquatic Torches loaded.");
}

@ObjectHolder("aquatictorches:aquatic_torch")
public static AquaticTorchBlock AQUATIC_TORCH;

@ObjectHolder("aquatictorches:aquatic_wall_torch")
public static AquaticWallTorchBlock AQUATIC_WALL_TORCH;

@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event) {
event.getRegistry().register(new AquaticTorchBlock(BlockBehaviour.Properties.of(Material.DECORATION).noCollission().instabreak().lightLevel((p_50886_) -> 15).sound(SoundType.WOOD), ParticleTypes.FLAME).setRegistryName("aquatictorches:aquatic_torch"));
event.getRegistry().register(new AquaticWallTorchBlock(BlockBehaviour.Properties.of(Material.DECORATION).noCollission().instabreak().lightLevel((p_152607_) -> 15).sound(SoundType.WOOD).lootFrom(() -> AQUATIC_TORCH), ParticleTypes.FLAME).setRegistryName("aquatictorches:aquatic_wall_torch"));
}

@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event) {
event.getRegistry().register(new StandingAndWallBlockItem(AQUATIC_TORCH, AQUATIC_WALL_TORCH, new Item.Properties().tab(CreativeModeTab.TAB_DECORATIONS)).setRegistryName("aquatictorches:aquatic_torch"));
}
}
19 changes: 13 additions & 6 deletions src/main/java/realmayus/aquatictorches/AquaticWallTorchBlock.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
package realmayus.aquatictorches;

import java.util.Map;

import javax.annotation.Nullable;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;

import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.util.RandomSource;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.TorchBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
Expand All @@ -23,10 +34,6 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

import javax.annotation.Nullable;
import java.util.Map;
import java.util.Random;

public class AquaticWallTorchBlock extends TorchBlock {
public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING;
public static final IntegerProperty FLOWING_WATER = IntegerProperty.create("water_level", 1, 8);
Expand Down Expand Up @@ -116,7 +123,7 @@ public FluidState getFluidState(BlockState blockState) {
}

@Override
public void animateTick(BlockState blockState, Level level, BlockPos blockPos, Random random) {
public void animateTick(BlockState blockState, Level level, BlockPos blockPos, RandomSource random) {
Direction direction = blockState.getValue(FACING);
double d0 = (double)blockPos.getX() + 0.5D;
double d1 = (double)blockPos.getY() + 0.7D;
Expand Down
21 changes: 0 additions & 21 deletions src/main/java/realmayus/aquatictorches/ClientRegistry.java

This file was deleted.

6 changes: 3 additions & 3 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[39,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
loaderVersion="[41,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
license="MIT"
Expand Down Expand Up @@ -43,7 +43,7 @@ Torches made from glowing squids that can be used underwater!
# Does this dependency have to exist - if not, ordering below must be specified
mandatory=true #mandatory
# The version range of the dependency
versionRange="[39,)" #mandatory
versionRange="[41.0.64,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
Expand All @@ -53,6 +53,6 @@ Torches made from glowing squids that can be used underwater!
modId="minecraft"
mandatory=true
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="[1.18,1.19)"
versionRange="[1.19,1.20)"
ordering="NONE"
side="BOTH"
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"parent": "minecraft:block/template_torch",
"render_type": "minecraft:cutout",
"textures": {
"torch": "aquatictorches:block/aquatic_torch"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"parent": "minecraft:block/template_torch_wall",
"render_type": "minecraft:cutout",
"textures": {
"torch": "aquatictorches:block/aquatic_torch"
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"pack": {
"description": "aquatictorches resources",
"pack_format": 8
"description": "aquatictorches resources & data",
"pack_format": 9,
"forge:data_pack_format": 10
}
}

0 comments on commit 8167790

Please sign in to comment.