snapshot version
This commit is contained in:
parent
8661f7f12e
commit
96a334448e
@ -4,17 +4,17 @@
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/versions.html
|
||||
minecraft_version=1.20.2
|
||||
yarn_mappings=1.20.2+build.1
|
||||
loader_version=0.14.22
|
||||
minecraft_version=23w45a
|
||||
yarn_mappings=23w45a+build.10
|
||||
loader_version=0.14.24
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.20.2.2
|
||||
mod_version = 1.20.3.0
|
||||
maven_group = de.jottyfan.minecraft
|
||||
archives_base_name = quickiefabric
|
||||
|
||||
# Dependencies
|
||||
fabric_version=0.89.1+1.20.2
|
||||
fabric_version=0.90.8+1.20.3
|
||||
|
||||
# for ExtendedLeavesBlock
|
||||
terraform_wood_api_version=7.0.1
|
||||
terraform_wood_api_version=9.0.0-alpha.3
|
||||
|
@ -81,7 +81,7 @@ public class ItemHoarderBlockEntity extends LootableContainerBlockEntity {
|
||||
@Override
|
||||
public void writeNbt(NbtCompound nbt) {
|
||||
super.writeNbt(nbt);
|
||||
if (!this.serializeLootTable(nbt)) {
|
||||
if (!this.writeLootTable(nbt)) {
|
||||
Inventories.writeNbt(nbt, this.stacks);
|
||||
}
|
||||
}
|
||||
@ -90,7 +90,7 @@ public class ItemHoarderBlockEntity extends LootableContainerBlockEntity {
|
||||
public void readNbt(NbtCompound nbt) {
|
||||
super.readNbt(nbt);
|
||||
this.stacks = DefaultedList.ofSize(this.size(), ItemStack.EMPTY);
|
||||
if (!this.deserializeLootTable(nbt)) {
|
||||
if (!this.readLootTable(nbt)) {
|
||||
Inventories.readNbt(nbt, this.stacks);
|
||||
}
|
||||
}
|
||||
@ -104,8 +104,8 @@ public class ItemHoarderBlockEntity extends LootableContainerBlockEntity {
|
||||
return 54; // container chest size (9 * 6)
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DefaultedList<ItemStack> getInvStackList() {
|
||||
@Override // before: getInvStackList
|
||||
protected DefaultedList<ItemStack> method_11282() {
|
||||
return stacks;
|
||||
}
|
||||
|
||||
|
@ -46,9 +46,9 @@ public class BlockCottonplant extends CropBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
|
||||
public BlockState onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
|
||||
spawnHarvested(world, pos, state);
|
||||
super.onBreak(world, pos, state, player);
|
||||
return super.onBreak(world, pos, state, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,11 +4,13 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.GravelBlock;
|
||||
import net.minecraft.block.FallingBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.loot.context.LootContextParameterSet.Builder;
|
||||
@ -18,7 +20,7 @@ import net.minecraft.loot.context.LootContextParameterSet.Builder;
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockDirtSalpeter extends GravelBlock {
|
||||
public class BlockDirtSalpeter extends FallingBlock {
|
||||
|
||||
public BlockDirtSalpeter() {
|
||||
super(FabricBlockSettings.create().hardness(3.1f));
|
||||
@ -35,4 +37,10 @@ public class BlockDirtSalpeter extends GravelBlock {
|
||||
: new ItemStack[] { salpeterStack, dirtStack };
|
||||
return Arrays.asList(spawnies);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends FallingBlock> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.DrillBlockDownEntity;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockEntityProvider;
|
||||
@ -48,4 +50,9 @@ public class BlockDrillDown extends FallingBlock implements BlockEntityProvider
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type){
|
||||
return (world1, pos, state1, be) -> DrillBlockDownEntity.tick(world1, pos, state1, be);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends FallingBlock> getCodec() {
|
||||
return null; // TODO: what to return here?
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.DrillBlockEastEntity;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockEntityProvider;
|
||||
@ -49,4 +51,10 @@ public class BlockDrillEast extends FallingBlock implements BlockEntityProvider
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type){
|
||||
return (world1, pos, state1, be) -> DrillBlockEastEntity.tick(world1, pos, state1, be);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends FallingBlock> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.DrillBlockNorthEntity;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockEntityProvider;
|
||||
@ -18,12 +20,12 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockDrillNorth extends FallingBlock implements BlockEntityProvider {
|
||||
|
||||
|
||||
public BlockDrillNorth() {
|
||||
super(FabricBlockSettings.create().hardness(2.5f));
|
||||
}
|
||||
@ -49,4 +51,10 @@ public class BlockDrillNorth extends FallingBlock implements BlockEntityProvider
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type){
|
||||
return (world1, pos, state1, be) -> DrillBlockNorthEntity.tick(world1, pos, state1, be);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends FallingBlock> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.DrillBlockSouthEntity;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockEntityProvider;
|
||||
@ -18,12 +20,12 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockDrillSouth extends FallingBlock implements BlockEntityProvider {
|
||||
|
||||
|
||||
public BlockDrillSouth() {
|
||||
super(FabricBlockSettings.create().hardness(2.5f));
|
||||
}
|
||||
@ -49,4 +51,10 @@ public class BlockDrillSouth extends FallingBlock implements BlockEntityProvider
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type){
|
||||
return (world1, pos, state1, be) -> DrillBlockSouthEntity.tick(world1, pos, state1, be);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends FallingBlock> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.DrillBlockWestEntity;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockEntityProvider;
|
||||
@ -18,12 +20,12 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockDrillWest extends FallingBlock implements BlockEntityProvider {
|
||||
|
||||
|
||||
public BlockDrillWest() {
|
||||
super(FabricBlockSettings.create().hardness(2.5f));
|
||||
}
|
||||
@ -49,4 +51,10 @@ public class BlockDrillWest extends FallingBlock implements BlockEntityProvider
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type){
|
||||
return (world1, pos, state1, be) -> DrillBlockWestEntity.tick(world1, pos, state1, be);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends FallingBlock> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class BlockItemhoarder extends Block implements BlockEntityProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
|
||||
public BlockState onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
if (blockEntity instanceof ItemHoarderBlockEntity) {
|
||||
ItemHoarderBlockEntity ihbe = (ItemHoarderBlockEntity) blockEntity;
|
||||
@ -69,7 +69,7 @@ public class BlockItemhoarder extends Block implements BlockEntityProvider {
|
||||
ItemScatterer.spawn(world, pos.getX(), pos.getY(), pos.getZ(), stack);
|
||||
}
|
||||
}
|
||||
super.onBreak(world, pos, state, player);
|
||||
return super.onBreak(world, pos, state, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,9 +3,11 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.GravelBlock;
|
||||
import net.minecraft.block.FallingBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.loot.context.LootContextParameterSet.Builder;
|
||||
@ -16,7 +18,7 @@ import net.minecraft.sound.BlockSoundGroup;
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockKelpstack extends GravelBlock {
|
||||
public class BlockKelpstack extends FallingBlock {
|
||||
|
||||
public BlockKelpstack() {
|
||||
super(FabricBlockSettings.create().hardness(0.1f).slipperiness(1.0f)
|
||||
@ -27,4 +29,10 @@ public class BlockKelpstack extends GravelBlock {
|
||||
public List<ItemStack> getDroppedStacks(BlockState blockState, Builder builder) {
|
||||
return Arrays.asList(new ItemStack[] { new ItemStack(Items.KELP, 9) });
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends FallingBlock> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ import net.minecraft.world.World;
|
||||
public class BlockLavahoarder extends Block implements BlockEntityProvider {
|
||||
|
||||
public BlockLavahoarder() {
|
||||
super(FabricBlockSettings.create().hardness(2.5f).luminance(16));
|
||||
super(FabricBlockSettings.create().hardness(2.5f).luminance(state -> 15));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,10 +5,7 @@ import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.MonsterHoarderBlockEntity;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockEntityProvider;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityTicker;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
@ -27,8 +24,9 @@ import net.minecraft.world.World;
|
||||
*/
|
||||
public class BlockMonsterhoarder extends Block implements BlockEntityProvider {
|
||||
|
||||
|
||||
public BlockMonsterhoarder() {
|
||||
super(FabricBlockSettings.create().hardness(2.5f).luminance(20));
|
||||
super(FabricBlockSettings.create().hardness(2.5f).luminance(state -> 15));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,6 +3,7 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
|
||||
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
@ -19,7 +20,7 @@ import net.minecraft.loot.context.LootContextParameterSet.Builder;
|
||||
public class BlockOreDeepslateSulphor extends ExperienceDroppingBlock {
|
||||
|
||||
public BlockOreDeepslateSulphor() {
|
||||
super(FabricBlockSettings.create().hardness(1.9f).requiresTool());
|
||||
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(1.9f).requiresTool());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,6 +3,7 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
|
||||
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
@ -19,7 +20,7 @@ import net.minecraft.loot.context.LootContextParameterSet.Builder;
|
||||
public class BlockOreNetherSulphor extends ExperienceDroppingBlock {
|
||||
|
||||
public BlockOreNetherSulphor() {
|
||||
super(FabricBlockSettings.create().hardness(2.1f).requiresTool());
|
||||
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(2.1f).requiresTool());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,6 +3,7 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
|
||||
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
@ -19,7 +20,7 @@ import net.minecraft.util.math.random.Random;
|
||||
public class BlockOreSalpeter extends ExperienceDroppingBlock {
|
||||
|
||||
public BlockOreSalpeter() {
|
||||
super(FabricBlockSettings.create().hardness(3.1f).requiresTool());
|
||||
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(3.1f).requiresTool());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,6 +3,7 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
|
||||
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
@ -20,7 +21,7 @@ import net.minecraft.util.math.random.Random;
|
||||
public class BlockOreSandSalpeter extends ExperienceDroppingBlock {
|
||||
|
||||
public BlockOreSandSalpeter() {
|
||||
super(FabricBlockSettings.create().hardness(2.9f).requiresTool());
|
||||
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(2.9f).requiresTool());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,6 +3,7 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
|
||||
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
@ -19,7 +20,7 @@ import net.minecraft.loot.context.LootContextParameterSet.Builder;
|
||||
public class BlockOreSulphor extends ExperienceDroppingBlock {
|
||||
|
||||
public BlockOreSulphor() {
|
||||
super(FabricBlockSettings.create().hardness(1.9f).requiresTool());
|
||||
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(1.9f).requiresTool());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,6 +3,7 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
|
||||
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
@ -18,7 +19,7 @@ import net.minecraft.loot.context.LootContextParameterSet.Builder;
|
||||
public class BlockSalpeter extends ExperienceDroppingBlock {
|
||||
|
||||
public BlockSalpeter() {
|
||||
super(FabricBlockSettings.create().hardness(0.5f));
|
||||
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(0.5f));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,11 +3,13 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.GravelBlock;
|
||||
import net.minecraft.block.FallingBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.loot.context.LootContextParameterSet.Builder;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
@ -17,7 +19,7 @@ import net.minecraft.util.math.random.Random;
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockSandSalpeter extends GravelBlock {
|
||||
public class BlockSandSalpeter extends FallingBlock {
|
||||
|
||||
public BlockSandSalpeter() {
|
||||
super(FabricBlockSettings.create().hardness(3.1f).requiresTool());
|
||||
@ -27,4 +29,10 @@ public class BlockSandSalpeter extends GravelBlock {
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
|
||||
return Arrays.asList(new ItemStack[] { new ItemStack(QuickieItems.SALPETER, 3 + Random.create().nextInt(2)), new ItemStack(Blocks.SAND) });
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends FallingBlock> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,12 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.GravelBlock;
|
||||
import net.minecraft.block.FallingBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.loot.context.LootContextParameterSet.Builder;
|
||||
import net.minecraft.world.explosion.Explosion;
|
||||
@ -16,10 +18,10 @@ import net.minecraft.world.explosion.Explosion;
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockSpeedpowder extends GravelBlock {
|
||||
public class BlockSpeedpowder extends FallingBlock {
|
||||
|
||||
public BlockSpeedpowder() {
|
||||
super(FabricBlockSettings.create());
|
||||
super(FabricBlockSettings.create().luminance(state -> 12));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -31,4 +33,10 @@ public class BlockSpeedpowder extends GravelBlock {
|
||||
public boolean shouldDropItemsOnExplosion(Explosion explosion) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends FallingBlock> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockSpreaderEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
@ -48,4 +50,10 @@ public class BlockSpreader extends BlockWithEntity {
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
|
||||
return List.of(new ItemStack(QuickieBlocks.BLOCKSPREADER.asItem()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends BlockWithEntity> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
@ -102,4 +104,10 @@ public class BlockStackerDown extends BlockWithEntity implements BlockStacker {
|
||||
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
|
||||
return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends BlockWithEntity> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
@ -102,4 +104,10 @@ public class BlockStackerEast extends BlockWithEntity implements BlockStacker {
|
||||
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
|
||||
return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends BlockWithEntity> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
@ -102,4 +104,10 @@ public class BlockStackerNorth extends BlockWithEntity implements BlockStacker {
|
||||
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
|
||||
return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends BlockWithEntity> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
@ -102,4 +104,10 @@ public class BlockStackerSouth extends BlockWithEntity implements BlockStacker {
|
||||
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
|
||||
return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends BlockWithEntity> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
@ -102,4 +104,10 @@ public class BlockStackerUp extends BlockWithEntity implements BlockStacker {
|
||||
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
|
||||
return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends BlockWithEntity> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.BlockStackerEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blockentity.QuickieFabricBlockEntity;
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.BlockStacker;
|
||||
@ -102,4 +104,10 @@ public class BlockStackerWest extends BlockWithEntity implements BlockStacker {
|
||||
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
|
||||
return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends BlockWithEntity> getCodec() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.help.IntProviderHelper;
|
||||
import de.jottyfan.minecraft.quickiefabric.items.QuickieItems;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
@ -18,7 +19,7 @@ import net.minecraft.loot.context.LootContextParameterSet.Builder;
|
||||
public class BlockSulphor extends ExperienceDroppingBlock {
|
||||
|
||||
public BlockSulphor() {
|
||||
super(FabricBlockSettings.create().hardness(0.5f));
|
||||
super(IntProviderHelper.of(0, 2), FabricBlockSettings.create().hardness(0.5f));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,7 +1,5 @@
|
||||
package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||
|
||||
import net.minecraft.item.ItemConvertible;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
|
@ -0,0 +1,37 @@
|
||||
package de.jottyfan.minecraft.quickiefabric.blocks.help;
|
||||
|
||||
import net.minecraft.util.math.intprovider.IntProvider;
|
||||
import net.minecraft.util.math.intprovider.IntProviderType;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class IntProviderHelper {
|
||||
public static final IntProvider of(Integer min, Integer max) {
|
||||
return new IntProvider() {
|
||||
|
||||
@Override
|
||||
public IntProviderType<?> getType() {
|
||||
return IntProviderType.CONSTANT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMin() {
|
||||
return min;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMax() {
|
||||
return max;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int get(Random random) {
|
||||
return random.nextBetween(min, max);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@ package de.jottyfan.minecraft.quickiefabric.mixin;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.event.BreakBlockCallback;
|
||||
import net.minecraft.block.Block;
|
||||
@ -14,15 +14,15 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
@Mixin(Block.class)
|
||||
public class BlockBreakMixin {
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "onBreak(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/player/PlayerEntity;)V")
|
||||
private void onBreak(final World world, final BlockPos blockPos, final BlockState blockState, final PlayerEntity playerEntity, final CallbackInfo info) {
|
||||
@Inject(at = @At("HEAD"), method = "onBreak(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/block/BlockState;")
|
||||
private void onBreak(final World world, final BlockPos blockPos, final BlockState blockState, final PlayerEntity playerEntity, final CallbackInfoReturnable<BlockBreakMixin> info) {
|
||||
ActionResult result = BreakBlockCallback.EVENT.invoker().injectBlockBreakCallback(world, blockPos, blockState, playerEntity);
|
||||
if (result == ActionResult.FAIL) {
|
||||
info.cancel();
|
||||
|
@ -26,9 +26,9 @@
|
||||
"quickiefabric.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.22",
|
||||
"fabricloader": ">=0.14.24",
|
||||
"fabric": "*",
|
||||
"minecraft": "1.20.2",
|
||||
"minecraft": "1.20.3-alpha.23.45.a",
|
||||
"java": ">=17"
|
||||
},
|
||||
"suggests": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user