Skip to content

Commit

Permalink
Updated to Minecraft 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed Dec 9, 2023
1 parent e4ddf4d commit df7b80f
Show file tree
Hide file tree
Showing 50 changed files with 347 additions and 568 deletions.
27 changes: 11 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "net.minecraftforge.gradle" version "6.0.+"
id "net.minecraftforge.gradle" version "6.+"
id "org.spongepowered.mixin" version "0.7-SNAPSHOT"
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.modrinth.minotaur" version "2.+"
Expand Down Expand Up @@ -52,32 +52,17 @@ minecraft {
workingDirectory = project.file("run")
ideaModule "${project.name}.main"
taskName 'Client'
mods {
modClientRun {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
ideaModule "${project.name}.main"
taskName 'Server'
mods {
modServerRun {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
ideaModule "${project.name}.main"
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
taskName 'Data'
mods {
modDataRun {
source sourceSets.main
}
}
}
}
}
Expand All @@ -97,6 +82,16 @@ sourceSets {
}
}

// Merge the resources and classes into the same directory.
// This is done because java expects modules to be in a single directory.
// And if we have it in multiple we have to do performance intensive hacks like having the UnionFileSystem
// This will eventually be migrated to ForgeGradle so modders don't need to manually do it. But that is later.
sourceSets.each {
def dir = layout.buildDirectory.dir("sourcesSets/$it.name")
it.output.resourcesDir = dir
it.java.destinationDirectory = dir
}

dependencies {
minecraft 'net.minecraftforge:forge:' + minecraft_version + '-' + forge_version
implementation fg.deobf("com.github.glitchfiend:TerraBlender-forge:${terrablender_version}")
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ mod_curseforge_id=220318
mod_modrinth_id=biomes-o-plenty

# Dependencies
minecraft_version=1.20.2
forge_version=48.0.1
terrablender_version=1.20.2-3.0.0.170
minecraft_version=1.20.4
forge_version=49.0.3
terrablender_version=1.20.4-3.3.0.4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.2 2023-12-02T00:39:59.5611429 Registries
// 1.20.4 2023-12-09T20:21:39.0210994 Registries
a09ddf53150a7fcf8767a311dd5cf040fa2e9221 data/biomesoplenty/damage_type/bramble.json
2d0eab2cc85c4c6397fdc41dd0cedefbc4a7a150 data/biomesoplenty/damage_type/fumarole.json
1db19ce8d33b8c131955b60ed830200bbee6a912 data/biomesoplenty/worldgen/biome/aspen_glade.json
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/biomesoplenty/common/block/BrambleBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.damagesource.BOPDamageTypes;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.entity.Entity;
Expand All @@ -22,11 +23,19 @@

public class BrambleBlock extends PipeBlock
{
public static final MapCodec<BrambleBlock> CODEC = simpleCodec(BrambleBlock::new);

public BrambleBlock(Block.Properties builder)
{
super(0.25F, builder);
this.registerDefaultState(this.stateDefinition.any().setValue(NORTH, Boolean.valueOf(false)).setValue(EAST, Boolean.valueOf(false)).setValue(SOUTH, Boolean.valueOf(false)).setValue(WEST, Boolean.valueOf(false)).setValue(UP, Boolean.valueOf(false)).setValue(DOWN, Boolean.valueOf(false)));
}

@Override
public MapCodec<BrambleBlock> codec()
{
return CODEC;
}

@Override
public BlockState getStateForPlacement(BlockPlaceContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package biomesoplenty.common.block;

import biomesoplenty.api.block.BOPBlocks;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.item.context.BlockPlaceContext;
Expand All @@ -25,6 +26,7 @@

public class BrambleLeavesBlock extends DirectionalBlock
{
public static final MapCodec<BrambleLeavesBlock> CODEC = simpleCodec(BrambleLeavesBlock::new);
protected static final VoxelShape HORIZONTAL = Block.box(0.0D, 4.0D, 0.0D, 16.0D, 12.0D, 16.0D);
protected static final VoxelShape VERTICAL = Block.box(0.0D, 0.0D, 4.0D, 16.0D, 16.0D, 12.0D);

Expand All @@ -34,6 +36,12 @@ public BrambleLeavesBlock(Properties properties)
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.UP));
}

@Override
public MapCodec<BrambleLeavesBlock> codec()
{
return CODEC;
}

@Override
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class CeilingHangingSignBlockBOP extends CeilingHangingSignBlock
{
public CeilingHangingSignBlockBOP(Properties properties, WoodType type)
{
super(properties, type);
super(type, properties);
}

@Override
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/biomesoplenty/common/block/FoliageBlockBOP.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package biomesoplenty.common.block;

import biomesoplenty.api.block.BOPBlocks;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.stats.Stats;
Expand All @@ -27,6 +28,7 @@

public class FoliageBlockBOP extends BushBlock implements IPlantable
{
public static final MapCodec<FoliageBlockBOP> CODEC = simpleCodec(FoliageBlockBOP::new);
protected static final VoxelShape NORMAL = Block.box(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
protected static final VoxelShape SHORT = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 7.0D, 15.0D);

Expand All @@ -35,6 +37,12 @@ public FoliageBlockBOP(Block.Properties properties)
super(properties);
}

@Override
public MapCodec<FoliageBlockBOP> codec()
{
return CODEC;
}

@Override
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext selectionContext)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
******************************************************************************/
package biomesoplenty.common.block;

import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
Expand All @@ -19,13 +20,20 @@

public class HangingStrandBlock extends GrowingPlantBodyBlock
{
public static final MapCodec<HangingStrandBlock> CODEC = simpleCodec(HangingStrandBlock::new);
public static final VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D);

public HangingStrandBlock(Properties properties)
{
super(properties, Direction.DOWN, SHAPE, false);
}

@Override
public MapCodec<HangingStrandBlock> codec()
{
return CODEC;
}

@Override
protected GrowingPlantHeadBlock getHeadBlock() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
******************************************************************************/
package biomesoplenty.common.block;

import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
Expand All @@ -18,10 +19,17 @@

public class HangingStrandBottomBlock extends GrowingPlantHeadBlock
{
public static final MapCodec<HangingStrandBottomBlock> CODEC = simpleCodec(HangingStrandBottomBlock::new);
protected static final VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D);

public HangingStrandBottomBlock(Properties p_i241194_1_) {
super(p_i241194_1_, Direction.DOWN, SHAPE, false, 0.01D);
public HangingStrandBottomBlock(Properties properties) {
super(properties, Direction.DOWN, SHAPE, false, 0.01D);
}

@Override
public MapCodec<HangingStrandBottomBlock> codec()
{
return CODEC;
}

@Override
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/biomesoplenty/common/block/HighGrassBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package biomesoplenty.common.block;

import biomesoplenty.api.block.BOPBlocks;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
Expand All @@ -20,6 +21,7 @@

public class HighGrassBlock extends GrowingPlantHeadBlock
{
public static final MapCodec<HighGrassBlock> CODEC = simpleCodec(HighGrassBlock::new);
public static final VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D);
public static final int MAX_AGE = 8;
private final double growPerTickProbability;
Expand All @@ -29,6 +31,12 @@ public HighGrassBlock(Properties p_i241195_1_) {
this.growPerTickProbability = 0.01D;
}

@Override
public MapCodec<HighGrassBlock> codec()
{
return CODEC;
}

@Override
public BlockState getStateForPlacement(LevelAccessor p_53949_) {
return this.defaultBlockState().setValue(AGE, Integer.valueOf(p_53949_.getRandom().nextInt(MAX_AGE)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package biomesoplenty.common.block;

import biomesoplenty.api.block.BOPBlocks;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.tags.BlockTags;
Expand All @@ -19,12 +20,19 @@

public class HighGrassPlantBlock extends GrowingPlantBodyBlock
{
public static final MapCodec<HighGrassPlantBlock> CODEC = simpleCodec(HighGrassPlantBlock::new);
public static final VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D);

public HighGrassPlantBlock(Properties p_i241195_1_) {
super(p_i241195_1_, Direction.UP, SHAPE, false);
}

@Override
public MapCodec<HighGrassPlantBlock> codec()
{
return CODEC;
}

@Override
protected GrowingPlantHeadBlock getHeadBlock() {
return (GrowingPlantHeadBlock) BOPBlocks.HIGH_GRASS.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
******************************************************************************/
package biomesoplenty.common.block;

import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.tags.BlockTags;
Expand All @@ -25,6 +26,7 @@

public class HugeCloverPetalBlock extends HorizontalDirectionalBlock implements IPlantable
{
public static final MapCodec<HugeCloverPetalBlock> CODEC = simpleCodec(HugeCloverPetalBlock::new);
public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING;
public static final VoxelShape SHAPE = Block.box(0.0D, 13.0D, 0.0D, 16.0D, 15.0D, 16.0D);

Expand All @@ -34,6 +36,12 @@ public HugeCloverPetalBlock(Properties properties)
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH));
}

@Override
public MapCodec<HugeCloverPetalBlock> codec()
{
return CODEC;
}

@Override
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) {
return SHAPE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package biomesoplenty.common.block;

import biomesoplenty.common.block.state.properties.QuarterProperty;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
Expand All @@ -31,6 +32,7 @@

public class HugeLilyPadBlock extends BushBlock
{
public static final MapCodec<HugeLilyPadBlock> CODEC = simpleCodec(HugeLilyPadBlock::new);
public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING;
public static final EnumProperty<QuarterProperty> QUARTER = EnumProperty.create("quarter", QuarterProperty.class);

Expand All @@ -42,6 +44,12 @@ public HugeLilyPadBlock(Properties properties)
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(QUARTER, QuarterProperty.SOUTH_WEST));
}

@Override
public MapCodec<HugeLilyPadBlock> codec()
{
return CODEC;
}

@Override
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context)
{
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/biomesoplenty/common/block/LeafPileBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
******************************************************************************/
package biomesoplenty.common.block;

import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.stats.Stats;
Expand All @@ -26,13 +27,20 @@

public class LeafPileBlock extends BushBlock implements IPlantable
{
public static final MapCodec<LeafPileBlock> CODEC = simpleCodec(LeafPileBlock::new);
protected static final VoxelShape NORMAL = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 4.0D, 16.0D);

public LeafPileBlock(Properties properties)
{
super(properties);
}

@Override
public MapCodec<LeafPileBlock> codec()
{
return CODEC;
}

@Override
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext selectionContext)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public class MushroomBlockBOP extends MushroomBlock implements BonemealableBlock
{
public MushroomBlockBOP(Block.Properties properties)
{
super(properties, null);
super(null, properties);
}

@Override
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random)
{
Expand Down
Loading

0 comments on commit df7b80f

Please sign in to comment.