Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master—' into master—
Browse files Browse the repository at this point in the history
  • Loading branch information
Lithewings committed Jul 29, 2024
1 parent a495eb1 commit c3d2644
Show file tree
Hide file tree
Showing 26 changed files with 166 additions and 33 deletions.
41 changes: 41 additions & 0 deletions src/main/generated/.cache/8ce55c2d46c78681d7eebf7cad72e9c2de67a045
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// 1.21 2024-07-29T03:03:04.7432411 MITEequilibrium/Model Definitions
dccf3bc904ca2659a45b1924b2b5dd8188a0ef27 assets\miteequilibrium\blockstates\gold_block.json
bf6219fde185b69def1a3cb8977dbb23ab0b560c assets\miteequilibrium\models\item\mithril_ore.json
6aa639f29ea4e247aa818822152bded3ec0a0ef4 assets\miteequilibrium\blockstates\mithril_block.json
a3aa407225058101f487dc2d69a2323cff577294 assets\miteequilibrium\models\block\silver_ore.json
6deb1bf7820e58ac89e2411f78d6925861ce3cf5 assets\miteequilibrium\models\item\silver_nugget.json
46bfd511f5c0f2f1afc5d77cc9dbd0144377d522 assets\miteequilibrium\models\item\mithril_nugget.json
15c22b2ffa7c2dda180ffcadd87e26e7542db7c5 assets\miteequilibrium\blockstates\silver_ore.json
904f5b6be17869c8e9b6bc8b25fd229e15163b7e assets\miteequilibrium\models\block\gold_block.json
c6d473a5f7fb2189afdb6f6040f9449d6355e4c9 assets\miteequilibrium\models\block\copper_block.json
8a2002cdb9a1c1088eac1973807e01b3db6a8fc7 assets\miteequilibrium\blockstates\gold_ore.json
37a416ce5d40380df1321db7e7272faa4858973c assets\miteequilibrium\models\item\copper_nugget.json
cabffc3950e51bb500254bcd2a47053341050615 assets\miteequilibrium\blockstates\copper_block.json
88b2592c9e57bdfd9ff42721aee23f1879810fcc assets\miteequilibrium\models\block\gold_ore.json
1c76eeb8e434a4959a45a985f71e33bee98cef47 assets\miteequilibrium\blockstates\ancient_metal_block.json
1a33bb82f46b606fab1e1e0d8c970942b6f39727 assets\miteequilibrium\models\item\ancient_metal_block.json
0c2d41191b17a2834e2684947e382b5dccdfa6ed assets\miteequilibrium\models\item\gold_ore.json
d7f20ad7d635c2505ea669d0de4c217d2ea182ef assets\miteequilibrium\models\block\mithril_ore.json
b41255903349f66fb5b8c8732ca305c79510b588 assets\miteequilibrium\models\item\copper_ore.json
dd63bef5ea7f82d06c0c162106a2c5a9a1efee37 assets\miteequilibrium\blockstates\mithril_ore.json
d23ecf679ccfafb2cf9b62c3aec46729ba685fa0 assets\miteequilibrium\models\item\ancient_metal_nugget.json
ddd198fb1a94b797709f8a13de207a162ca83920 assets\miteequilibrium\blockstates\silver_block.json
3a0550b68023aeb8d1f2e05c3bc8b1683a5ec457 assets\miteequilibrium\models\block\copper_ore.json
daac16a0ec15119c4965bf7b42998bf7c30f46fc assets\miteequilibrium\blockstates\adamantium_ore.json
ebbf1665c7578e664e339d1379497b8e68ceb9f9 assets\miteequilibrium\blockstates\adamantium_block.json
9dbf5484c735d893e147d2526067c47fb4f31ffa assets\miteequilibrium\models\item\adamantium_ore.json
1d9a2dd39ad592b4ecec5e920aa31e0150f1e703 assets\miteequilibrium\models\item\adamantium_block.json
47b83ac7ffdcd4f349e7b9d2c9ecbaa7296cd2c1 assets\miteequilibrium\models\block\adamantium_ore.json
7167477d055461b8c0d0dd1ddff296c3e8739c1b assets\miteequilibrium\models\item\gold_nugget.json
71230db95fb36a59ca886b42a8578a7e5289f27e assets\miteequilibrium\models\block\mithril_block.json
4993969e47354bc3559414336f2a3d6f20da6d3f assets\miteequilibrium\models\item\gold_block.json
9c2092f86b72ce8167788a7d59bb2f6915f0caf6 assets\miteequilibrium\models\block\ancient_metal_block.json
cc71d90802971d78699316fe4bd7e793c923ee84 assets\miteequilibrium\models\item\flint_hatchet.json
f34fa81117489a9a66ea93f728f5f2bcbec9b953 assets\miteequilibrium\models\block\silver_block.json
3bfc6b2a90d037aeb9e8e8793afd2559a496a5df assets\miteequilibrium\models\item\silver_ore.json
b834efa7e8d540313d35956439827b44a4cee03e assets\miteequilibrium\models\block\adamantium_block.json
d3ae8dd9287a60924640b0e719f39f41d143c8b9 assets\miteequilibrium\models\item\silver_block.json
d09505456e3c561372cd4929b1a786ddbd931bb7 assets\miteequilibrium\models\item\mithril_block.json
d918fe036accbdb8c8dad219ff5b3f769ac1b7ab assets\miteequilibrium\models\item\adamantium_nugget.json
5af9fa21466ac378f1f8783fc5934cb0e6c77eca assets\miteequilibrium\blockstates\copper_ore.json
106cb8fa8b1669c63211922d5b858bb6ad95b6e3 assets\miteequilibrium\models\item\copper_block.json
8 changes: 5 additions & 3 deletions src/main/java/com/equilibrium/MITEequilibrium.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
import com.equilibrium.item.ModItemGroup;
import com.equilibrium.item.ModItems;
import com.equilibrium.item.Tools;
import com.equilibrium.register.tags.ModItemTags;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import org.slf4j.Logger;
Expand All @@ -20,8 +23,8 @@
import com.equilibrium.register.UseBlock;
import com.equilibrium.event.sound.SoundEventRegistry;
import com.equilibrium.util.CreativeGroup;
import com.equilibrium.mixin.crafttime.worklevel.CraftingIngredients;
import com.equilibrium.mixin.crafttime.worklevel.FurnaceIngredients;
import com.equilibrium.worklevel.CraftingIngredients;
import com.equilibrium.worklevel.FurnaceIngredients;


