Compare commits
35
Commits
595901802c
...
26.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
116a00810d | ||
|
|
ac1ead08d9 | ||
|
|
c9a90ee64c | ||
|
|
fdf78882a4 | ||
|
|
75925e4d55 | ||
|
|
90a469534a | ||
|
|
f6ece6e267 | ||
|
|
a065d8db16 | ||
|
|
2538d56de1 | ||
|
|
303e594b75 | ||
|
|
de33041061 | ||
|
|
b1eeb298f8 | ||
|
|
8b2bf1291c | ||
|
|
26f8bfc113 | ||
|
|
424f365243 | ||
|
|
026e42ce0f | ||
|
|
4dd604926e | ||
|
|
b95b933d86 | ||
|
|
aecc6239f3 | ||
|
|
4a03914abf | ||
|
|
df484e847f | ||
|
|
1d251b27e9 | ||
|
|
d888283838 | ||
|
|
5bc14bb222 | ||
|
|
a71c23cf28 | ||
|
|
732c8fd3d2 | ||
|
|
96ee5749c9 | ||
|
|
8dc3145493 | ||
|
|
ea72b9c7f0 | ||
|
|
7c531cdbef | ||
|
|
8e2eb70524 | ||
|
|
c0c70ecfce | ||
|
|
57ed5584cb | ||
|
|
49820490b6 | ||
|
|
489af3ef92 |
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
#Mon Dec 22 18:46:51 CET 2025
|
||||
#Mon Jul 20 21:22:00 CEST 2026
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=25
|
||||
|
||||
+11
-24
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id 'net.fabricmc.fabric-loom' version "${loom_version}"
|
||||
id 'net.fabricmc.fabric-loom'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
@@ -11,22 +11,17 @@ base {
|
||||
}
|
||||
|
||||
repositories {
|
||||
// Add repositories to retrieve artifacts from in here.
|
||||
// You should only use this when depending on other mods because
|
||||
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
|
||||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
|
||||
// for more information about repositories.
|
||||
maven {
|
||||
name = 'Fabric'
|
||||
url = 'https://maven.fabricmc.net/'
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// To change the versions see the gradle.properties file
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
|
||||
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
|
||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
||||
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
|
||||
|
||||
}
|
||||
|
||||
processResources {
|
||||
@@ -37,29 +32,27 @@ processResources {
|
||||
}
|
||||
}
|
||||
|
||||
fabricApi {
|
||||
configureDataGeneration()
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
it.options.release = 25
|
||||
}
|
||||
|
||||
java {
|
||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
||||
// if it is present.
|
||||
// If you remove this line, sources will not be generated.
|
||||
withSourcesJar()
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_25
|
||||
targetCompatibility = JavaVersion.VERSION_25
|
||||
}
|
||||
|
||||
jar {
|
||||
inputs.property "archivesName", project.base.archivesName
|
||||
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${inputs.properties.archivesName}"}
|
||||
}
|
||||
}
|
||||
|
||||
// configure the maven publication
|
||||
publishing {
|
||||
publications {
|
||||
create("mavenJava", MavenPublication) {
|
||||
@@ -67,12 +60,6 @@ publishing {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
|
||||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
||||
repositories {
|
||||
// Add repositories to publish to here.
|
||||
// Notice: This block does NOT have the same function as the block in the top level.
|
||||
// The repositories here will be used for publishing your artifact, not for
|
||||
// retrieving dependencies.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -7,14 +7,14 @@ org.gradle.configuration-cache=false
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
minecraft_version=26.1-snapshot-3
|
||||
loader_version=0.18.4
|
||||
loom_version=1.14-SNAPSHOT
|
||||
minecraft_version=26.3-pre-2
|
||||
loader_version=0.19.3
|
||||
loom_version=1.17-SNAPSHOT
|
||||
|
||||
# Mod Properties
|
||||
mod_version=26.1.3
|
||||
mod_version=26.3.0-snapshot-10
|
||||
maven_group=de.jottyfan.minecraft
|
||||
archives_base_name=quickly
|
||||
|
||||
# Dependencies
|
||||
fabric_api_version=0.141.3+26.1
|
||||
fabric_api_version=0.159.4+26.3
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+4
-1
@@ -7,4 +7,7 @@ pluginManagement {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
id 'net.fabricmc.fabric-loom' version "${loom_version}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
package de.jottyfan.minecraft;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import de.jottyfan.minecraft.block.QuicklyBlocks;
|
||||
import de.jottyfan.minecraft.blockentity.QuicklyBlockEntity;
|
||||
import de.jottyfan.minecraft.composter.QuicklyComposter;
|
||||
import de.jottyfan.minecraft.event.QuicklyEvents;
|
||||
import de.jottyfan.minecraft.feature.QuicklyFeatures;
|
||||
import de.jottyfan.minecraft.item.QuicklyItems;
|
||||
import de.jottyfan.minecraft.loot.QuicklyLootTables;
|
||||
import de.jottyfan.minecraft.tab.QuicklyTab;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
@@ -25,12 +29,11 @@ public class Quickly implements ModInitializer {
|
||||
public void onInitialize() {
|
||||
LOGGER.info("loading {}", MOD_ID);
|
||||
|
||||
QuicklyItems.registerModItems();
|
||||
QuicklyBlocks.registerModBlocks();
|
||||
List<Item> items = QuicklyItems.registeredModItems();
|
||||
List<Block> blocks = QuicklyBlocks.registeredModBlocks();
|
||||
QuicklyBlockEntity.registerBlockEntities();
|
||||
QuicklyFeatures.registerFeatures();
|
||||
QuicklyComposter.registerComposterItems();
|
||||
QuicklyLootTables.registerChanges();
|
||||
QuicklyTab.registerItemGroup(items, blocks);
|
||||
QuicklyEvents.registerBlockBreak();
|
||||
}
|
||||
}
|
||||
@@ -30,9 +30,11 @@ import net.minecraft.world.level.block.FallingBlock;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition.Builder;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
@@ -43,25 +45,28 @@ import net.minecraft.world.phys.BlockHitResult;
|
||||
*
|
||||
*/
|
||||
public class BlockDrill extends FallingBlock implements EntityBlock {
|
||||
public static final MapCodec<BlockDrill> CODEC = simpleCodec(BlockDrill::new);
|
||||
public static final MapCodec<BlockDrill> CODEC = MapCodec.unit(() -> new BlockDrill(
|
||||
BlockBehaviour.Properties.of()
|
||||
));
|
||||
|
||||
private static final Integer MAX_FUEL = 255;
|
||||
public static final IntegerProperty FUEL = IntegerProperty.create("fuel", 0, MAX_FUEL);
|
||||
public static final EnumProperty<Direction> FACING = BlockStateProperties.FACING;
|
||||
public static final BooleanProperty DOWNWARDS = BooleanProperty.create("downwards");
|
||||
|
||||
public BlockDrill(Properties properties) {
|
||||
super(properties.strength(0.5f));
|
||||
registerDefaultState(stateDefinition.any().setValue(FUEL, 0).setValue(FACING, Direction.DOWN));
|
||||
registerDefaultState(stateDefinition.any().setValue(FUEL, 0).setValue(FACING, Direction.DOWN).setValue(DOWNWARDS, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(Builder<Block, BlockState> builder) {
|
||||
builder.add(FUEL, FACING);
|
||||
builder.add(FUEL, FACING, DOWNWARDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext context) {
|
||||
return this.defaultBlockState().setValue(FACING, context.getNearestLookingDirection());
|
||||
return this.defaultBlockState().setValue(FACING, context.getNearestLookingDirection()).setValue(DOWNWARDS, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -92,8 +97,8 @@ public class BlockDrill extends FallingBlock implements EntityBlock {
|
||||
loadings.put(QuicklyItems.CANOLABOTTLESTACK, 72);
|
||||
Item item = itemStack.getItem();
|
||||
if (QuicklyItems.MAGNIFIER.equals(item)) {
|
||||
if (!level.isClientSide() && player instanceof ServerPlayer serverPlayer) {
|
||||
serverPlayer.displayClientMessage(Component.translatable("info.block.drillfuel", state.getValue(FUEL)), true);
|
||||
if (!level.isClientSide() && player instanceof ServerPlayer serverPlayer && player != null) {
|
||||
serverPlayer.connection.player.sendSystemMessage(Component.translatable("info.block.drillfuel", state.getValue(FUEL)), true);
|
||||
}
|
||||
} else if (loadings.containsKey(item)) {
|
||||
Integer fuelWeight = loadings.get(item);
|
||||
@@ -112,6 +117,12 @@ public class BlockDrill extends FallingBlock implements EntityBlock {
|
||||
}
|
||||
player.getActiveItem().shrink(1);
|
||||
}
|
||||
} else if (QuicklyItems.COPPERSTUB.equals(item)) {
|
||||
Direction facing = state.getValue(BlockDrill.FACING);
|
||||
level.setBlockAndUpdate(pos, QuicklyBlocks.DRILL.defaultBlockState().setValue(FACING, facing).setValue(BlockDrill.DOWNWARDS, false));
|
||||
if (!level.isClientSide() && player instanceof ServerPlayer serverPlayer && player != null) {
|
||||
serverPlayer.connection.player.sendSystemMessage(Component.translatable("info.block.drillstraight"), true);
|
||||
}
|
||||
} else {
|
||||
Direction newDirection = hitResult.getDirection();
|
||||
newDirection = newDirection.equals(Direction.UP) ? Direction.DOWN : newDirection;
|
||||
@@ -123,11 +134,6 @@ public class BlockDrill extends FallingBlock implements EntityBlock {
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MapCodec<? extends FallingBlock> codec() {
|
||||
return CODEC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDustColor(BlockState blockState, BlockGetter level, BlockPos pos) {
|
||||
return 0;
|
||||
|
||||
@@ -2,7 +2,6 @@ package de.jottyfan.minecraft.block;
|
||||
|
||||
import de.jottyfan.minecraft.item.QuicklyItems;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.world.Containers;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
@@ -24,13 +23,13 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
*/
|
||||
public class BlockPlant extends CropBlock {
|
||||
|
||||
private Identifier seedName;
|
||||
private Identifier fruitName;
|
||||
private DropDefinition seedDefinition;
|
||||
private DropDefinition fruitDefinition;
|
||||
|
||||
public BlockPlant(Properties properties, Identifier seedName, Identifier fruitName) {
|
||||
public BlockPlant(Properties properties, DropDefinition seedDefinition, DropDefinition fruitDefinition) {
|
||||
super(properties.noOcclusion().dynamicShape());
|
||||
this.seedName = seedName;
|
||||
this.fruitName = fruitName;
|
||||
this.seedDefinition = seedDefinition;
|
||||
this.fruitDefinition = fruitDefinition;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,11 +48,11 @@ public class BlockPlant extends CropBlock {
|
||||
}
|
||||
|
||||
public ItemLike getSeed() {
|
||||
return QuicklyItems.of(seedName);
|
||||
return QuicklyItems.of(seedDefinition.getIdentifier());
|
||||
}
|
||||
|
||||
public ItemLike getFruit() {
|
||||
return QuicklyItems.of(fruitName);
|
||||
return QuicklyItems.of(fruitDefinition.getIdentifier());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package de.jottyfan.minecraft.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
@@ -7,6 +10,7 @@ import com.mojang.serialization.MapCodec;
|
||||
import de.jottyfan.minecraft.blockentity.BlockStackerEntity;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
@@ -14,9 +18,11 @@ import net.minecraft.world.level.block.EntityBlock;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition.Builder;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootParams.Builder;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -24,7 +30,9 @@ import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
*
|
||||
*/
|
||||
public class BlockStacker extends Block implements EntityBlock {
|
||||
public static final MapCodec<BlockStacker> CODEC = simpleCodec(BlockStacker::new);
|
||||
public static final MapCodec<BlockDrill> CODEC = MapCodec.unit(() -> new BlockDrill(
|
||||
BlockBehaviour.Properties.of()
|
||||
));
|
||||
|
||||
public static final EnumProperty<Direction> SOURCE = EnumProperty.create("source", Direction.class, Direction.NORTH,
|
||||
Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN);
|
||||
@@ -37,13 +45,21 @@ public class BlockStacker extends Block implements EntityBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(Builder<Block, BlockState> builder) {
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
builder.add(SOURCE, DEST);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<ItemStack> getDrops(BlockState state, Builder params) {
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
list.add(new ItemStack(QuicklyBlocks.STACKER));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext context) {
|
||||
return this.defaultBlockState().setValue(SOURCE, context.getNearestLookingDirection()).setValue(DEST, context.getNearestLookingDirection().getOpposite());
|
||||
return this.defaultBlockState().setValue(SOURCE, context.getNearestLookingDirection()).setValue(DEST,
|
||||
context.getNearestLookingDirection().getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,9 +73,9 @@ public class BlockStacker extends Block implements EntityBlock {
|
||||
return new BlockStackerEntity(pos, blockState);
|
||||
}
|
||||
|
||||
public static MapCodec<BlockStacker> getCodec() {
|
||||
return CODEC;
|
||||
}
|
||||
protected MapCodec<? extends Block> codec() {
|
||||
return CODEC;
|
||||
}
|
||||
|
||||
public Direction getSource(BlockState state) {
|
||||
return state.getValue(SOURCE);
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package de.jottyfan.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.resources.Identifier;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class DropDefinition {
|
||||
private Identifier identifier;
|
||||
private Integer minValue;
|
||||
private Integer maxValue;
|
||||
|
||||
/**
|
||||
* defines the drop definition; the item or block from identifier should be
|
||||
* dropped x times (minValue <= x <= maxValue)
|
||||
*
|
||||
* @param identifier the identifier of the item or block
|
||||
* @param minValue the minimum of dropped items or blocks
|
||||
* @param maxValue the maximum of dropped items or blocks
|
||||
*/
|
||||
public static final DropDefinition of(Identifier identifier, Integer minValue, Integer maxValue) {
|
||||
DropDefinition bean = new DropDefinition();
|
||||
bean.setIdentifier(identifier);
|
||||
bean.setMinValue(minValue);
|
||||
bean.setMaxValue(maxValue);
|
||||
return bean;
|
||||
}
|
||||
|
||||
public int getRandomSize() {
|
||||
if (maxValue - minValue < 1) {
|
||||
return new Random().nextInt(maxValue);
|
||||
} else {
|
||||
return minValue + new Random().nextInt(maxValue - minValue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the identifier
|
||||
*/
|
||||
public Identifier getIdentifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param identifier the identifier to set
|
||||
*/
|
||||
public void setIdentifier(Identifier identifier) {
|
||||
this.identifier = identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the minValue
|
||||
*/
|
||||
public Integer getMinValue() {
|
||||
return minValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param minValue the minValue to set
|
||||
*/
|
||||
public void setMinValue(Integer minValue) {
|
||||
this.minValue = minValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the maxValue
|
||||
*/
|
||||
public Integer getMaxValue() {
|
||||
return maxValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param maxValue the maxValue to set
|
||||
*/
|
||||
public void setMaxValue(Integer maxValue) {
|
||||
this.maxValue = maxValue;
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class Itemhoarder extends Block implements EntityBlock {
|
||||
@Override
|
||||
protected InteractionResult useItemOn(ItemStack itemStack, BlockState state, Level level, BlockPos pos, Player player,
|
||||
InteractionHand hand, BlockHitResult hitResult) {
|
||||
if (player instanceof ServerPlayer serverPlayer) {
|
||||
if (player instanceof ServerPlayer serverPlayer && player != null) {
|
||||
if (QuicklyItems.MAGNIFIER.equals(itemStack.getItem())) {
|
||||
MutableComponent message = Component.empty();
|
||||
BlockEntity blockEntity = level.getBlockEntity(pos);
|
||||
@@ -68,7 +68,7 @@ public class Itemhoarder extends Block implements EntityBlock {
|
||||
}
|
||||
}
|
||||
Component complete = Component.translatable("info.block.itemhoarder", message);
|
||||
serverPlayer.displayClientMessage(complete, false);
|
||||
serverPlayer.connection.player.sendSystemMessage(complete, false);
|
||||
}
|
||||
}
|
||||
return InteractionResult.SUCCESS;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package de.jottyfan.minecraft.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import de.jottyfan.minecraft.item.QuicklyItems;
|
||||
@@ -20,8 +23,9 @@ import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition.Builder;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootParams.Builder;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.ticks.ScheduledTick;
|
||||
@@ -46,10 +50,17 @@ public class Monsterhoarder extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(Builder<Block, BlockState> builder) {
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
builder.add(SUCKRADIUS, BURNTICKS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<ItemStack> getDrops(BlockState state, Builder params) {
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
list.add(new ItemStack(QuicklyBlocks.MONSTERHOARDER));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InteractionResult useItemOn(ItemStack itemStack, BlockState state, Level level, BlockPos pos, Player player,
|
||||
InteractionHand hand, BlockHitResult hitResult) {
|
||||
@@ -73,8 +84,8 @@ public class Monsterhoarder extends Block {
|
||||
int suckRadius = state.getValue(SUCKRADIUS);
|
||||
int burnTicks = state.getValue(BURNTICKS);
|
||||
Component message = Component.translatable("info.block.monsterhoarder", suckRadius, burnTicks);
|
||||
if (player instanceof ServerPlayer serverPlayer) {
|
||||
serverPlayer.displayClientMessage(message, true);
|
||||
if (player instanceof ServerPlayer serverPlayer && player != null) {
|
||||
serverPlayer.connection.player.sendSystemMessage(message, true);
|
||||
}
|
||||
}
|
||||
return InteractionResult.SUCCESS;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package de.jottyfan.minecraft.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
import de.jottyfan.minecraft.Quickly;
|
||||
@@ -32,9 +34,11 @@ public class QuicklyBlocks {
|
||||
public static final Block OREDEEPSLATETURQUOISE = registerBlock(ID.OREDEEPSLATETURQUOISE,
|
||||
properties -> new BlockOre(properties, SoundEvents.AMETHYST_BLOCK_CHIME, ID.RAWTURQUOISE));
|
||||
public static final Block COTTONPLANT = registerBlock(ID.BLOCKCOTTONPLANT, Properties.ofFullCopy(Blocks.WHEAT),
|
||||
properties -> new BlockPlant(properties, ID.COTTONSEED, ID.COTTON));
|
||||
properties -> new BlockPlant(properties, DropDefinition.of(ID.COTTONSEED, 1, 1),
|
||||
DropDefinition.of(ID.COTTON, 1, 1)));
|
||||
public static final Block CANOLAPLANT = registerBlock(ID.BLOCKCANOLAPLANT, Properties.ofFullCopy(Blocks.WHEAT),
|
||||
properties -> new BlockPlant(properties, ID.CANOLASEED, ID.CANOLA));
|
||||
properties -> new BlockPlant(properties, DropDefinition.of(ID.CANOLASEED, 1, 1),
|
||||
DropDefinition.of(ID.CANOLA, 1, 1)));
|
||||
public static final Block LAVAHOARDER = registerBlock(ID.LAVAHOARDER,
|
||||
Properties.of().strength(2.5f).lightLevel(state -> state.getValue(Lavahoarder.FILLED) ? 15 : 0),
|
||||
Lavahoarder::new);
|
||||
@@ -98,7 +102,31 @@ public class QuicklyBlocks {
|
||||
return BuiltInRegistries.BLOCK.getValue(identifier);
|
||||
}
|
||||
|
||||
public static void registerModBlocks() {
|
||||
Quickly.LOGGER.info("forbid the optimizer to ignore static block registration");
|
||||
public static final List<Block> registeredModBlocks() {
|
||||
Quickly.LOGGER.debug("register blocks");
|
||||
List<Block> set = new ArrayList<>();
|
||||
set.add(KELPBUNDLE);
|
||||
set.add(TURQUOISEBLOCK);
|
||||
set.add(ORETURQUOISE);
|
||||
set.add(OREDEEPSLATETURQUOISE);
|
||||
set.add(LAVAHOARDER);
|
||||
set.add(QUICKIEPOWDER);
|
||||
set.add(SPEEDPOWDER);
|
||||
set.add(MONSTERHOARDER);
|
||||
set.add(ITEMHOARDER);
|
||||
set.add(DRILL);
|
||||
set.add(STACKER);
|
||||
set.add(DIRTSALPETER);
|
||||
set.add(SANDSALPETER);
|
||||
set.add(OREDEEPSLATESULFOR);
|
||||
set.add(ORENETHERSULFOR);
|
||||
set.add(ORESALPETER);
|
||||
set.add(ORESANDSALPETER);
|
||||
set.add(ORESULFOR);
|
||||
set.add(ORESPEEDPOWDER);
|
||||
set.add(OREDEEPSLATESPEEDPOWDER);
|
||||
set.add(SALPETERBLOCK);
|
||||
set.add(SULFORBLOCK);
|
||||
return set;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,29 +31,32 @@ public class DrillBlockEntity extends BlockEntity {
|
||||
public static void tick(Level level, BlockPos pos, BlockState state, BlockEntity be) {
|
||||
if (be instanceof DrillBlockEntity dbe) {
|
||||
Direction dir = state.getValue(BlockDrill.FACING);
|
||||
Boolean downwards = state.getValue(BlockDrill.DOWNWARDS);
|
||||
List<BlockPos> list = new ArrayList<>();
|
||||
if (Direction.DOWN.equals(dir)) {
|
||||
list = downFrom(pos);
|
||||
} else if (Direction.EAST.equals(dir)) {
|
||||
list = directedFrom(pos.east());
|
||||
list = directedFrom(pos.east(), downwards);
|
||||
} else if (Direction.SOUTH.equals(dir)) {
|
||||
list = directedFrom(pos.south());
|
||||
list = directedFrom(pos.south(), downwards);
|
||||
} else if (Direction.WEST.equals(dir)) {
|
||||
list = directedFrom(pos.west());
|
||||
list = directedFrom(pos.west(), downwards);
|
||||
} else if (Direction.NORTH.equals(dir)) {
|
||||
list = directedFrom(pos.north());
|
||||
list = directedFrom(pos.north(), downwards);
|
||||
}
|
||||
DrillBlockEntity.tick(level, pos, state, dbe, MAXDRILLSTEP, list);
|
||||
}
|
||||
}
|
||||
|
||||
public static final List<BlockPos> directedFrom(BlockPos pos) {
|
||||
public static final List<BlockPos> directedFrom(BlockPos pos, Boolean downwards) {
|
||||
List<BlockPos> list = new ArrayList<>();
|
||||
list.add(pos);
|
||||
list.add(pos.above());
|
||||
list.add(pos.above(2));
|
||||
list.add(pos.above(3));
|
||||
list.add(pos.below()); // must be last position
|
||||
list.add(pos.above(2));
|
||||
list.add(pos.above());
|
||||
list.add(pos);
|
||||
if (downwards) {
|
||||
list.add(pos.below()); // must be last position
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,17 @@ package de.jottyfan.minecraft.blockentity;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
|
||||
import de.jottyfan.minecraft.Quickly;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.HolderLookup.Provider;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.protocol.game.ClientGamePacketListener;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
@@ -29,7 +35,7 @@ import net.minecraft.world.phys.AABB;
|
||||
public class ItemHoarderBlockEntity extends BlockEntity implements Container {
|
||||
|
||||
public static final Codec<Map<String, ItemStack>> ITEM_STACK_MAP_CODEC =
|
||||
Codec.unboundedMap(Codec.STRING, ItemStack.CODEC);
|
||||
Codec.unboundedMap(Codec.STRING, ItemStack.OPTIONAL_CODEC);
|
||||
|
||||
private Map<String, ItemStack> stacks = new HashMap<>();
|
||||
private static final Integer suckradius = 4;
|
||||
@@ -40,7 +46,7 @@ public class ItemHoarderBlockEntity extends BlockEntity implements Container {
|
||||
|
||||
public final static boolean setStackToSlots(ItemStack stack, Map<String, ItemStack> stacks) {
|
||||
if (stack.isEmpty()) {
|
||||
Quickly.LOGGER.info("FATAL!!! tried to set empty stack. Check your code!");
|
||||
Quickly.LOGGER.error("FATAL!!! tried to set empty stack. Check your code!");
|
||||
return false;
|
||||
}
|
||||
String key = stack.getItemName().getString();
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package de.jottyfan.minecraft.composter;
|
||||
|
||||
import de.jottyfan.minecraft.item.QuicklyItems;
|
||||
import net.fabricmc.fabric.api.registry.CompostableRegistry;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class QuicklyComposter {
|
||||
|
||||
public static final void registerComposterItems() {
|
||||
CompostableRegistry.INSTANCE.add(QuicklyItems.COTTONSEED, 0.5f);
|
||||
CompostableRegistry.INSTANCE.add(QuicklyItems.COTTON, 0.75f);
|
||||
CompostableRegistry.INSTANCE.add(QuicklyItems.CANOLASEED, 0.5f);
|
||||
CompostableRegistry.INSTANCE.add(QuicklyItems.CANOLA, 0.75f);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
|
||||
/**
|
||||
@@ -16,15 +15,15 @@ import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
*
|
||||
*/
|
||||
public class QuicklyFeatures {
|
||||
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORETURQUOISE = genCf("oreturquoise");
|
||||
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORESULFOR = genCf("oresulfor");
|
||||
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_OREDEEPSLATESULFUR = genCf("oredepslatesulfor");
|
||||
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORESALPETER = genCf("oresalpeter");
|
||||
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORENETHERSULFOR = genCf("orenethersulfor");
|
||||
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_DIRTSALPETER = genCf("dirtsalpeter");
|
||||
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_SANDSALPETER = genCf("sandsalpeter");
|
||||
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORESANDSALPETER = genCf("oresandsalpeter");
|
||||
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORESPEEDPOWDER = genCf("orespeedpowder");
|
||||
public static final ResourceKey<?> CF_ORETURQUOISE = genCf("oreturquoise");
|
||||
public static final ResourceKey<?> CF_ORESULFOR = genCf("oresulfor");
|
||||
public static final ResourceKey<?> CF_OREDEEPSLATESULFUR = genCf("oredepslatesulfor");
|
||||
public static final ResourceKey<?> CF_ORESALPETER = genCf("oresalpeter");
|
||||
public static final ResourceKey<?> CF_ORENETHERSULFOR = genCf("orenethersulfor");
|
||||
public static final ResourceKey<?> CF_DIRTSALPETER = genCf("dirtsalpeter");
|
||||
public static final ResourceKey<?> CF_SANDSALPETER = genCf("sandsalpeter");
|
||||
public static final ResourceKey<?> CF_ORESANDSALPETER = genCf("oresandsalpeter");
|
||||
public static final ResourceKey<?> CF_ORESPEEDPOWDER = genCf("orespeedpowder");
|
||||
|
||||
public static final ResourceKey<PlacedFeature> PF_ORETURQUOISE = genPf("oreturquoise");
|
||||
public static final ResourceKey<PlacedFeature> PF_ORESULFOR = genPf("oresulfor");
|
||||
@@ -36,8 +35,8 @@ public class QuicklyFeatures {
|
||||
public static final ResourceKey<PlacedFeature> PF_ORESANDSALPETER = genPf("oresandsalpeter");
|
||||
public static final ResourceKey<PlacedFeature> PF_ORESPEEDPOWDER = genPf("orespeedpowder");
|
||||
|
||||
private static final ResourceKey<ConfiguredFeature<?, ?>> genCf(String name) {
|
||||
return ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(Quickly.MOD_ID, name));
|
||||
private static final ResourceKey<?> genCf(String name) {
|
||||
return ResourceKey.create(Registries.FEATURE, Identifier.fromNamespaceAndPath(Quickly.MOD_ID, name));
|
||||
}
|
||||
|
||||
private static final ResourceKey<PlacedFeature> genPf(String name) {
|
||||
|
||||
@@ -5,10 +5,8 @@ import java.util.List;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.world.item.AxeItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.ToolMaterial;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
@@ -19,12 +17,12 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class QAxe extends AxeItem implements ToolRangeable {
|
||||
public class QAxe extends Item implements ToolRangeable {
|
||||
|
||||
private final HarvestRange range;
|
||||
|
||||
public QAxe(QIP properties) {
|
||||
super(new ToolMaterial(BlockTags.INCORRECT_FOR_DIAMOND_TOOL, properties.getDurability(), 7f, 1f, 15, ItemTags.DIAMOND_TOOL_MATERIALS), 7f, 3.1f, properties);
|
||||
super(properties);
|
||||
this.range = properties.getHarvestRange();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.Containers;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.item.HoeItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.ToolMaterial;
|
||||
import net.minecraft.world.item.context.UseOnContext;
|
||||
@@ -18,26 +18,29 @@ import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.CropBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class QHoe extends HoeItem implements ToolRangeable {
|
||||
|
||||
public class QHoe extends Item implements ToolRangeable {
|
||||
public QIP properties;
|
||||
|
||||
public QHoe(QIP properties) {
|
||||
super(new ToolMaterial(BlockTags.INCORRECT_FOR_DIAMOND_TOOL, properties.getDurability(), 7f, 1f, 15, ItemTags.DIAMOND_TOOL_MATERIALS), 7f, 3.1f, properties);
|
||||
super(properties.hoe(ToolMaterial.DIAMOND, 0.0f, -3.0f));
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InteractionResult useOn(UseOnContext context) {
|
||||
InteractionResult res = super.useOn(context);
|
||||
boolean isCrop = context.getLevel().getBlockState(context.getClickedPos()).getBlock() instanceof CropBlock;
|
||||
public InteractionResult useOn(UseOnContext context) {
|
||||
InteractionResult res = super.useOn(context);
|
||||
Block block = context.getLevel().getBlockState(context.getClickedPos()).getBlock();
|
||||
boolean isCrop = block instanceof CropBlock;
|
||||
if (!InteractionResult.PASS.equals(res) || isCrop) {
|
||||
HarvestRange range = properties.getHarvestRange();
|
||||
for (int x = -range.getxRange(); x <= range.getxRange(); x++) {
|
||||
@@ -45,7 +48,7 @@ public class QHoe extends HoeItem implements ToolRangeable {
|
||||
for (int z = -range.getzRange(); z <= range.getzRange(); z++) {
|
||||
if (!isCrop) {
|
||||
removePossibleGrass(context.getLevel(), new BlockPos(x, y, z));
|
||||
BlockHitResult bhr = new BlockHitResult(context.getClickedPos().getCenter(), Direction.UP,
|
||||
BlockHitResult bhr = new BlockHitResult(Vec3.atCenterOf(context.getClickedPos()), Direction.UP,
|
||||
context.getClickedPos().offset(x, y, z), false);
|
||||
UseOnContext ctx = new UseOnContext(context.getPlayer(), context.getHand(), bhr);
|
||||
super.useOn(ctx);
|
||||
@@ -55,6 +58,7 @@ public class QHoe extends HoeItem implements ToolRangeable {
|
||||
}
|
||||
}
|
||||
}
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -69,13 +73,21 @@ public class QHoe extends HoeItem implements ToolRangeable {
|
||||
}
|
||||
|
||||
private void harvestIfPossible(BlockPos pos, Level level) {
|
||||
BlockState blockState = level.getBlockState(pos);
|
||||
Block block = blockState.getBlock();
|
||||
if (block instanceof CropBlock) {
|
||||
CropBlock cBlock = (CropBlock) block;
|
||||
if (cBlock.isMaxAge(blockState)) {
|
||||
Block.dropResources(blockState, level, pos);
|
||||
level.setBlockAndUpdate(pos, cBlock.defaultBlockState());
|
||||
if (!level.isClientSide()) {
|
||||
BlockState blockState = level.getBlockState(pos);
|
||||
Block block = blockState.getBlock();
|
||||
if (block instanceof CropBlock cBlock) {
|
||||
if (cBlock.isMaxAge(blockState)) {
|
||||
LootParams.Builder builder = new LootParams.Builder((ServerLevel) level)
|
||||
.withParameter(LootContextParams.ORIGIN, Vec3.atCenterOf(pos))
|
||||
.withParameter(LootContextParams.BLOCK_STATE, blockState)
|
||||
.withOptionalParameter(LootContextParams.BLOCK_ENTITY, level.getBlockEntity(pos))
|
||||
.withParameter(LootContextParams.TOOL, ItemStack.EMPTY);
|
||||
for (ItemStack stack : blockState.getDrops(builder)) {
|
||||
Containers.dropItemStack(level, pos.getX(), pos.getY(), pos.getZ(), stack);
|
||||
}
|
||||
level.setBlockAndUpdate(pos, cBlock.defaultBlockState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package de.jottyfan.minecraft.item;
|
||||
|
||||
import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
@@ -15,6 +16,10 @@ import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.ShearsItem;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.LootTable;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
/**
|
||||
@@ -40,38 +45,24 @@ public class QShears extends ShearsItem {
|
||||
sheep.setSheared(true);
|
||||
sheep.playAmbientSound();
|
||||
DyeColor color = sheep.getColor();
|
||||
Item item = Items.WHITE_WOOL;
|
||||
if (color.equals(DyeColor.BLACK)) {
|
||||
item = Items.BLACK_WOOL;
|
||||
} else if (color.equals(DyeColor.GRAY)) {
|
||||
item = Items.GRAY_WOOL;
|
||||
} else if (color.equals(DyeColor.LIGHT_GRAY)) {
|
||||
item = Items.LIGHT_GRAY_WOOL;
|
||||
} else if (color.equals(DyeColor.BROWN)) {
|
||||
item = Items.BROWN_WOOL;
|
||||
} else if (color.equals(DyeColor.BLUE)) {
|
||||
item = Items.BLUE_WOOL;
|
||||
} else if (color.equals(DyeColor.LIGHT_BLUE)) {
|
||||
item = Items.LIGHT_BLUE_WOOL;
|
||||
} else if (color.equals(DyeColor.GREEN)) {
|
||||
item = Items.GREEN_WOOL;
|
||||
} else if (color.equals(DyeColor.LIME)) {
|
||||
item = Items.LIME_WOOL;
|
||||
} else if (color.equals(DyeColor.CYAN)) {
|
||||
item = Items.CYAN_WOOL;
|
||||
} else if (color.equals(DyeColor.MAGENTA)) {
|
||||
item = Items.MAGENTA_WOOL;
|
||||
} else if (color.equals(DyeColor.ORANGE)) {
|
||||
item = Items.ORANGE_WOOL;
|
||||
} else if (color.equals(DyeColor.PINK)) {
|
||||
item = Items.PINK_WOOL;
|
||||
} else if (color.equals(DyeColor.PURPLE)) {
|
||||
item = Items.PURPLE_WOOL;
|
||||
} else if (color.equals(DyeColor.RED)) {
|
||||
item = Items.RED_WOOL;
|
||||
} else if (color.equals(DyeColor.YELLOW)) {
|
||||
item = Items.YELLOW_WOOL;
|
||||
}
|
||||
Item item = switch (color) {
|
||||
case BLACK -> Items.WOOL.black();
|
||||
case GRAY -> Items.WOOL.gray();
|
||||
case LIGHT_GRAY -> Items.WOOL.lightGray();
|
||||
case BROWN -> Items.WOOL.brown();
|
||||
case BLUE -> Items.WOOL.blue();
|
||||
case LIGHT_BLUE -> Items.WOOL.lightBlue();
|
||||
case GREEN -> Items.WOOL.green();
|
||||
case LIME -> Items.WOOL.lime();
|
||||
case CYAN -> Items.WOOL.cyan();
|
||||
case MAGENTA -> Items.WOOL.magenta();
|
||||
case ORANGE -> Items.WOOL.orange();
|
||||
case PINK -> Items.WOOL.pink();
|
||||
case PURPLE -> Items.WOOL.purple();
|
||||
case RED -> Items.WOOL.red();
|
||||
case YELLOW -> Items.WOOL.yellow();
|
||||
default -> Items.WOOL.white();
|
||||
};
|
||||
user.level().addFreshEntity(new ItemEntity(user.level(), pos.x, pos.y, pos.z, new ItemStack(item, amount)));
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
@@ -93,6 +84,20 @@ public class QShears extends ShearsItem {
|
||||
user.level()
|
||||
.addFreshEntity(new ItemEntity(user.level(), pos.x, pos.y, pos.z, new ItemStack(Items.FEATHER, amount)));
|
||||
return InteractionResult.SUCCESS;
|
||||
} else if (user.level() instanceof ServerLevel serverLevel){
|
||||
if (entity.getLootTable().isPresent()) {
|
||||
LootTable lootTable = serverLevel.getServer().reloadableRegistries().getLootTable(entity.getLootTable().get());
|
||||
LootParams lootParams = new LootParams.Builder(serverLevel)
|
||||
.withParameter(LootContextParams.ORIGIN, entity.position())
|
||||
.withParameter(LootContextParams.THIS_ENTITY, entity)
|
||||
.withParameter(LootContextParams.DAMAGE_SOURCE, entity.damageSources().generic())
|
||||
.create(LootContextParamSets.ENTITY);
|
||||
lootTable.getRandomItems(lootParams).forEach(itemStack -> {
|
||||
entity.spawnAtLocation(serverLevel, itemStack);
|
||||
});
|
||||
entity.hurtServer(serverLevel, entity.damageSources().generic(), 0.1f);
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package de.jottyfan.minecraft.item;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.ShovelItem;
|
||||
import net.minecraft.world.item.ToolMaterial;
|
||||
import net.minecraft.world.item.context.UseOnContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -18,15 +18,15 @@ import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class QShovel extends ShovelItem implements ToolRangeable {
|
||||
public class QShovel extends Item implements ToolRangeable {
|
||||
public HarvestRange range;
|
||||
|
||||
public QShovel(QIP properties) {
|
||||
super(new ToolMaterial(BlockTags.INCORRECT_FOR_DIAMOND_TOOL, properties.getDurability(), 7f, 1f, 15, ItemTags.DIAMOND_TOOL_MATERIALS), 7F, -3.1F, properties);
|
||||
super(properties.shovel(ToolMaterial.DIAMOND, 1.5f, -3.0f));
|
||||
this.range = properties.getHarvestRange();
|
||||
}
|
||||
|
||||
private void createPathOnGrass(Level level, BlockPos pos, Direction side) {
|
||||
private void createPath(Level level, BlockPos pos, Direction side, Set<Block> validBlocks) {
|
||||
BlockState blockState = level.getBlockState(pos);
|
||||
if (blockState.isAir()) {
|
||||
// try to find one underneath
|
||||
@@ -39,7 +39,9 @@ public class QShovel extends ShovelItem implements ToolRangeable {
|
||||
if (side != Direction.DOWN) {
|
||||
if (blockState != null && level.getBlockState(pos.above()).isAir()) {
|
||||
if (!level.isClientSide()) {
|
||||
level.setBlockAndUpdate(pos, Blocks.DIRT_PATH.defaultBlockState());
|
||||
if (validBlocks.contains(blockState.getBlock())) {
|
||||
level.setBlockAndUpdate(pos, Blocks.DIRT_PATH.defaultBlockState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,10 +49,16 @@ public class QShovel extends ShovelItem implements ToolRangeable {
|
||||
|
||||
@Override
|
||||
public InteractionResult useOn(UseOnContext context) {
|
||||
for (BlockPos pos : range.getRangeAsBlockPosArray(context.getClickedPos(), true, new BlockPos(1, 1, 1))) {
|
||||
createPathOnGrass(context.getLevel(), pos, context.getClickedFace());
|
||||
InteractionResult result = super.useOn(context);
|
||||
if (InteractionResult.SUCCESS.equals(result)) {
|
||||
Set<Block> flattenables = new HashSet<>();
|
||||
flattenables.add(Blocks.DIRT);
|
||||
flattenables.add(Blocks.GRASS_BLOCK);
|
||||
for (BlockPos pos : range.getRangeAsBlockPosArray(context.getClickedPos(), true, new BlockPos(1, 1, 1))) {
|
||||
createPath(context.getLevel(), pos, context.getClickedFace(), flattenables);
|
||||
}
|
||||
}
|
||||
return super.useOn(context);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package de.jottyfan.minecraft.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
import de.jottyfan.minecraft.Quickly;
|
||||
@@ -22,12 +24,13 @@ public class QuicklyItems {
|
||||
public static final Item STUB = registerItem(ID.STUB, Stub::new);
|
||||
public static final Item RAWTURQUOISE = registerItem(ID.RAWTURQUOISE);
|
||||
public static final Item TURQUOISEINGOT = registerItem(ID.TURQUOISEINGOT);
|
||||
public static final Item COTTON = registerItem(ID.COTTON);
|
||||
public static final Item COTTON = registerItem(ID.COTTON, ofCompostable(QIP.of(ID.COTTON)));
|
||||
public static final Item COTTONPLANT = registerItem(ID.COTTONPLANT);
|
||||
public static final Item COTTONSEED = registerItem(ID.COTTONSEED, QIP.of(ID.BLOCKCOTTONPLANT), Plant::new);
|
||||
public static final Item CANOLA = registerItem(ID.CANOLA);
|
||||
public static final Item COTTONSEED = registerItem(ID.COTTONSEED, ofCompostable(QIP.of(ID.BLOCKCOTTONPLANT)), Plant::new);
|
||||
public static final Item PILLOW = registerItem(ID.PILLOW);
|
||||
public static final Item CANOLA = registerItem(ID.CANOLA, ofCompostable(QIP.of(ID.CANOLA)));
|
||||
public static final Item CANOLAPLANT = registerItem(ID.CANOLAPLANT);
|
||||
public static final Item CANOLASEED = registerItem(ID.CANOLASEED, QIP.of(ID.BLOCKCANOLAPLANT), Plant::new);
|
||||
public static final Item CANOLASEED = registerItem(ID.CANOLASEED, ofCompostable(QIP.of(ID.BLOCKCANOLAPLANT)), Plant::new);
|
||||
public static final Item CANOLABOTTLE = registerItem(ID.CANOLABOTTLE);
|
||||
public static final Item CANOLABOTTLESTACK = registerItem(ID.CANOLABOTTLESTACK);
|
||||
public static final Item ROTTENFLESHSTRIPES = registerItem(ID.ROTTEN_FLESH_STRIPES);
|
||||
@@ -44,6 +47,7 @@ public class QuicklyItems {
|
||||
public static final Item SALPETER = registerItem(ID.SALPETER);
|
||||
public static final Item SULFOR = registerItem(ID.SULFOR);
|
||||
public static final Item CARROTSTACK = registerItem(ID.CARROTSTACK);
|
||||
public static final Item POTATOSTACK = registerItem(ID.POTATOSTACK);
|
||||
|
||||
// TODO: rename tools to speedaxe and quickaxe instead of the powder version
|
||||
|
||||
@@ -75,6 +79,10 @@ public class QuicklyItems {
|
||||
public static final Item ARMOR_TURQUOISE_LEGGINGS = registerItem(ID.TURQUOISE_LEGGINGS, ArmorType.LEGGINGS);
|
||||
public static final Item ARMOR_TURQUOISE_CHESTPLATE = registerItem(ID.TURQUOISE_CHESTPLATE, ArmorType.CHESTPLATE);
|
||||
|
||||
private static final QIP ofCompostable(QIP qip) {
|
||||
return (QIP) qip.compostable(ResourceKey.create(Registries.CONTEXT_INT_PROVIDER, Identifier.withDefaultNamespace("compostable/medium_high")));
|
||||
}
|
||||
|
||||
private static final Item registerItem(Identifier identifier, ArmorType armorType) {
|
||||
return QuicklyItems.registerItem(identifier,
|
||||
new QIP().stacksTo(1).humanoidArmor(ModArmorMaterials.TURQUOISE_ARMOR_MATERIAL, armorType));
|
||||
@@ -97,8 +105,51 @@ public class QuicklyItems {
|
||||
return Registry.register(BuiltInRegistries.ITEM, identifier, item);
|
||||
}
|
||||
|
||||
public static final void registerModItems() {
|
||||
Quickly.LOGGER.info("forbid the optimizer to ignore static item registration");
|
||||
public static final List<Item> registeredModItems() {
|
||||
Quickly.LOGGER.debug("adding Items");
|
||||
List<Item> set = new ArrayList<>();
|
||||
set.add(STUB);
|
||||
set.add(RAWTURQUOISE);
|
||||
set.add(TURQUOISEINGOT);
|
||||
set.add(COTTON);
|
||||
set.add(COTTONSEED);
|
||||
set.add(PILLOW);
|
||||
set.add(CANOLA);
|
||||
set.add(CANOLASEED);
|
||||
set.add(CANOLABOTTLE);
|
||||
set.add(CANOLABOTTLESTACK);
|
||||
set.add(ROTTENFLESHSTRIPES);
|
||||
set.add(OXIDIZEDCOPPERPOWDER);
|
||||
set.add(COPPERSTRING);
|
||||
set.add(COPPERPOWDER);
|
||||
set.add(COPPERSTUB);
|
||||
set.add(COPPERSTICK);
|
||||
set.add(SPEEDPOWDER);
|
||||
set.add(QUICKIEPOWDER);
|
||||
set.add(SPEEDINGOT);
|
||||
set.add(QUICKIEINGOT);
|
||||
set.add(MAGNIFIER);
|
||||
set.add(SALPETER);
|
||||
set.add(SULFOR);
|
||||
set.add(CARROTSTACK);
|
||||
set.add(POTATOSTACK);
|
||||
set.add(SPEEDAXE);
|
||||
set.add(SPEEDHOE);
|
||||
set.add(SPEEDPICKAXE);
|
||||
set.add(SPEEDSHEARS);
|
||||
set.add(SPEEDSHOVEL);
|
||||
set.add(SPEEDWATERHOE);
|
||||
set.add(QUICKIEAXE);
|
||||
set.add(QUICKIEHOE);
|
||||
set.add(QUICKIEPICKAXE);
|
||||
set.add(QUICKIESHEARS);
|
||||
set.add(QUICKIESHOVEL);
|
||||
set.add(QUICKIEWATERHOE);
|
||||
set.add(ARMOR_TURQUOISE_BOOTS);
|
||||
set.add(ARMOR_TURQUOISE_HELMET);
|
||||
set.add(ARMOR_TURQUOISE_LEGGINGS);
|
||||
set.add(ARMOR_TURQUOISE_CHESTPLATE);
|
||||
return set;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Stub extends Item {
|
||||
if (SLASH_MAP.containsKey(clickedBlock)) {
|
||||
if (!level.isClientSide()) {
|
||||
level.setBlockAndUpdate(pos, Blocks.AIR.defaultBlockState());
|
||||
level.playSound(null, pos, SoundEvents.HOE_TILL, SoundSource.BLOCKS);
|
||||
level.playPlayerSound(SoundEvents.HOE_TILL.value(), SoundSource.BLOCKS, 1f, 1f);
|
||||
for (int i = 0; i < 9; i++) {
|
||||
ItemStack stack = new ItemStack(SLASH_MAP.get(clickedBlock));
|
||||
float xScatter = new Random().nextFloat();
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
package de.jottyfan.minecraft.loot;
|
||||
|
||||
import de.jottyfan.minecraft.item.QuicklyItems;
|
||||
import net.fabricmc.fabric.api.loot.v3.LootTableEvents;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.storage.loot.LootPool;
|
||||
import net.minecraft.world.level.storage.loot.entries.LootItem;
|
||||
import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition;
|
||||
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class QuicklyLootTables {
|
||||
|
||||
public static final void registerChanges() {
|
||||
LootTableEvents.MODIFY.register((key, tableBuilder, source, registries) -> {
|
||||
if (source.isBuiltin()) {
|
||||
Identifier shortGrass = Identifier.fromNamespaceAndPath("minecraft", "blocks/short_grass");
|
||||
Identifier tallGrass = Identifier.fromNamespaceAndPath("minecraft", "blocks/tall_grass");
|
||||
if (key.identifier().equals(shortGrass)) {
|
||||
tableBuilder.withPool(harvestItemByChance(QuicklyItems.COTTONSEED, 0.05f));
|
||||
} else if (key.identifier().equals(tallGrass)) {
|
||||
tableBuilder.withPool(harvestItemByChance(QuicklyItems.CANOLASEED, 0.03f));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static final LootPool.Builder harvestItemByChance(Item item, float chance) {
|
||||
return LootPool.lootPool().setRolls(ConstantValue.exactly(1f))
|
||||
.when(LootItemRandomChanceCondition.randomChance(chance)).add(LootItem.lootTableItem(item));
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
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 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(ItemBlockRenderTypes.class)
|
||||
public class QuicklyMixin {
|
||||
@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);
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ public class ID {
|
||||
public static final Identifier COTTON = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "cotton");
|
||||
public static final Identifier COTTONPLANT = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "cottonplant");
|
||||
public static final Identifier COTTONSEED = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "cottonseed");
|
||||
public static final Identifier PILLOW = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "pillow");
|
||||
public static final Identifier CANOLA = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "canola");
|
||||
public static final Identifier CANOLAPLANT = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "canolaplant");
|
||||
public static final Identifier CANOLASEED = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "canolaseed");
|
||||
@@ -38,6 +39,7 @@ public class ID {
|
||||
public static final Identifier SALPETER = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "salpeter");
|
||||
public static final Identifier SULFOR = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "sulfor");
|
||||
public static final Identifier CARROTSTACK = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "carrotstack");
|
||||
public static final Identifier POTATOSTACK = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "potatostack");
|
||||
public static final Identifier SPEEDPOWDERAXE = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "speedpowderaxe");
|
||||
public static final Identifier SPEEDPOWDERHOE = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "speedpowderhoe");
|
||||
public static final Identifier SPEEDPOWDERPICKAXE = Identifier.fromNamespaceAndPath(Quickly.MOD_ID,
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package de.jottyfan.minecraft.tab;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.Quickly;
|
||||
import de.jottyfan.minecraft.item.QuicklyItems;
|
||||
import net.fabricmc.fabric.api.creativetab.v1.FabricCreativeModeTab;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class QuicklyTab {
|
||||
|
||||
public static final void registerItemGroup(List<Item> items, List<Block> blocks) {
|
||||
ResourceKey<CreativeModeTab> tabKey = ResourceKey.create(Registries.CREATIVE_MODE_TAB,
|
||||
Identifier.fromNamespaceAndPath(Quickly.MOD_ID, "itemgroup"));
|
||||
|
||||
CreativeModeTab quicklyTab = FabricCreativeModeTab.builder().icon(() -> new ItemStack(QuicklyItems.QUICKIEPICKAXE))
|
||||
.title(Component.translatable("tab.quickly")).displayItems((params, output) -> {
|
||||
for (Item item : items) {
|
||||
output.accept(item);
|
||||
}
|
||||
for (Block block : blocks) {
|
||||
output.accept(block);
|
||||
}
|
||||
}).build();
|
||||
|
||||
Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, tabKey, quicklyTab);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "quickly:item/pillow"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "quickly:item/potatostack"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"info.block.drillfuel": "Ladung: %s Bohrungen",
|
||||
"info.block.drillstraight": "auf ebenes Bohren umgestellt",
|
||||
"info.block.itemhoarder": "enthält: %s",
|
||||
"info.block.monsterhoarder": "Radius: %s, Brenndauer: %s Ticks",
|
||||
"item.quickly.blockcanolaplant": "Rapspflanze",
|
||||
@@ -38,6 +39,8 @@
|
||||
"item.quickly.oresulfor": "Schwefelgestein",
|
||||
"item.quickly.oreturquoise": "Türkiserz",
|
||||
"item.quickly.oxidizedcopperpowder": "oxidiertes Kupferpulver",
|
||||
"item.quickly.pillow": "Kissen",
|
||||
"item.quickly.potatostack": "Kartoffelbündel",
|
||||
"item.quickly.quickieingot": "Eilpulverbarren",
|
||||
"item.quickly.quickiepowder": "Eilpulver",
|
||||
"item.quickly.quickiepowderaxe": "Eilaxt",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"info.block.drillfuel": "Load: %s drills",
|
||||
"info.block.drillstraight": "switched to face drilling",
|
||||
"info.block.itemhoarder": "contains: %s",
|
||||
"info.block.monsterhoarder": "radius: %s, burn ticks: %s",
|
||||
"item.quickly.blockcanolaplant": "canola plant",
|
||||
@@ -38,6 +39,8 @@
|
||||
"item.quickly.oresulfor": "sulfor stone",
|
||||
"item.quickly.oreturquoise": "turquoise ore",
|
||||
"item.quickly.oxidizedcopperpowder": "oxidized copper powder",
|
||||
"item.quickly.pillow": "pillow",
|
||||
"item.quickly.potatostack": "potato bundle",
|
||||
"item.quickly.quickieingot": "quickie powder ingot",
|
||||
"item.quickly.quickiepowder": "quickie powder",
|
||||
"item.quickly.quickiepowderaxe": "hurry axe",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "quickly:item/pillow"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "quickly:item/potatostack"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 597 B |
Binary file not shown.
|
After Width: | Height: | Size: 642 B |
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:alternatives",
|
||||
"children": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"condition": "minecraft:tool/can_shear",
|
||||
"name": "minecraft:short_grass"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"condition": {
|
||||
"type": "minecraft:random_chance",
|
||||
"chance": 0.125
|
||||
},
|
||||
"modifier": [
|
||||
{
|
||||
"type": "minecraft:apply_bonus",
|
||||
"enchantment": "minecraft:fortune",
|
||||
"formula": "minecraft:uniform_bonus_count",
|
||||
"parameters": {
|
||||
"bonusMultiplier": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "minecraft:explosion_decay"
|
||||
}
|
||||
],
|
||||
"name": "minecraft:wheat_seeds"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"condition": {
|
||||
"type": "minecraft:random_chance",
|
||||
"chance": 0.125
|
||||
},
|
||||
"name": "quickly:cottonseed"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:alternatives",
|
||||
"children": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"condition": "minecraft:tool/can_shear",
|
||||
"name": "minecraft:tall_grass"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"condition": {
|
||||
"type": "minecraft:random_chance",
|
||||
"chance": 0.125
|
||||
},
|
||||
"name": "quickly:canolaseed"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"condition": {
|
||||
"type": "minecraft:random_chance",
|
||||
"chance": 0.125
|
||||
},
|
||||
"name": "minecraft:beetroot_seeds"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"condition": {
|
||||
"type": "minecraft:random_chance",
|
||||
"chance": 0.125
|
||||
},
|
||||
"name": "quickly:salpeter"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"components": {
|
||||
"minecraft:block_transformer": "minecraft:axe"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"components": {
|
||||
"minecraft:block_transformer": "minecraft:axe"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"ppp",
|
||||
"www"
|
||||
],
|
||||
"key": {
|
||||
"p": "quickly:pillow",
|
||||
"w": "#minecraft:planks"
|
||||
},
|
||||
"result": {
|
||||
"id": "minecraft:white_bed",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"type": "crafting_shaped",
|
||||
"pattern": [
|
||||
"cc",
|
||||
"cc"
|
||||
],
|
||||
"key": {
|
||||
"c": "minecraft:potato"
|
||||
},
|
||||
"result": {
|
||||
"id": "quickly:potatostack"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "tools",
|
||||
"category": "equipment",
|
||||
"pattern": [
|
||||
" #",
|
||||
"# "
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "tools",
|
||||
"category": "equipment",
|
||||
"pattern": [
|
||||
"ss",
|
||||
"s|",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "tools",
|
||||
"category": "equipment",
|
||||
"pattern": [
|
||||
"ss",
|
||||
" |",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "tools",
|
||||
"category": "equipment",
|
||||
"pattern": [
|
||||
"sss",
|
||||
" | ",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "tools",
|
||||
"category": "equipment",
|
||||
"pattern": [
|
||||
"s",
|
||||
"|",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "tools",
|
||||
"category": "equipment",
|
||||
"pattern": [
|
||||
" #",
|
||||
"# "
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "tools",
|
||||
"category": "equipment",
|
||||
"pattern": [
|
||||
"ss",
|
||||
"s|",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "tools",
|
||||
"category": "equipment",
|
||||
"pattern": [
|
||||
"ss",
|
||||
" |",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "tools",
|
||||
"category": "equipment",
|
||||
"pattern": [
|
||||
"sss",
|
||||
" | ",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "tools",
|
||||
"category": "equipment",
|
||||
"pattern": [
|
||||
"s",
|
||||
"|",
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
"quickly:cotton",
|
||||
"quickly:cotton",
|
||||
"quickly:cotton",
|
||||
"quickly:cotton"
|
||||
],
|
||||
"result": {
|
||||
"id": "quickly:pillow",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
"minecraft:feather",
|
||||
"minecraft:feather",
|
||||
"minecraft:feather",
|
||||
"minecraft:feather",
|
||||
"minecraft:feather",
|
||||
"minecraft:feather",
|
||||
"minecraft:feather",
|
||||
"minecraft:feather",
|
||||
"minecraft:feather"
|
||||
],
|
||||
"result": {
|
||||
"id": "quickly:pillow",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
"quickly:potatostack"
|
||||
],
|
||||
"result": {
|
||||
"id": "minecraft:potato",
|
||||
"count": 4
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"type": "minecraft:stonecutting",
|
||||
"ingredient": "minecraft:bone_block",
|
||||
"result": {
|
||||
"id": "quickly:salpeter",
|
||||
"count": 4
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"type": "minecraft:stonecutting",
|
||||
"ingredient": "minecraft:sulfur_spike",
|
||||
"result": {
|
||||
"id": "quickly:sulfor",
|
||||
"count": 2
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"config": {
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 4,
|
||||
"targets": [
|
||||
{
|
||||
"state": {
|
||||
"Name": "quickly:dirtsalpeter"
|
||||
},
|
||||
"target": {
|
||||
"predicate_type": "minecraft:block_match",
|
||||
"block": "minecraft:dirt"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"config": {
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 20,
|
||||
"targets": [
|
||||
{
|
||||
"state": {
|
||||
"Name": "quickly:oredeepslatesulfor"
|
||||
},
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:deepslate_ore_replaceables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"config": {
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 20,
|
||||
"targets": [
|
||||
{
|
||||
"state": {
|
||||
"Name": "quickly:orenethersulfor"
|
||||
},
|
||||
"target": {
|
||||
"predicate_type": "minecraft:block_match",
|
||||
"block": "minecraft:netherrack"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"config": {
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 12,
|
||||
"targets": [
|
||||
{
|
||||
"state": {
|
||||
"Name": "quickly:oresalpeter"
|
||||
},
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:stone_ore_replaceables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"config": {
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 6,
|
||||
"targets": [
|
||||
{
|
||||
"state": {
|
||||
"Name": "quickly:oresandsalpeter"
|
||||
},
|
||||
"target": {
|
||||
"predicate_type": "minecraft:block_match",
|
||||
"block": "minecraft:sandstone"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"config": {
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 7,
|
||||
"targets": [
|
||||
{
|
||||
"state": {
|
||||
"Name": "quickly:orespeedpowder"
|
||||
},
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:stone_ore_replaceables"
|
||||
}
|
||||
},
|
||||
{
|
||||
"state": {
|
||||
"Name": "quickly:oredeepslatespeedpowder"
|
||||
},
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:deepslate_ore_replaceables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"config": {
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 10,
|
||||
"targets": [
|
||||
{
|
||||
"state": {
|
||||
"Name": "quickly:oresulfor"
|
||||
},
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:stone_ore_replaceables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"config": {
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 10,
|
||||
"targets": [
|
||||
{
|
||||
"state": {
|
||||
"Name": "quickly:oreturquoise"
|
||||
},
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:stone_ore_replaceables"
|
||||
}
|
||||
},
|
||||
{
|
||||
"state": {
|
||||
"Name": "quickly:oredeepslateturquoise"
|
||||
},
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:deepslate_ore_replaceables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"config": {
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 8,
|
||||
"targets": [
|
||||
{
|
||||
"state": {
|
||||
"Name": "quickly:sandsalpeter"
|
||||
},
|
||||
"target": {
|
||||
"predicate_type": "minecraft:block_match",
|
||||
"block": "minecraft:sand"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 4,
|
||||
"targets": [
|
||||
{
|
||||
"state": "quickly:dirtsalpeter",
|
||||
"target": {
|
||||
"predicate_type": "minecraft:block_match",
|
||||
"block": "minecraft:dirt"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 20,
|
||||
"targets": [
|
||||
{
|
||||
"state": "quickly:oredeepslatesulfor",
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:deepslate_ore_replaceables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 20,
|
||||
"targets": [
|
||||
{
|
||||
"state": "quickly:orenethersulfor",
|
||||
"target": {
|
||||
"predicate_type": "minecraft:block_match",
|
||||
"block": "minecraft:netherrack"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 12,
|
||||
"targets": [
|
||||
{
|
||||
"state": "quickly:oresalpeter",
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:stone_ore_replaceables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 6,
|
||||
"targets": [
|
||||
{
|
||||
"state": "quickly:oresandsalpeter",
|
||||
"target": {
|
||||
"predicate_type": "minecraft:block_match",
|
||||
"block": "minecraft:sandstone"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 7,
|
||||
"targets": [
|
||||
{
|
||||
"state": "quickly:orespeedpowder",
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:stone_ore_replaceables"
|
||||
}
|
||||
},
|
||||
{
|
||||
"state": "quickly:oredeepslatespeedpowder",
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:deepslate_ore_replaceables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 10,
|
||||
"targets": [
|
||||
{
|
||||
"state": "quickly:oresulfor",
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:stone_ore_replaceables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 10,
|
||||
"targets": [
|
||||
{
|
||||
"state": "quickly:oreturquoise",
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:stone_ore_replaceables"
|
||||
}
|
||||
},
|
||||
{
|
||||
"state": "quickly:oredeepslateturquoise",
|
||||
"target": {
|
||||
"predicate_type": "minecraft:tag_match",
|
||||
"tag": "minecraft:deepslate_ore_replaceables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"type": "minecraft:ore",
|
||||
"discard_chance_on_air_exposure": 0.0,
|
||||
"size": 8,
|
||||
"targets": [
|
||||
{
|
||||
"state": "quickly:sandsalpeter",
|
||||
"target": {
|
||||
"predicate_type": "minecraft:block_match",
|
||||
"block": "minecraft:sand"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -22,12 +22,9 @@
|
||||
"de.jottyfan.minecraft.QuicklyClient"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"quickly.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.18.4",
|
||||
"minecraft": "~26.1-",
|
||||
"fabricloader": ">=0.19.3",
|
||||
"minecraft": "~26.3-",
|
||||
"java": ">=25",
|
||||
"fabric-api": "*"
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"required": true,
|
||||
"package": "de.jottyfan.minecraft.mixin",
|
||||
"compatibilityLevel": "JAVA_25",
|
||||
"mixins": [
|
||||
"QuicklyMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
},
|
||||
"overwrites": {
|
||||
"requireAnnotations": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user