Compare commits

..

2 Commits

Author SHA1 Message Date
Jottyfan
595901802c fixes the cutout bug, see #2 2026-01-15 23:31:44 +01:00
Jottyfan
ef0a496cc7 cutout experiences 2026-01-15 23:06:33 +01:00
27 changed files with 56 additions and 23 deletions

View File

@@ -12,7 +12,7 @@ loader_version=0.18.4
loom_version=1.14-SNAPSHOT loom_version=1.14-SNAPSHOT
# Mod Properties # Mod Properties
mod_version=26.1.2 mod_version=26.1.3
maven_group=de.jottyfan.minecraft maven_group=de.jottyfan.minecraft
archives_base_name=quickly archives_base_name=quickly

View File

@@ -7,11 +7,15 @@ import net.minecraft.world.Containers;
import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.CropBlock; import net.minecraft.world.level.block.CropBlock;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
/** /**
* *
@@ -24,11 +28,26 @@ public class BlockPlant extends CropBlock {
private Identifier fruitName; private Identifier fruitName;
public BlockPlant(Properties properties, Identifier seedName, Identifier fruitName) { public BlockPlant(Properties properties, Identifier seedName, Identifier fruitName) {
super(properties); super(properties.noOcclusion().dynamicShape());
this.seedName = seedName; this.seedName = seedName;
this.fruitName = fruitName; this.fruitName = fruitName;
} }
@Override
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return Block.box(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
}
@Override
protected float getShadeBrightness(BlockState state, BlockGetter level, BlockPos pos) {
return 1.0F;
}
@Override
protected boolean propagatesSkylightDown(BlockState state) {
return true;
}
public ItemLike getSeed() { public ItemLike getSeed() {
return QuicklyItems.of(seedName); return QuicklyItems.of(seedName);
} }

View File

@@ -1,20 +1,34 @@
package de.jottyfan.minecraft.mixin; package de.jottyfan.minecraft.mixin;
import java.util.Map;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.server.MinecraftServer; import de.jottyfan.minecraft.block.QuicklyBlocks;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
import net.minecraft.client.renderer.chunk.ChunkSectionLayer;
import net.minecraft.world.level.block.Block;
/** /**
* *
* @author jotty * @author jotty
* *
*/ */
@Mixin(MinecraftServer.class) @Mixin(ItemBlockRenderTypes.class)
public class QuicklyMixin { public class QuicklyMixin {
@Inject(at = @At("HEAD"), method = "loadLevel") @Shadow
private void init(CallbackInfo info) { @Final
private static Map<Block, ChunkSectionLayer> TYPE_BY_BLOCK;
@Inject(method = "<clinit>", at = @At("RETURN"))
private static void onStaticInit(CallbackInfo info) {
ChunkSectionLayer cutout = ChunkSectionLayer.CUTOUT;
TYPE_BY_BLOCK.put(QuicklyBlocks.CANOLAPLANT, cutout);
TYPE_BY_BLOCK.put(QuicklyBlocks.COTTONPLANT, cutout);
} }
} }

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent": "minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/canolaplant0" "cross":"quickly:block/canolaplant0"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/canolaplant1" "cross":"quickly:block/canolaplant1"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/canolaplant2" "cross":"quickly:block/canolaplant2"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/canolaplant3" "cross":"quickly:block/canolaplant3"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/canolaplant4" "cross":"quickly:block/canolaplant4"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/canolaplant5" "cross":"quickly:block/canolaplant5"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/canolaplant6" "cross":"quickly:block/canolaplant6"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/canolaplant7" "cross":"quickly:block/canolaplant7"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/cottonplant0" "cross":"quickly:block/cottonplant0"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/cottonplant1" "cross":"quickly:block/cottonplant1"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/cottonplant2" "cross":"quickly:block/cottonplant2"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/cottonplant3" "cross":"quickly:block/cottonplant3"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/cottonplant4" "cross":"quickly:block/cottonplant4"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/cottonplant5" "cross":"quickly:block/cottonplant5"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/cottonplant6" "cross":"quickly:block/cottonplant6"

View File

@@ -1,5 +1,5 @@
{ {
"parent":"block/cross", "parent":"minecraft:block/cross",
"render_type": "minecraft:cutout", "render_type": "minecraft:cutout",
"textures":{ "textures":{
"cross":"quickly:block/cottonplant7" "cross":"quickly:block/cottonplant7"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 645 B