import static com.equilibrium.entity.ModEntities.registerModEntities;
Expand Down Expand Up @@ -105,7 +108,6 @@ public void onInitialize() {




LOGGER.info("Hello Fabric world!");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator){
// pack.addProvider(ModRecipeGenerator::new);
// pack.addProvider(ModModelProvider::new);
// pack.addProvider(ModLanguageTranslatorZhCn::new);
// pack.addProvider(BlocksTagsGen::new);
// pack.addProvider(TagsProvider::new);


}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/equilibrium/gen/ModModelProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.equilibrium.block.ModBlocks;
import com.equilibrium.item.Metal;
import com.equilibrium.item.Tools;
import com.equilibrium.item.tools.ModToolMaterials;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider;
import net.minecraft.data.client.BlockStateModelGenerator;
Expand Down Expand Up @@ -55,6 +57,7 @@ public void generateItemModels(ItemModelGenerator itemModelGenerator) {
itemModelGenerator.register(Metal.silver_nugget, Models.GENERATED);


itemModelGenerator.register(Tools.FLINT_HATCHET, Models.HANDHELD);

}
}
44 changes: 44 additions & 0 deletions src/main/java/com/equilibrium/gen/TagsProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.equilibrium.gen;

import com.equilibrium.register.tags.ModItemTags;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
import net.minecraft.item.Items;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.tag.ItemTags;
import org.jetbrains.annotations.Nullable;

import java.util.concurrent.CompletableFuture;

public class TagsProvider extends FabricTagProvider.ItemTagProvider {
/**
* Construct an {@link ItemTagProvider} tag provider <b>with</b> an associated {@link BlockTagProvider} tag provider.
*
* @param output The {@link FabricDataOutput} instance
* @param completableFuture
* @param blockTagProvider
*/
public TagsProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> completableFuture, @Nullable FabricTagProvider.BlockTagProvider blockTagProvider) {
super(output, completableFuture, blockTagProvider);
}
/**
* Constructs a new {@link FabricTagProvider} with the default computed path.
*
* <p>Common implementations of this class are provided.
*
* @param output the {@link FabricDataOutput} instance
* @param registryKey
* @param registriesFuture the backing registry for the tag type
*/

