port gamer bow to 1.18.2

This commit is contained in:
RyanTLG
2022-04-30 14:40:45 +02:00
parent 95cf937175
commit b00f4a96fa
15 changed files with 197 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx6G
loader_version=0.13.2
# Mod Properties
mod_version = 1.18.2-1.0.0-stable
mod_version = 1.18.2-1.1.0-stable
maven_group = ryantlg.GamerMod.mod
archives_base_name = GamerMod

View File

@@ -9,6 +9,7 @@ import net.arcmods.ryantlg.items.armour.jeremiumArmour;
import net.arcmods.ryantlg.items.armour.notArmour;
import net.arcmods.ryantlg.items.armour.omniumArmour;
import net.arcmods.ryantlg.items.armour.oriumArmour;
import net.arcmods.ryantlg.items.bows.gamerBow;
import net.arcmods.ryantlg.items.itemsByCrop.weemItems;
import net.arcmods.ryantlg.items.metalItems.jeremiumMetals;
import net.arcmods.ryantlg.items.metalItems.omniumMetals;
@@ -97,6 +98,7 @@ public class gamermod implements ModInitializer {
JeremiumOreGen.register();
notArmour.register();
gamerBow.register();
}
//fight me

View File

@@ -1,6 +1,7 @@
package net.arcmods.ryantlg;
import net.arcmods.ryantlg.blocks.CropBlocks;
import net.arcmods.ryantlg.utils.bowModelPredicateProvider;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
@@ -14,6 +15,8 @@ public class gamermodClient implements ClientModInitializer{
public void onInitializeClient() {
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), CropBlocks.WEEM_CROP_BLOCK);
bowModelPredicateProvider.registerBowModels();
gamermod.LOGGER.info("Client only objects loaded");
}

View File

@@ -0,0 +1,19 @@
package net.arcmods.ryantlg.items.bows;
import net.arcmods.ryantlg.gamermod;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.item.BowItem;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public class gamerBow {
public static final Item GAMER_BOW = new BowItem(new FabricItemSettings().group(gamermod.CHING).maxCount(1).fireproof().maxDamage(458));
public static void register(){
Registry.register(Registry.ITEM, new Identifier("gamermod", "gamer_bow"), GAMER_BOW);
}
}

View File

@@ -0,0 +1,31 @@
package net.arcmods.ryantlg.utils;
import net.arcmods.ryantlg.items.bows.gamerBow;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
public class bowModelPredicateProvider {
public static void registerBowModels() {
registerBow(gamerBow.GAMER_BOW);
}
private static void registerBow(Item bow) {
ModelPredicateProviderRegistry.register(bow, new Identifier("pull"),
(stack, world, entity, seed) -> {
if (entity == null) {
return 0.0f;
}
if (entity.getActiveItem() != stack) {
return 0.0f;
}
return (float)(stack.getMaxUseTime() - entity.getItemUseTimeLeft()) / 20.0f;
});
ModelPredicateProviderRegistry.register(bow, new Identifier("pulling"),
(stack, world, entity, seed) -> entity != null && entity.isUsingItem()
&& entity.getActiveItem() == stack ? 1.0f : 0.0f);
}
}

View File

@@ -68,6 +68,7 @@
"item.gamermod.jeremium_sword.tooltip": "Kinda heavy",
"block.gamermod.deepslate_jeremium_ore": "Deepslate Jeremium Ore",
"block.gamermod.deepslate_omnium_ore": "Deepslate Omnium Ore",
"block.gamermod.deepslate_orium_ore": "Deepslate Orium Ore"
"block.gamermod.deepslate_orium_ore": "Deepslate Orium Ore",
"item.gamermod.gamer_bow": "Gamer Bow"
}

View File

@@ -0,0 +1,98 @@
{
"parent": "minecraft:item/generated",
"display": {
"thirdperson_righthand": {
"rotation": [
-80,
260,
-40
],
"translation": [
-1,
-2,
2.5
],
"scale": [
0.9,
0.9,
0.9
]
},
"thirdperson_lefthand": {
"rotation": [
-80,
280,
40
],
"translation": [
-1,
-2,
2.5
],
"scale": [
0.9,
0.9,
0.9
]
},
"firstperson_righthand": {
"rotation": [
0,
-90,
25
],
"translation": [
1.13,
3.2,
1.13
],
"scale": [
0.68,
0.68,
0.68
]
},
"firstperson_lefthand": {
"rotation": [
0,
90,
-25
],
"translation": [
1.13,
3.2,
1.13
],
"scale": [
0.68,
0.68,
0.68
]
}
},
"textures": {
"layer0": "gamermod:item/gamer_bow"
},
"overrides": [
{
"predicate": {
"minecraft:pulling": 1
},
"model": "gamermod:item/gamer_bow_pulling_0"
},
{
"predicate": {
"minecraft:pulling": 1,
"minecraft:pull": 0.65
},
"model": "gamermod:item/gamer_bow_pulling_1"
},
{
"predicate": {
"minecraft:pulling": 1,
"minecraft:pull": 0.9
},
"model": "gamermod:item/gamer_bow_pulling_2"
}
]
}

View File

@@ -0,0 +1,6 @@
{
"parent": "gamermod:item/gamer_bow",
"textures": {
"layer0": "gamermod:item/gamer_bow_pulling_0"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "gamermod:item/gamer_bow",
"textures": {
"layer0": "gamermod:item/gamer_bow_pulling_1"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "gamermod:item/gamer_bow",
"textures": {
"layer0": "gamermod:item/gamer_bow_pulling_2"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

View File

@@ -0,0 +1,23 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" #X",
"#SX",
" #X"
],
"key": {
"#": {
"item": "minecraft:stick"
},
"X": {
"item": "minecraft:string"
},
"S": {
"item": "minecraft:light_blue_dye"
}
},
"result": {
"item": "gamermod:gamer_bow"
}
}