LTCatt 6 سال پیش
والد
کامیت
1a16e2ca61

+ 2 - 2
src/main/java/com/hexdragon/core/item/ItemHelperRe.java

@@ -45,8 +45,8 @@ public class ItemHelperRe {
         if (id.contains("horse_armor")) return 7;
         // 根据特定种类判断
         if (item == Items.FLINT_AND_STEEL || item == Items.SHIELD) return 1;
-        if (item == Items.FISHING_ROD || item == Items.WARPED_FUNGUS_ON_A_STICK || item == Items.CARROT_ON_A_STICK || item.isCrossbow(itemStack))
-            return 2;
+        if (item == Items.FISHING_ROD || item.isCrossbow(itemStack)) return 2;
+        // 如果本来就应该是 3 就不作判断
         // 如果未找到则视作 3
         return 3;
     }

+ 2 - 2
src/main/java/com/hexdragon/enchrebirth/EnchRebirth.java

@@ -1,6 +1,6 @@
 package com.hexdragon.enchrebirth;
 
-import com.hexdragon.enchrebirth.reg.Registry;
+import com.hexdragon.enchrebirth.registry.RegMain;
 import net.minecraftforge.eventbus.api.IEventBus;
 import net.minecraftforge.fml.common.Mod;
 import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
@@ -11,6 +11,6 @@ public class EnchRebirth {
 
     public EnchRebirth() {
         IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
-        Registry.CONTAINERS.register(modEventBus);
+        RegMain.CONTAINERS.register(modEventBus);
     }
 }

+ 2 - 2
src/main/java/com/hexdragon/enchrebirth/block/GrindstoneContainerRe.java

@@ -3,7 +3,7 @@ package com.hexdragon.enchrebirth.block;
 import com.hexdragon.core.item.CraftResultInventoryRe;
 import com.hexdragon.core.item.EnchantmentHelperRe;
 import com.hexdragon.core.item.ItemHelperRe;
-import com.hexdragon.enchrebirth.reg.Registry;
+import com.hexdragon.enchrebirth.registry.RegMain;
 import net.minecraft.block.Blocks;
 import net.minecraft.enchantment.Enchantment;
 import net.minecraft.enchantment.EnchantmentHelper;
@@ -180,7 +180,7 @@ public class GrindstoneContainerRe extends Container {
         this(windowIdIn, playerInventoryIn, IWorldPosCallable.DUMMY);
     }
     public GrindstoneContainerRe(int windowIdIn, PlayerInventory playerInventoryIn, final IWorldPosCallable worldPosCallableIn) {
-        super(Registry.containerGrindstone.get(), windowIdIn);
+        super(RegMain.containerGrindstone.get(), windowIdIn);
         this.worldPosCallable = worldPosCallableIn;
         Constuct(windowIdIn, playerInventoryIn, worldPosCallableIn);
     }

+ 1 - 1
src/main/java/com/hexdragon/enchrebirth/block/GrindstoneScreenRe.java

@@ -16,7 +16,7 @@ public class GrindstoneScreenRe extends ContainerScreen<GrindstoneContainerRe> {
 
     public GrindstoneScreenRe(GrindstoneContainerRe container, PlayerInventory playerInventory, ITextComponent textComponent) {
         super(container, playerInventory, textComponent);
-        this.playerInventoryTitleY = 1000000; // 关闭显示
+        this.playerInventoryTitleY = 1000000; // 关闭 “物品栏” 三个字的显示
         this.titleX = 61; this.titleY = 12; this.ySize = 150;
     }
 

+ 1 - 3
src/main/java/com/hexdragon/enchrebirth/mixin/GrindstoneBlockMixin.java

@@ -18,9 +18,7 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
 
 @Mixin(GrindstoneBlock.class)
 public abstract class GrindstoneBlockMixin extends HorizontalFaceBlock {
-    public GrindstoneBlockMixin(Properties builder) {
-        super(builder);
-    }
+    public GrindstoneBlockMixin(Properties builder) {super(builder);}
 
     // 将砂轮的处理事件替换为 Mod 所提供的事件
     @Inject(method = "getContainer", at = @At(value = "HEAD"), cancellable = true, locals = LocalCapture.CAPTURE_FAILEXCEPTION)

+ 6 - 4
src/main/java/com/hexdragon/enchrebirth/reg/ClientSetupHandler.java → src/main/java/com/hexdragon/enchrebirth/registry/RegClientSetup.java

@@ -1,18 +1,20 @@
-package com.hexdragon.enchrebirth.reg;
+package com.hexdragon.enchrebirth.registry;
 
 import com.hexdragon.enchrebirth.EnchRebirth;
 import com.hexdragon.enchrebirth.block.GrindstoneScreenRe;
 import net.minecraft.client.gui.ScreenManager;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
 import net.minecraftforge.eventbus.api.SubscribeEvent;
 import net.minecraftforge.fml.common.Mod;
 import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
 
[email protected](modid = EnchRebirth.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
-public class ClientSetupHandler {
[email protected](modid = EnchRebirth.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) @OnlyIn(Dist.CLIENT)
+public class RegClientSetup {
 
     @SubscribeEvent
     public static void clientSetup(final FMLClientSetupEvent e) {
-        ScreenManager.registerFactory(Registry.containerGrindstone.get(), GrindstoneScreenRe::new);
+        ScreenManager.registerFactory(RegMain.containerGrindstone.get(), GrindstoneScreenRe::new);
     }
 
 }

+ 2 - 2
src/main/java/com/hexdragon/enchrebirth/reg/Registry.java → src/main/java/com/hexdragon/enchrebirth/registry/RegMain.java

@@ -1,4 +1,4 @@
-package com.hexdragon.enchrebirth.reg;
+package com.hexdragon.enchrebirth.registry;
 
 import com.hexdragon.enchrebirth.EnchRebirth;
 import com.hexdragon.enchrebirth.block.GrindstoneContainerRe;
@@ -10,7 +10,7 @@ import net.minecraftforge.fml.RegistryObject;
 import net.minecraftforge.registries.DeferredRegister;
 import net.minecraftforge.registries.ForgeRegistries;
 
-public class Registry {
+public class RegMain {
 
     // 容器
     public static final DeferredRegister<ContainerType<?>> CONTAINERS = DeferredRegister.create(ForgeRegistries.CONTAINERS, EnchRebirth.MODID);

+ 2 - 3
src/main/resources/pack.mcmeta

@@ -1,7 +1,6 @@
 {
     "pack": {
-        "description": "examplemod resources",
-        "pack_format": 6,
-        "_comment": "A pack_format of 6 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods."
+        "description": "mod resources",
+        "pack_format": 6
     }
 }