Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ archivesBaseName = 'grassslabs'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

minecraft {
mappings channel: 'official', version: '1.19.2'
mappings channel: 'official', version: '1.20.1'

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

Expand Down Expand Up @@ -54,6 +54,6 @@ minecraft {
jar.finalizedBy('reobfJar')

dependencies {
minecraft 'net.minecraftforge:forge:1.19.2-43.1.15'
minecraft 'net.minecraftforge:forge:1.20.1-47.2.20'
}

14 changes: 4 additions & 10 deletions src/main/java/com/kuraion/grassslabs/block/DirtCarpetBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,22 @@
package com.kuraion.grassslabs.block;

import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.CarpetBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootParams;

import java.util.Collections;
import java.util.List;

public class DirtCarpetBlock extends CarpetBlock {
public DirtCarpetBlock() {
super(Properties.of(Material.DIRT).sound(SoundType.GRAVEL).strength(0.1f, 0.1f).lightLevel(s -> 0));
super(Properties.copy(Blocks.DIRT).sound(SoundType.GRAVEL).strength(0.1f, 0.1f).lightLevel(s -> 0));
}

@Override
public MaterialColor defaultMaterialColor() {
return MaterialColor.DIRT;
}

@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,22 @@
package com.kuraion.grassslabs.block;

import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.CarpetBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootParams;

import java.util.Collections;
import java.util.List;

public class DirtPathCarpetBlock extends CarpetBlock {
public DirtPathCarpetBlock() {
super(Properties.of(Material.DIRT).sound(SoundType.GRASS).strength(0.1f, 0.1f).lightLevel(s -> 0));
super(Properties.copy(Blocks.DIRT).sound(SoundType.GRASS).strength(0.1f, 0.1f).lightLevel(s -> 0));
}

@Override
public MaterialColor defaultMaterialColor() {
return MaterialColor.DIRT;
}

@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
Expand Down
17 changes: 5 additions & 12 deletions src/main/java/com/kuraion/grassslabs/block/DirtPathSlabBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SlabBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.SlabType;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
Expand All @@ -27,7 +25,7 @@

public class DirtPathSlabBlock extends SlabBlock {
public DirtPathSlabBlock() {
super(Properties.of(Material.DIRT).sound(SoundType.GRASS).strength(0.65f, 0.65f).lightLevel(s -> 0));
super(Properties.copy(Blocks.DIRT).sound(SoundType.GRASS).strength(0.65f, 0.65f).lightLevel(s -> 0));
}

protected static final VoxelShape BOTTOM_AABB = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
Expand All @@ -47,16 +45,11 @@ public VoxelShape getShape(@NotNull BlockState p_56390_, BlockGetter p_56391_, B
}

@Override
public MaterialColor defaultMaterialColor() {
return MaterialColor.DIRT;
}

@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
return Collections.singletonList(new ItemStack(this, state.getValue(TYPE) == SlabType.DOUBLE ? 2 : 1));
return Collections.singletonList(new ItemStack(this, 1));
}

@OnlyIn(Dist.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@

import com.kuraion.grassslabs.init.GrassslabsModBlocks;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.StairBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootParams;

import java.util.Collections;
import java.util.List;

public class DirtPathStairsBlock extends StairBlock {
public DirtPathStairsBlock() {
super(() -> (GrassslabsModBlocks.DIRT_PATH_SLAB.get()).defaultBlockState(), Properties.of(Material.DIRT).sound(SoundType.GRAVEL).strength(0.5f, 0.5f).lightLevel(s -> 0).dynamicShape());
super(() -> (GrassslabsModBlocks.DIRT_PATH_SLAB.get()).defaultBlockState(), Properties.copy(Blocks.DIRT).sound(SoundType.GRAVEL).strength(0.5f, 0.5f).lightLevel(s -> 0).dynamicShape());
}

@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
Expand Down
17 changes: 5 additions & 12 deletions src/main/java/com/kuraion/grassslabs/block/DirtSlabBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,25 @@
package com.kuraion.grassslabs.block;

import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SlabBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.SlabType;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootParams;

import java.util.Collections;
import java.util.List;

public class DirtSlabBlock extends SlabBlock {
public DirtSlabBlock() {
super(Properties.of(Material.DIRT).sound(SoundType.GRAVEL).strength(0.5f, 0.5f).lightLevel(s -> 0));
super(Properties.copy(Blocks.DIRT).sound(SoundType.GRAVEL).strength(0.5f, 0.5f).lightLevel(s -> 0));
}

@Override
public MaterialColor defaultMaterialColor() {
return MaterialColor.DIRT;
}

@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
return Collections.singletonList(new ItemStack(this, state.getValue(TYPE) == SlabType.DOUBLE ? 2 : 1));
return Collections.singletonList(new ItemStack(this, 1));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

import com.kuraion.grassslabs.init.GrassslabsModBlocks;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.StairBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootParams;

import java.util.Collections;
import java.util.List;

public class DirtStairsBlock extends StairBlock {
public DirtStairsBlock() {
super(() -> (GrassslabsModBlocks.DIRT_SLAB.get()).defaultBlockState(), Properties.of(Material.DIRT).sound(SoundType.GRAVEL).strength(0.5f, 0.5f).lightLevel(s -> 0).dynamicShape());
super(() -> (GrassslabsModBlocks.DIRT_SLAB.get()).defaultBlockState(), Properties.copy(Blocks.DIRT).sound(SoundType.GRAVEL).strength(0.5f, 0.5f).lightLevel(s -> 0).dynamicShape());
}

@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
Expand Down
14 changes: 4 additions & 10 deletions src/main/java/com/kuraion/grassslabs/block/GrassCarpetBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.GrassColor;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.CarpetBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.RegisterColorHandlersEvent;
Expand All @@ -28,17 +27,12 @@ public class GrassCarpetBlock extends CarpetBlock {
private final Supplier<BlockState> flattenedBlock;

public GrassCarpetBlock(RegistryObject<DirtPathCarpetBlock> flattenedBlock) {
super(Properties.of(Material.GRASS).sound(SoundType.GRASS).strength(0.1f, 0.1f).lightLevel(s -> 0));
super(Properties.copy(Blocks.GRASS_BLOCK).sound(SoundType.GRASS).strength(0.1f, 0.1f).lightLevel(s -> 0));
this.flattenedBlock = flattenedBlock == null ? null : () -> flattenedBlock.get().defaultBlockState();
}

@Override
public MaterialColor defaultMaterialColor() {
return MaterialColor.GRASS;
}

@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
Expand Down
17 changes: 5 additions & 12 deletions src/main/java/com/kuraion/grassslabs/block/GrassSlabBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.GrassColor;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SlabBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.SlabType;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.RegisterColorHandlersEvent;
Expand All @@ -31,21 +29,16 @@ public class GrassSlabBlock extends SlabBlock {
private final Supplier<BlockState> flattenedBlock;

public GrassSlabBlock(RegistryObject<DirtPathSlabBlock> flattenedBlock) {
super(Properties.of(Material.GRASS).sound(SoundType.GRASS).strength(0.6f, 0.6f).lightLevel(s -> 0));
super(Properties.copy(Blocks.GRASS_BLOCK).sound(SoundType.GRASS).strength(0.6f, 0.6f).lightLevel(s -> 0));
this.flattenedBlock = flattenedBlock == null ? null : () -> flattenedBlock.get().defaultBlockState();
}

@Override
public MaterialColor defaultMaterialColor() {
return MaterialColor.GRASS;
}

@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
return Collections.singletonList(new ItemStack(this, state.getValue(TYPE) == SlabType.DOUBLE ? 2 : 1));
return Collections.singletonList(new ItemStack(this, 1));
}

@OnlyIn(Dist.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.GrassColor;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.StairBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.RegisterColorHandlersEvent;
Expand All @@ -29,12 +29,12 @@ public class GrassStairsBlock extends StairBlock {
private final Supplier<BlockState> flattenedBlock;

public GrassStairsBlock(RegistryObject<DirtPathStairsBlock> flattenedBlock) {
super(() -> (GrassslabsModBlocks.GRASS_SLAB.get()).defaultBlockState(), Properties.of(Material.DIRT).sound(SoundType.GRAVEL).strength(0.5f, 0.5f).lightLevel(s -> 0).dynamicShape());
super(() -> (GrassslabsModBlocks.GRASS_SLAB.get()).defaultBlockState(), Properties.copy(Blocks.GRASS_BLOCK).sound(SoundType.GRAVEL).strength(0.5f, 0.5f).lightLevel(s -> 0).dynamicShape());
this.flattenedBlock = flattenedBlock == null ? null : () -> flattenedBlock.get().defaultBlockState();
}

@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,22 @@
package com.kuraion.grassslabs.block;

import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.CarpetBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootParams;

import java.util.Collections;
import java.util.List;

public class MyceliumCarpetBlock extends CarpetBlock {
public MyceliumCarpetBlock() {
super(Properties.of(Material.GRASS).sound(SoundType.GRASS).strength(0.5f, 0.6f).lightLevel(s -> 0));
super(Properties.copy(Blocks.MYCELIUM).sound(SoundType.GRASS).strength(0.5f, 0.6f).lightLevel(s -> 0));
}

@Override
public MaterialColor defaultMaterialColor() { return MaterialColor.GRASS; }

@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
Expand Down
17 changes: 5 additions & 12 deletions src/main/java/com/kuraion/grassslabs/block/MyceliumSlabBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,25 @@
package com.kuraion.grassslabs.block;

import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SlabBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.SlabType;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.LootParams;

import java.util.Collections;
import java.util.List;

public class MyceliumSlabBlock extends SlabBlock {
public MyceliumSlabBlock() {
super(Properties.of(Material.GRASS).sound(SoundType.GRASS).strength(0.5f, 0.6f).lightLevel(s -> 0));
super(Properties.copy(Blocks.MYCELIUM).sound(SoundType.GRASS).strength(0.5f, 0.6f).lightLevel(s -> 0));
}

@Override
public MaterialColor defaultMaterialColor() {
return MaterialColor.GRASS;
}

@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
return Collections.singletonList(new ItemStack(this, state.getValue(TYPE) == SlabType.DOUBLE ? 2 : 1));
return Collections.singletonList(new ItemStack(this, 1));
}
}
Loading