Compare commits
2 Commits
main
..
f104344b96
| Author | SHA1 | Date | |
|---|---|---|---|
| f104344b96 | |||
| 074a85343b |
+4
-4
@@ -7,14 +7,14 @@ org.gradle.configuration-cache=false
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
minecraft_version=26.2-pre-2
|
||||
minecraft_version=26.1.1
|
||||
loader_version=0.19.2
|
||||
loom_version=1.16-SNAPSHOT
|
||||
loom_version=1.15-SNAPSHOT
|
||||
|
||||
# Mod Properties
|
||||
mod_version=26.2.0.0
|
||||
mod_version=26.1.1.2
|
||||
maven_group=de.jottyfan.minecraft
|
||||
archives_base_name=quickly
|
||||
|
||||
# Dependencies
|
||||
fabric_api_version=0.150.1+26.2
|
||||
fabric_api_version=0.145.4+26.1.1
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.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.registeredModItems();
|
||||
List<Block> blocks = QuicklyBlocks.registeredModBlocks();
|
||||
List<Item> items = QuicklyItems.registerModItems();
|
||||
List<Block> blocks = QuicklyBlocks.registerModBlocks();
|
||||
QuicklyBlockEntity.registerBlockEntities();
|
||||
QuicklyFeatures.registerFeatures();
|
||||
QuicklyComposter.registerComposterItems();
|
||||
|
||||
@@ -102,7 +102,7 @@ public class QuicklyBlocks {
|
||||
return BuiltInRegistries.BLOCK.getValue(identifier);
|
||||
}
|
||||
|
||||
public static final List<Block> registeredModBlocks() {
|
||||
public static final List<Block> registerModBlocks() {
|
||||
Quickly.LOGGER.debug("register blocks");
|
||||
List<Block> set = new ArrayList<>();
|
||||
set.add(KELPBUNDLE);
|
||||
|
||||
@@ -23,7 +23,6 @@ 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;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -51,7 +50,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(Vec3.atCenterOf(context.getClickedPos()), Direction.UP,
|
||||
BlockHitResult bhr = new BlockHitResult(context.getClickedPos().getCenter(), Direction.UP,
|
||||
context.getClickedPos().offset(x, y, z), false);
|
||||
UseOnContext ctx = new UseOnContext(context.getPlayer(), context.getHand(), bhr);
|
||||
super.useOn(ctx);
|
||||
@@ -82,7 +81,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, Vec3.atCenterOf(pos))
|
||||
.withParameter(LootContextParams.ORIGIN, pos.getCenter())
|
||||
.withParameter(LootContextParams.BLOCK_STATE, blockState)
|
||||
.withOptionalParameter(LootContextParams.BLOCK_ENTITY, level.getBlockEntity(pos))
|
||||
.withParameter(LootContextParams.TOOL, ItemStack.EMPTY);
|
||||
|
||||
@@ -40,24 +40,38 @@ public class QShears extends ShearsItem {
|
||||
sheep.setSheared(true);
|
||||
sheep.playAmbientSound();
|
||||
DyeColor color = sheep.getColor();
|
||||
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();
|
||||
};
|
||||
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;
|
||||
}
|
||||
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> registeredModItems() {
|
||||
public static final List<Item> registerModItems() {
|
||||
Quickly.LOGGER.debug("adding Items");
|
||||
List<Item> set = new ArrayList<>();
|
||||
set.add(STUB);
|
||||
|
||||
@@ -6,10 +6,8 @@ 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;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -29,14 +27,6 @@ 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"type": "minecraft:stonecutting",
|
||||
"ingredient": "minecraft:sulfur_spike",
|
||||
"result": {
|
||||
"id": "quickly:sulfor",
|
||||
"count": 2
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"depends": {
|
||||
"fabricloader": ">=0.19.2",
|
||||
"minecraft": "~26.2-",
|
||||
"minecraft": "~26.1.1-",
|
||||
"java": ">=25",
|
||||
"fabric-api": "*"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user