2 Commits

Author SHA1 Message Date
Jottyfan 8b2bf1291c preparations for 26.2 2026-05-30 17:26:03 +02:00
Jottyfan 26f8bfc113 feathers make pillows, too 2026-05-03 21:01:58 +02:00
14 changed files with 67 additions and 155 deletions
+4 -4
View File
@@ -7,14 +7,14 @@ org.gradle.configuration-cache=false
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=26.1.1
minecraft_version=26.2-pre-2
loader_version=0.19.2
loom_version=1.15-SNAPSHOT
loom_version=1.16-SNAPSHOT
# Mod Properties
mod_version=26.1.1.0
mod_version=26.2.0.0
maven_group=de.jottyfan.minecraft
archives_base_name=quickly
# Dependencies
fabric_api_version=0.145.4+26.1.1
fabric_api_version=0.150.1+26.2
+1 -1
View File
@@ -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
@@ -30,8 +30,8 @@ public class Quickly implements ModInitializer {
public void onInitialize() {
LOGGER.info("loading {}", MOD_ID);
List<Item> items = QuicklyItems.registerModItems();
List<Block> blocks = QuicklyBlocks.registerModBlocks();
List<Item> items = QuicklyItems.registeredModItems();
List<Block> blocks = QuicklyBlocks.registeredModBlocks();
QuicklyBlockEntity.registerBlockEntities();
QuicklyFeatures.registerFeatures();
QuicklyComposter.registerComposterItems();
@@ -102,7 +102,7 @@ public class QuicklyBlocks {
return BuiltInRegistries.BLOCK.getValue(identifier);
}
public static final List<Block> registerModBlocks() {
public static final List<Block> registeredModBlocks() {
Quickly.LOGGER.debug("register blocks");
List<Block> set = new ArrayList<>();
set.add(KELPBUNDLE);
@@ -23,6 +23,7 @@ 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;
/**
*
@@ -50,7 +51,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);
@@ -81,7 +82,7 @@ public class QHoe extends HoeItem implements ToolRangeable {
if (block instanceof CropBlock cBlock) {
if (cBlock.isMaxAge(blockState)) {
LootParams.Builder builder = new LootParams.Builder((ServerLevel) level)
.withParameter(LootContextParams.ORIGIN, pos.getCenter())
.withParameter(LootContextParams.ORIGIN, Vec3.atCenterOf(pos))
.withParameter(LootContextParams.BLOCK_STATE, blockState)
.withOptionalParameter(LootContextParams.BLOCK_ENTITY, level.getBlockEntity(pos))
.withParameter(LootContextParams.TOOL, ItemStack.EMPTY);
@@ -40,38 +40,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;
}
@@ -101,7 +101,7 @@ public class QuicklyItems {
return Registry.register(BuiltInRegistries.ITEM, identifier, item);
}
public static final List<Item> registerModItems() {
public static final List<Item> registeredModItems() {
Quickly.LOGGER.debug("adding Items");
List<Item> set = new ArrayList<>();
set.add(STUB);
@@ -6,8 +6,10 @@ 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.functions.SetItemCountFunction;
import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition;
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator;
/**
*
@@ -27,6 +29,14 @@ public class QuicklyLootTables {
tableBuilder.withPool(harvestItemByChance(QuicklyItems.CANOLASEED, 0.03f));
}
}
if (key.identifier().equals(Identifier.fromNamespaceAndPath("minecraft", "chests/simple_dungeon"))) {
LootPool.Builder poolBuilder = LootPool.lootPool().setRolls(UniformGenerator.between(1.0f, 8.0f));
for (Item item : QuicklyItems.registeredModItems()) {
poolBuilder.add(
LootItem.lootTableItem(item).apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0f, 5.0f))));
}
tableBuilder.withPool(poolBuilder);
}
});
}
@@ -1,56 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "quickly:canola",
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 2
},
"add": false
}
],
"conditions": [
{
"condition": "minecraft:location_check",
"predicate": {
"block": {
"properties": {
"age": "7"
}
}
}
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "quickly:canolaseed",
"functions": [
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:binomial_with_bonus_count",
"parameters": {
"extra": 2,
"probability": 0.5
}
}
]
}
]
}
]
}
@@ -1,55 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "quickly:cotton",
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 3
}
}
],
"conditions": [
{
"condition": "minecraft:location_check",
"predicate": {
"block": {
"properties": {
"age": "7"
}
}
}
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "quickly:cottonseed",
"functions": [
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:binomial_with_bonus_count",
"parameters": {
"extra": 2,
"probability": 0.5
}
}
]
}
]
}
]
}
@@ -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,8 @@
{
"type": "minecraft:stonecutting",
"ingredient": "minecraft:sulfur_spike",
"result": {
"id": "quickly:sulfor",
"count": 2
}
}
+1 -1
View File
@@ -24,7 +24,7 @@
},
"depends": {
"fabricloader": ">=0.19.2",
"minecraft": "~26.1.1-",
"minecraft": "~26.2-",
"java": ">=25",
"fabric-api": "*"
}