Compare commits

...
18 Commits
Author SHA1 Message Date
jotty ba5cb6a241 Merge pull request 'Regenbogenspitzhacke' (#6) from Mama+Papa=Caspar into main
Reviewed-on: #6
2026-10-28 20:27:40 +01:00
jotty dd2ce91669 Merge pull request 'Lios branch' (#5) from Lios_Branch into main
Reviewed-on: #5
2026-10-28 20:27:12 +01:00
jotty 0c09511fcf Merge pull request 'Item schwertwerfer hinzugefuegt' (#4) from Moritz into main
Reviewed-on: #4
2026-10-28 20:25:55 +01:00
lio ef6d1b20c1 Merge remote-tracking branch 'origin/main' into Lios_Branch 2026-10-28 16:15:36 +01:00
lio 9d71192566 futuristic crossbow 2026-10-28 16:12:25 +01:00
moritz.marek 584d08d7d4 Item schwertwerfer hinzugefuegt 2026-10-27 16:56:32 +01:00
Jottyfan 312e73f184 added pig food 2026-10-24 16:50:12 +02:00
Jottyfan 5c9dbe95e5 added food 2026-10-24 16:33:09 +02:00
Jottyfan 0b4936f47d added tool (stub) 2026-10-15 19:05:13 +02:00
Jottyfan 96c4be6a0d added tin dust 2026-10-09 00:42:59 +02:00
jotty 0d12beb4be Merge pull request 'chili hinzugefügt' (#3) from Neuer_Branch_von_Mara into main
Reviewed-on: #3
2026-10-07 17:30:59 +02:00
henkej 322ca79d0c Merge branch 'main' into Neuer_Branch_von_Mara 2026-10-07 17:30:19 +02:00
user 7d3de83b3d chili hinzugefügt 2026-10-07 18:27:44 +02:00
Jottyfan 7adba1c7d9 added ignore file 2026-10-04 18:57:03 +02:00
Jottyfan 1c4689207d added tin ore block 2026-10-04 18:55:57 +02:00
Jottyfan f14df66360 added tin_ingot and raw_tin 2026-10-01 00:38:47 +02:00
jotty 33aba37f67 Merge pull request 'Add cat_food' (#2) from kitti-cat into main
Reviewed-on: #2
2026-09-30 23:31:30 +02:00
user 3fdeeb0bdb Add cat_food 2026-09-30 18:48:12 +02:00
43 changed files with 319 additions and 24 deletions

No files matched your search

+5
View File
@@ -41,6 +41,11 @@ run/crash-reports
run/xaero run/xaero
run/screenshots run/screenshots
run/Xaero* run/Xaero*
<<<<<<< HEAD
run/serves*
=======
>>>>>>> refs/remotes/origin/main
run/command_history.txt
# java # java
+13 -14
View File
@@ -2,22 +2,21 @@
<projectDescription> <projectDescription>
<name>mfmd2627</name> <name>mfmd2627</name>
<comment></comment> <comment></comment>
<projects> <projects/>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures> <natures>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature> <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures> </natures>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments/>
</buildCommand>
</buildSpec>
<linkedResources/>
<filteredResources/>
</projectDescription> </projectDescription>
+1 -1
View File
@@ -1,5 +1,5 @@
# #
#Fri Jul 03 23:44:46 CEST 2026 #Wed Sep 02 18:41:28 CEST 2026
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=25 org.eclipse.jdt.core.compiler.codegen.targetPlatform=25
BIN
View File
Binary file not shown.
Binary file not shown.
@@ -5,10 +5,12 @@ import java.util.List;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import de.jottyfan.minecraft.block.ModBlocks;
import de.jottyfan.minecraft.item.ModItems; import de.jottyfan.minecraft.item.ModItems;
import de.jottyfan.minecraft.tab.ModTab; import de.jottyfan.minecraft.tab.ModTab;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
/** /**
* *
@@ -24,6 +26,7 @@ public class Mfmd2627 implements ModInitializer {
public void onInitialize() { public void onInitialize() {
LOGGER.debug("initializing {}", MOD_ID); LOGGER.debug("initializing {}", MOD_ID);
List<Item> items = ModItems.registerItems(); List<Item> items = ModItems.registerItems();
ModTab.registerItemGroup(items); List<Block> blocks = ModBlocks.registerBlocks();
ModTab.registerItemGroup(items, blocks);
} }
} }
@@ -0,0 +1,17 @@
package de.jottyfan.minecraft.block;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.world.level.block.Block;
public class ModBlocks extends ModBlocksRegistrator {
public static final Block TIN_ORE = registerBlock("tin_ore");
public static final List<Block> registerBlocks() {
List<Block> registeredBlocks = new ArrayList<>();
registeredBlocks.add(TIN_ORE);
return registeredBlocks;
}
}
@@ -0,0 +1,37 @@
package de.jottyfan.minecraft.block;
import java.util.function.Function;
import de.jottyfan.minecraft.Mfmd2627;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
public class ModBlocksRegistrator {
public static final Block registerBlock(String name) {
return registerBlock(name, BlockBehaviour.Properties.of(), Block::new);
}
public static final Block registerBlock(String name, Properties properties,
Function<Block.Properties, Block> function) {
Identifier identifier = Identifier.fromNamespaceAndPath(Mfmd2627.MOD_ID, name);
Block block = function.apply(properties.setId(ResourceKey.create(Registries.BLOCK, identifier)));
Registry.register(BuiltInRegistries.BLOCK, identifier, block);
registerBlockItem(identifier, block, new Item.Properties());
return block;
}
private static final void registerBlockItem(Identifier identifier, Block block, Item.Properties properties) {
BlockItem blockItem = new BlockItem(block, new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, identifier)).modelId(identifier).useItemDescriptionPrefix());
Registry.register(BuiltInRegistries.ITEM, identifier, blockItem);
}
}
@@ -0,0 +1,17 @@
package de.jottyfan.minecraft.item;
import net.minecraft.world.food.FoodProperties;
public enum Food {
GINGERBREAD(new FoodProperties.Builder().nutrition(1).saturationModifier(0.1f).build());
private final FoodProperties properties;
private Food(FoodProperties properties) {
this.properties = properties;
}
public FoodProperties get() {
return properties;
}
}
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.Item.Properties;
/** /**
* *
@@ -11,13 +12,27 @@ import net.minecraft.world.item.Item;
* *
*/ */
public class ModItems extends ModItemsRegistrator { public class ModItems extends ModItemsRegistrator {
public static final Item STUB = registerItem("stub"); public static final Item RAW_TIN = registerItem("raw_tin");
public static final Item RUBY = registerItem("ruby"); public static final Item RUBY = registerItem("ruby");
public static final Item FUTURISTIC_CROSSBOW = registerItem("futuristic_crossbow");
public static final Item CHILI = registerItem("chili");
public static final Item STUB = registerItem("stub", StubItem::new);
public static final Item TIN_INGOT = registerItem("tin_ingot");
public static final Item TIN_DUST = registerItem("tin_dust");
public static final Item GINGERBREAD = registerItem("gingerbread", new Properties().food(Food.GINGERBREAD.get()));
public static final Item SCHWERTWERFER = registerItem("schwertwerfer");
public static final List<Item> registerItems() { public static final List<Item> registerItems() {
List<Item> registeredItems = new ArrayList<>(); List<Item> registeredItems = new ArrayList<>();
registeredItems.add(STUB); registeredItems.add(STUB);
registeredItems.add(RUBY); registeredItems.add(RUBY);
registeredItems.add(FUTURISTIC_CROSSBOW);
registeredItems.add(CHILI);
registeredItems.add(RAW_TIN);
registeredItems.add(TIN_INGOT);
registeredItems.add(TIN_DUST);
registeredItems.add(GINGERBREAD);
registeredItems.add(SCHWERTWERFER);
return registeredItems; return registeredItems;
} }
} }
@@ -28,12 +28,34 @@ public abstract class ModItemsRegistrator {
return registerItem(name, new Item.Properties(), Item::new); return registerItem(name, new Item.Properties(), Item::new);
} }
/**
* register a new item with the name and its item class
*
* @param name the name
* @param properties the properties; create it with <code style="color: gray">new Item.Properties();</code>
* @return the registered item
*/
public static final Item registerItem(String name, Properties properties) {
return registerItem(name, properties, Item::new);
}
/**
* register a new item with the name and its properties
*
* @param name the name
* @param function the function; create it with <code style="color: gray">Item::new</code>
* @return the registered item
*/
public static final Item registerItem(String name, Function<Item.Properties, Item> function) {
return registerItem(name, new Item.Properties(), function);
}
/** /**
* register a new item with the name, the properties and the Item class reference * register a new item with the name, the properties and the Item class reference
* *
* @param name the name of the item * @param name the name of the item
* @param the properties; create it with <code style="color: gray">new Item.Properties();</code> * @param properties the properties; create it with <code style="color: gray">new Item.Properties();</code>
* @param the function; create it with <code style="color: gray">Item::new</code> * @param function the function; create it with <code style="color: gray">Item::new</code>
* @return the registered item * @return the registered item
*/ */
public static final Item registerItem(String name, Properties properties, Function<Item.Properties, Item> function) { public static final Item registerItem(String name, Properties properties, Function<Item.Properties, Item> function) {
@@ -0,0 +1,49 @@
package de.jottyfan.minecraft.item;
import java.util.Map;
import org.joml.Random;
import net.minecraft.core.BlockPos;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
/**
* the stub item definition; specifies, what the stub can do
*/
public class StubItem extends Item {
private static final Map<Block, Item> SLASH_MAP = Map.of(Blocks.HAY_BLOCK, Items.WHEAT, Blocks.DRIED_KELP_BLOCK,
Items.DRIED_KELP);
public StubItem(Properties properties) {
super(properties);
}
@Override
public InteractionResult useOn(UseOnContext context) {
Level level = context.getLevel();
BlockPos pos = context.getClickedPos();
Block block = level.getBlockState(pos).getBlock();
if (SLASH_MAP.containsKey(block) && !level.isClientSide()) {
level.setBlockAndUpdate(pos, Blocks.AIR.defaultBlockState());
level.playSound(null, pos, SoundEvents.HOE_TILL.value(), SoundSource.BLOCKS);
for (int i = 0; i < 9; i++) {
ItemStack stack = new ItemStack(SLASH_MAP.get(block));
float scatter = new Random().nextFloat();
ItemEntity entity = new ItemEntity(level, pos.getX(), pos.getY(), pos.getZ(),
stack, scatter, scatter, 0.2);
level.addFreshEntity(entity);
}
}
return InteractionResult.SUCCESS;
}
}
@@ -14,6 +14,7 @@ import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
/** /**
* *
@@ -27,7 +28,7 @@ public class ModTab {
* *
* @param items the items * @param items the items
*/ */
public static final void registerItemGroup(List<Item> items) { public static final void registerItemGroup(List<Item> items, List<Block> blocks) {
ResourceKey<CreativeModeTab> tabKey = ResourceKey.create(Registries.CREATIVE_MODE_TAB, ResourceKey<CreativeModeTab> tabKey = ResourceKey.create(Registries.CREATIVE_MODE_TAB,
Identifier.fromNamespaceAndPath(Mfmd2627.MOD_ID, "itemgroup")); Identifier.fromNamespaceAndPath(Mfmd2627.MOD_ID, "itemgroup"));
@@ -36,6 +37,9 @@ public class ModTab {
for (Item item : items) { for (Item item : items) {
output.accept(item); output.accept(item);
} }
for (Block block : blocks) {
output.accept(block.asItem());
}
}).build(); }).build();
Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, tabKey, quicklyTab); Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, tabKey, quicklyTab);
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "mfmd2627:block/tin_ore"
}
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "mfmd2627:item/chili"
}
}
@@ -0,0 +1,6 @@
{
"model":{
"type": "minecraft:model",
"model": "minecraft:item/futuristic_crossbow"
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "mfmd2627:item/gingerbread"
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "mfmd2627:item/raw_tin"
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "mfmd2627:item/schwertwerfer"
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "mfmd2627:item/tin_dust"
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "mfmd2627:item/tin_ingot"
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "mfmd2627:block/tin_ore"
}
}
@@ -1,5 +1,12 @@
{ {
"item.mfmd2627.gingerbread": "Lebkuchen",
"item.mfmd2627.stub": "Stummel", "item.mfmd2627.stub": "Stummel",
"item.mfmd2627.raw_tin": "Zinn",
"item.mfmd2627.ruby": "Rubin", "item.mfmd2627.ruby": "Rubin",
"tab.mfmd2627": "Mfmd2627" "item.mfmd2627.futuristic_crossbow": "futuristische Armbrust",
} "item.mfmd2627.tin_dust": "Zinnpulver",
"item.mfmd2627.tin_ingot": "Zinnbarren",
"item.mfmd2627.tin_ore": "Zinnerz",
"tab.mfmd2627": "Mfmd2627",
"item.mfmd2627.schwertwerfer": "Schwertwerfer"
}
@@ -1,5 +1,12 @@
{ {
"item.mfmd2627.gingerbread": "Gingerbread",
"item.mfmd2627.stub": "Stub", "item.mfmd2627.stub": "Stub",
"item.mfmd2627.raw_tin": "Tin",
"item.mfmd2627.ruby": "Ruby", "item.mfmd2627.ruby": "Ruby",
"tab.mfmd2627": "Mfmd2627" "item.mfmd2627.futuristic_crossbow": "Futuristic Crossbow",
} "item.mfmd2627.tin_dust": "Tin Dust",
"item.mfmd2627.tin_ingot": "Tin Ingot",
"item.mfmd2627.tin_ore": "Tin Ore",
"tab.mfmd2627": "Mfmd2627",
"item.mfmd2627.schwertwerfer": "Sword Thrower"
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "mfmd2627:block/tin_ore"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mfmd2627:item/chili"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mfmd2627:item/futuristic_crossbow"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mfmd2627:item/gingerbread"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mfmd2627:item/raw_tin"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mfmd2627:item/schwertwerfer"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mfmd2627:item/tin_dust"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mfmd2627:item/tin_ingot"
}
}
@@ -0,0 +1,3 @@
{
"parent": "minecraft:block/tin_ore"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"mfmd2627:gingerbread"
]
}