added canola stack

This commit is contained in:
Jottyfan
2024-01-17 22:56:13 +01:00
parent efca60e5da
commit 7f97cd7060
12 changed files with 61 additions and 3 deletions

View File

@ -9,7 +9,7 @@
loader_version=0.15.1
# Mod Properties
mod_version = 1.20.4.6
mod_version = 1.20.4.7
maven_group = de.jottyfan.minecraft
archives_base_name = quickiefabric

View File

@ -37,7 +37,7 @@ public abstract class DrillBlock extends FallingBlock {
@Override
public BlockState onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
Integer fuelLeft = state.get(FUEL);
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.REDSTONE, fuelLeft)));
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(QuickieItems.CANOLABOTTLE, fuelLeft)));
return super.onBreak(world, pos, state, player);
}
@ -51,6 +51,7 @@ public abstract class DrillBlock extends FallingBlock {
BlockHitResult hit) {
Map<Item, Integer> loadings = new HashMap<>();
loadings.put(QuickieItems.CANOLABOTTLE, 8);
loadings.put(QuickieItems.CANOLABOTTLESTACK, 72);
ItemStack stack = player.getStackInHand(hand);
Item item = stack.getItem();
if (stack.isEmpty() || !loadings.containsKey(item) ) {
@ -64,11 +65,12 @@ public abstract class DrillBlock extends FallingBlock {
if (load < fuelWeight) {
Integer numberOfTooMuchLoad = fuelWeight - load;
fuelWeight = load;
// world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(QuickieItems.CANOLABOTTLE, numberOfTooMuchLoad)));
}
world.setBlockState(pos, state.with(FUEL, state.get(FUEL) + fuelWeight));
if (item.equals(QuickieItems.CANOLABOTTLE)) {
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.GLASS_BOTTLE, 1)));
} else if (item.equals(QuickieItems.CANOLABOTTLESTACK)) {
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.GLASS_BOTTLE, 9)));
}
stack.decrement(1);
}

View File

@ -89,6 +89,7 @@ public class RegistryManager {
stacks.add(new ItemStack(QuickieItems.CANOLA));
stacks.add(new ItemStack(QuickieItems.CANOLASEED));
stacks.add(new ItemStack(QuickieItems.CANOLABOTTLE));
stacks.add(new ItemStack(QuickieItems.CANOLABOTTLESTACK));
stacks.add(new ItemStack(QuickieItems.BACKPACK_BROWN));
stacks.add(new ItemStack(QuickieItems.BACKPACK_WHITE));
stacks.add(new ItemStack(QuickieItems.BACKPACK_BLACK));
@ -248,6 +249,7 @@ public class RegistryManager {
registerItem(QuickieItems.CANOLA, "canola");
registerItem(QuickieItems.CANOLASEED, "canolaseed");
registerItem(QuickieItems.CANOLABOTTLE, "canolabottle");
registerItem(QuickieItems.CANOLABOTTLESTACK, "canolabottlestack");
registerItem(QuickieItems.BACKPACK_BROWN, "backpack_brown");
registerItem(QuickieItems.BACKPACK_WHITE, "backpack_white");
registerItem(QuickieItems.BACKPACK_BLACK, "backpack_black");

View File

@ -0,0 +1,16 @@
package de.jottyfan.minecraft.quickiefabric.items;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.item.Item;
/**
*
* @author jotty
*
*/
public class ItemCanolabottlestack extends Item {
public ItemCanolabottlestack() {
super(new FabricItemSettings().maxCount(64));
}
}

View File

@ -40,4 +40,5 @@ public class QuickieItems {
public static final ItemSpeedingot SPEEDINGOT = new ItemSpeedingot();
public static final ItemQuickieingot QUICKIEINGOT = new ItemQuickieingot();
public static final ItemCanolabottle CANOLABOTTLE = new ItemCanolabottle();
public static final ItemCanolabottlestack CANOLABOTTLESTACK = new ItemCanolabottlestack();
}

View File

@ -43,6 +43,7 @@
"item.quickiefabric.canola": "Raps",
"item.quickiefabric.canolaseed": "Rapssaat",
"item.quickiefabric.canolabottle": "Rapsöl",
"item.quickiefabric.canolabottlestack": "Rapsölsammlung",
"item.quickiefabric.stub": "Stummel",
"item.quickiefabric.oxidizedcopperpowder": "oxidiertes Kupferpulver",
"item.quickiefabric.speedingot": "Fluchtpulverbarren",

View File

@ -43,6 +43,7 @@
"item.quickiefabric.canola": "canola",
"item.quickiefabric.canolaseed": "canola seed",
"item.quickiefabric.canolabottle": "canola oil",
"item.quickiefabric.canolabottlestack": "canola oil collection",
"item.quickiefabric.stub": "stub",
"item.quickiefabric.oxidizedcopperpowder": "oxidized copper powder",
"item.quickiefabric.speedingot": "Speedpowderingot",

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "quickiefabric:item/canolabottlestack"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -0,0 +1,12 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "quickiefabric:canolabottlestack"
}
],
"result": {
"item": "quickiefabric:canolabottle",
"count": 9
}
}

View File

@ -0,0 +1,17 @@
{
"type": "crafting_shaped",
"pattern": [
"ccc",
"ccc",
"ccc"
],
"key": {
"c": {
"item": "quickiefabric:canolabottle"
}
},
"result": {
"item": "quickiefabric:canolabottlestack",
"count": 1
}
}