fixes the cutout bug, see #2
This commit is contained in:
@@ -12,7 +12,7 @@ loader_version=0.18.4
|
||||
loom_version=1.14-SNAPSHOT
|
||||
|
||||
# Mod Properties
|
||||
mod_version=26.1.2
|
||||
mod_version=26.1.3
|
||||
maven_group=de.jottyfan.minecraft
|
||||
archives_base_name=quickly
|
||||
|
||||
|
||||
@@ -7,11 +7,15 @@ import net.minecraft.world.Containers;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
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.state.BlockState;
|
||||
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;
|
||||
|
||||
public BlockPlant(Properties properties, Identifier seedName, Identifier fruitName) {
|
||||
super(properties);
|
||||
super(properties.noOcclusion().dynamicShape());
|
||||
this.seedName = seedName;
|
||||
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() {
|
||||
return QuicklyItems.of(seedName);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,34 @@
|
||||
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.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
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
|
||||
*
|
||||
*/
|
||||
@Mixin(MinecraftServer.class)
|
||||
@Mixin(ItemBlockRenderTypes.class)
|
||||
public class QuicklyMixin {
|
||||
@Inject(at = @At("HEAD"), method = "loadLevel")
|
||||
private void init(CallbackInfo info) {
|
||||
@Shadow
|
||||
@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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user