/**
* Implement this method and then use {@link FabricTagProvider#getOrCreateTagBuilder} to get and register new tag builders.
*
* @param wrapperLookup
*/
@Override
protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) {
getOrCreateTagBuilder(ItemTags.FISHES).add(Items.ACACIA_BOAT);
}
}
1 change: 1 addition & 0 deletions src/main/java/com/equilibrium/item/ModItemGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class ModItemGroup {
entries.add(ModBlocks.MITHRIL_ORE);
entries.add(ModBlocks.SILVER_ORE);

entries.add(Tools.FLINT_HATCHET);

}
).build());
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/com/equilibrium/item/Tools.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package com.equilibrium.item;


import com.equilibrium.item.tools.FlintHatchet;
import com.equilibrium.item.tools.ModToolMaterials;
import net.minecraft.item.Item;
import net.minecraft.item.PickaxeItem;
import net.minecraft.item.ShovelItem;
import net.minecraft.item.ToolMaterials;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
Expand All @@ -15,7 +20,7 @@ public class Tools {
public static final Item adamantium_hatchet = new Item(new Item.Settings());



public static final Item FLINT_HATCHET = new FlintHatchet(ModToolMaterials.FLINT_HATCHET,new Item.Settings().attributeModifiers(FlintHatchet.createAttributeModifiers(ModToolMaterials.FLINT_HATCHET,3,1.0f)));



Expand All @@ -26,7 +31,7 @@ public static void registerModItemTools() {
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_hatchet"), adamantium_hatchet);



Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","flint_hatchet"),FLINT_HATCHET);



Expand Down
17 changes: 17 additions & 0 deletions src/main/java/com/equilibrium/item/tools/FlintHatchet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.equilibrium.item.tools;

import com.equilibrium.MITEequilibrium;
import com.equilibrium.mixin.MITEequilibriumMixin;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.item.MiningToolItem;
import net.minecraft.item.ToolMaterial;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.registry.tag.TagKey;

public class FlintHatchet extends MiningToolItem {
public FlintHatchet(ToolMaterial material,Settings settings) {
super(material, BlockTags.AXE_MINEABLE, settings);
}

}
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
package com.equilibrium.mixin.tool;
package com.equilibrium.item.tools;

import com.equilibrium.register.tags.ModBlockTags;
import com.google.common.base.Suppliers;
import java.util.function.Supplier;
import net.minecraft.block.Block;
import net.minecraft.item.Items;
import net.minecraft.item.ToolMaterial;
import net.minecraft.item.*;
import net.minecraft.recipe.Ingredient;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.registry.tag.ItemTags;
import net.minecraft.registry.tag.TagKey;

/**
* Provides the default {@link ToolMaterial}s used by vanilla tools.
*/
public enum ToolMaterials implements ToolMaterial {
WOOD(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 590, 2.0F, 0.0F, 15, () -> Ingredient.fromTag(ItemTags.PLANKS)),
STONE(BlockTags.INCORRECT_FOR_STONE_TOOL, 131, 4.0F, 1.0F, 5, () -> Ingredient.fromTag(ItemTags.STONE_TOOL_MATERIALS)),
IRON(BlockTags.INCORRECT_FOR_IRON_TOOL, 250, 6.0F, 2.0F, 14, () -> Ingredient.ofItems(Items.IRON_INGOT)),
DIAMOND(BlockTags.INCORRECT_FOR_DIAMOND_TOOL, 1561, 8.0F, 3.0F, 10, () -> Ingredient.ofItems(Items.DIAMOND)),
GOLD(BlockTags.INCORRECT_FOR_GOLD_TOOL, 32, 12.0F, 0.0F, 22, () -> Ingredient.ofItems(Items.GOLD_INGOT)),
NETHERITE(BlockTags.INCORRECT_FOR_NETHERITE_TOOL, 2031, 9.0F, 4.0F, 15, () -> Ingredient.ofItems(Items.NETHERITE_INGOT));
import java.util.function.Supplier;

public enum ModToolMaterials implements ToolMaterial {


FLINT_HATCHET(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 320, 2.0F, 0.0F, 15, () -> Ingredient.ofItems(Items.FLINT));


private final TagKey<Block> inverseTag;
private final int itemDurability;
Expand All @@ -28,7 +24,7 @@ public enum ToolMaterials implements ToolMaterial {
private final int enchantability;
private final Supplier<Ingredient> repairIngredient;

private ToolMaterials(
private ModToolMaterials(
final TagKey<Block> inverseTag,
final int itemDurability,
final float miningSpeed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ public void getBlockInteractionRange(CallbackInfoReturnable<Double> cir) {
@Inject(method = "getEntityInteractionRange", at = @At("HEAD"), cancellable = true)
public void getEntityInteractionRange(CallbackInfoReturnable<Double> cir) {
ItemStack itemstack = this.getMainHandStack();
if (itemstack.isEnchantable()) {

if (itemstack.isEnchantable()) {
if (itemstack.isIn(ItemTags.SHOVELS)) {
//铲子
setEntityInteractBonus(0.75f);
Expand All @@ -160,6 +160,8 @@ public void getEntityInteractionRange(CallbackInfoReturnable<Double> cir) {
} else if (itemstack.isIn(ItemTags.HOES)) {
//锄头
setEntityInteractBonus(0.75f);
} else if(itemstack.isIn(ModItemTags.HATCHET)){
setEntityInteractBonus(0.5f);
}

} else if (itemstack.isOf(Items.STICK) || itemstack.isOf(Items.BONE)) {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/equilibrium/mixin/recipeModifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ private static void updateResult(




resultInventory.setStack(0, itemStack);
handler.setPreviousTrackedSlot(0, itemStack);
serverPlayerEntity.networkHandler.sendPacket(new ScreenHandlerSlotUpdateS2CPacket(handler.syncId, handler.nextRevision(), 0, itemStack));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.equilibrium.config.CommonConfig;

import com.equilibrium.register.BlockInit;
import com.equilibrium.mixin.crafttime.worklevel.FurnaceIngredients;
import com.equilibrium.worklevel.FurnaceIngredients;
import com.google.common.collect.Maps;
import net.minecraft.SharedConstants;
import net.minecraft.block.Block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.equilibrium.config.CommonConfig;
import com.equilibrium.register.BlockInit;
import com.equilibrium.mixin.crafttime.worklevel.CraftingIngredients;
import com.equilibrium.worklevel.CraftingIngredients;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.block.CraftingTableBlock;
import net.minecraft.entity.player.PlayerEntity;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/equilibrium/register/tags/ModItemTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public class ModItemTags {
public static final TagKey<Item> HARVEST_THREE = of("tool_harvest_3");
public static final TagKey<Item> HARVEST_FOUR = of("tool_harvest_4");

public static final TagKey<Item> HATCHET = of("hatchet");

public static final TagKey<Item> MINING_ENCHANTABLE = of("mining_enchantable");


private static TagKey<Item> of(String id) {
return TagKey.of(RegistryKeys.ITEM, Identifier.of("miteequilibrium",id));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.equilibrium.mixin.crafttime.worklevel;
package com.equilibrium.worklevel;

public class CraftingIngredient {
public static final int FLINT_CRAFTING_TABLE = 1, COPPER_CRAFTING_TABLE = 2, IRON_CRAFTING_TABLE = 3, DIAMOND_CRAFTING_TABLE = 4, NETHERITE_CRAFTING_TABLE = 5;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.equilibrium.mixin.crafttime.worklevel;
package com.equilibrium.worklevel;

import java.util.HashMap;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.equilibrium.mixin.crafttime.worklevel;
package com.equilibrium.worklevel;

public class FurnaceIngredient {
public static final int COBBLESTONE_FURNACE = 1, OBSIDIAN_FURNACE = 2, NETHERRACK_FURNACE = 3;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.equilibrium.mixin.crafttime.worklevel;
package com.equilibrium.worklevel;

import java.util.HashMap;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "miteequilibrium:item/flint_hatchet"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/data.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"miteequilibrium:flint_hatchet",
"#minecraft:enchantable/mining"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"miteequilibrium:flint_hatchet"

]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"values": [
"minecraft:wooden_pickaxe"
"miteequilibrium:flint_hatchet"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"argument1": {
"type": "minecraft:y_clamped_gradient",
"from_y": 108,
"to_y": 140,
"to_y": 144,
"from_value": 0,
"to_value": 1.1
},
Expand All @@ -74,9 +74,9 @@
"type": "minecraft:add",
"argument1": {
"type": "minecraft:noise",
"noise": "minecraft:erosion",
"noise": "minecraft:erosion_large",
"xz_scale": 1,
"y_scale": 16
"y_scale": 256
},
"argument2": {
"type": "minecraft:add",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/miteequilibrium.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"MITEequilibriumMixin",
"recipeModifier",
"crafttime.ScreenHandlerMixin",

"entitymixin.CowEntityMixin",
"loot_table.BlockLootTableMixin",
"oreGenerator.OreConfiguredModify",
Expand Down

0 comments on commit c3d2644

Please sign in to comment.