Compare commits
2 Commits
074a85343b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b2bf1291c | |||
| 26f8bfc113 |
+5
-5
@@ -7,14 +7,14 @@ org.gradle.configuration-cache=false
|
|||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/develop
|
# check these on https://fabricmc.net/develop
|
||||||
minecraft_version=26.1
|
minecraft_version=26.2-pre-2
|
||||||
loader_version=0.18.4
|
loader_version=0.19.2
|
||||||
loom_version=1.15-SNAPSHOT
|
loom_version=1.16-SNAPSHOT
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=26.1.0.1
|
mod_version=26.2.0.0
|
||||||
maven_group=de.jottyfan.minecraft
|
maven_group=de.jottyfan.minecraft
|
||||||
archives_base_name=quickly
|
archives_base_name=quickly
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
fabric_api_version=0.144.0+26.1
|
fabric_api_version=0.150.1+26.2
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
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
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ public class Quickly implements ModInitializer {
|
|||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
LOGGER.info("loading {}", MOD_ID);
|
LOGGER.info("loading {}", MOD_ID);
|
||||||
|
|
||||||
List<Item> items = QuicklyItems.registerModItems();
|
List<Item> items = QuicklyItems.registeredModItems();
|
||||||
List<Block> blocks = QuicklyBlocks.registerModBlocks();
|
List<Block> blocks = QuicklyBlocks.registeredModBlocks();
|
||||||
QuicklyBlockEntity.registerBlockEntities();
|
QuicklyBlockEntity.registerBlockEntities();
|
||||||
QuicklyFeatures.registerFeatures();
|
QuicklyFeatures.registerFeatures();
|
||||||
QuicklyComposter.registerComposterItems();
|
QuicklyComposter.registerComposterItems();
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class QuicklyBlocks {
|
|||||||
return BuiltInRegistries.BLOCK.getValue(identifier);
|
return BuiltInRegistries.BLOCK.getValue(identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final List<Block> registerModBlocks() {
|
public static final List<Block> registeredModBlocks() {
|
||||||
Quickly.LOGGER.debug("register blocks");
|
Quickly.LOGGER.debug("register blocks");
|
||||||
List<Block> set = new ArrayList<>();
|
List<Block> set = new ArrayList<>();
|
||||||
set.add(KELPBUNDLE);
|
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.LootParams;
|
||||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
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++) {
|
for (int z = -range.getzRange(); z <= range.getzRange(); z++) {
|
||||||
if (!isCrop) {
|
if (!isCrop) {
|
||||||
removePossibleGrass(context.getLevel(), new BlockPos(x, y, z));
|
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);
|
context.getClickedPos().offset(x, y, z), false);
|
||||||
UseOnContext ctx = new UseOnContext(context.getPlayer(), context.getHand(), bhr);
|
UseOnContext ctx = new UseOnContext(context.getPlayer(), context.getHand(), bhr);
|
||||||
super.useOn(ctx);
|
super.useOn(ctx);
|
||||||
@@ -81,7 +82,7 @@ public class QHoe extends HoeItem implements ToolRangeable {
|
|||||||
if (block instanceof CropBlock cBlock) {
|
if (block instanceof CropBlock cBlock) {
|
||||||
if (cBlock.isMaxAge(blockState)) {
|
if (cBlock.isMaxAge(blockState)) {
|
||||||
LootParams.Builder builder = new LootParams.Builder((ServerLevel) level)
|
LootParams.Builder builder = new LootParams.Builder((ServerLevel) level)
|
||||||
.withParameter(LootContextParams.ORIGIN, pos.getCenter())
|
.withParameter(LootContextParams.ORIGIN, Vec3.atCenterOf(pos))
|
||||||
.withParameter(LootContextParams.BLOCK_STATE, blockState)
|
.withParameter(LootContextParams.BLOCK_STATE, blockState)
|
||||||
.withOptionalParameter(LootContextParams.BLOCK_ENTITY, level.getBlockEntity(pos))
|
.withOptionalParameter(LootContextParams.BLOCK_ENTITY, level.getBlockEntity(pos))
|
||||||
.withParameter(LootContextParams.TOOL, ItemStack.EMPTY);
|
.withParameter(LootContextParams.TOOL, ItemStack.EMPTY);
|
||||||
|
|||||||
@@ -40,38 +40,24 @@ public class QShears extends ShearsItem {
|
|||||||
sheep.setSheared(true);
|
sheep.setSheared(true);
|
||||||
sheep.playAmbientSound();
|
sheep.playAmbientSound();
|
||||||
DyeColor color = sheep.getColor();
|
DyeColor color = sheep.getColor();
|
||||||
Item item = Items.WHITE_WOOL;
|
Item item = switch (color) {
|
||||||
if (color.equals(DyeColor.BLACK)) {
|
case BLACK -> Items.WOOL.black();
|
||||||
item = Items.BLACK_WOOL;
|
case GRAY -> Items.WOOL.gray();
|
||||||
} else if (color.equals(DyeColor.GRAY)) {
|
case LIGHT_GRAY -> Items.WOOL.lightGray();
|
||||||
item = Items.GRAY_WOOL;
|
case BROWN -> Items.WOOL.brown();
|
||||||
} else if (color.equals(DyeColor.LIGHT_GRAY)) {
|
case BLUE -> Items.WOOL.blue();
|
||||||
item = Items.LIGHT_GRAY_WOOL;
|
case LIGHT_BLUE -> Items.WOOL.lightBlue();
|
||||||
} else if (color.equals(DyeColor.BROWN)) {
|
case GREEN -> Items.WOOL.green();
|
||||||
item = Items.BROWN_WOOL;
|
case LIME -> Items.WOOL.lime();
|
||||||
} else if (color.equals(DyeColor.BLUE)) {
|
case CYAN -> Items.WOOL.cyan();
|
||||||
item = Items.BLUE_WOOL;
|
case MAGENTA -> Items.WOOL.magenta();
|
||||||
} else if (color.equals(DyeColor.LIGHT_BLUE)) {
|
case ORANGE -> Items.WOOL.orange();
|
||||||
item = Items.LIGHT_BLUE_WOOL;
|
case PINK -> Items.WOOL.pink();
|
||||||
} else if (color.equals(DyeColor.GREEN)) {
|
case PURPLE -> Items.WOOL.purple();
|
||||||
item = Items.GREEN_WOOL;
|
case RED -> Items.WOOL.red();
|
||||||
} else if (color.equals(DyeColor.LIME)) {
|
case YELLOW -> Items.WOOL.yellow();
|
||||||
item = Items.LIME_WOOL;
|
default -> Items.WOOL.white();
|
||||||
} 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;
|
|
||||||
}
|
|
||||||
user.level().addFreshEntity(new ItemEntity(user.level(), pos.x, pos.y, pos.z, new ItemStack(item, amount)));
|
user.level().addFreshEntity(new ItemEntity(user.level(), pos.x, pos.y, pos.z, new ItemStack(item, amount)));
|
||||||
return InteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class QuicklyItems {
|
|||||||
return Registry.register(BuiltInRegistries.ITEM, identifier, item);
|
return Registry.register(BuiltInRegistries.ITEM, identifier, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final List<Item> registerModItems() {
|
public static final List<Item> registeredModItems() {
|
||||||
Quickly.LOGGER.debug("adding Items");
|
Quickly.LOGGER.debug("adding Items");
|
||||||
List<Item> set = new ArrayList<>();
|
List<Item> set = new ArrayList<>();
|
||||||
set.add(STUB);
|
set.add(STUB);
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ import net.minecraft.resources.Identifier;
|
|||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.level.storage.loot.LootPool;
|
import net.minecraft.world.level.storage.loot.LootPool;
|
||||||
import net.minecraft.world.level.storage.loot.entries.LootItem;
|
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.predicates.LootItemRandomChanceCondition;
|
||||||
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
|
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));
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,8 +23,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.18.4",
|
"fabricloader": ">=0.19.2",
|
||||||
"minecraft": "~26.1-",
|
"minecraft": "~26.2-",
|
||||||
"java": ">=25",
|
"java": ">=25",
|
||||||
"fabric-api": "*"
|
"fabric-api": "*"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user