Skip to content

Commit b5f3036

Browse files
committed
Update ALL THE CODE
to 1.21. only the code though, did not update any resources.
1 parent df7a0a9 commit b5f3036

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+891
-1379
lines changed

src/client/java/barch/mc_extended/Entities/EnderCube.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
public class EnderCube {
1414

15-
public static final EntityModelLayer MODEL_ENDER_CUBE_LAYER = new EntityModelLayer(new Identifier(NAMESPACE, "ender_cube"), "main");
15+
public static final EntityModelLayer MODEL_ENDER_CUBE_LAYER = new EntityModelLayer(Identifier.of(NAMESPACE, "ender_cube"), "main");
1616

1717
public static void registerClient() {
1818

src/client/java/barch/mc_extended/Entities/Lost.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
public class Lost {
1414

15-
public static final EntityModelLayer MODEL_LOST_LAYER = new EntityModelLayer(new Identifier(NAMESPACE, "lost"), "main");
15+
public static final EntityModelLayer MODEL_LOST_LAYER = new EntityModelLayer(Identifier.of(NAMESPACE, "lost"), "main");
1616

1717
public static void registerClient() {
1818

src/client/java/barch/mc_extended/Entities/SilverGolem.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
public class SilverGolem {
1515

16-
public static final EntityModelLayer MODEL_SILVER_GOLEM_LAYER = new EntityModelLayer(new Identifier(NAMESPACE, "silver_golem"), "main");
16+
public static final EntityModelLayer MODEL_SILVER_GOLEM_LAYER = new EntityModelLayer(Identifier.of(NAMESPACE, "silver_golem"), "main");
1717

1818
public static void registerClient() {
1919

src/client/java/barch/mc_extended/Entities/TroutFish.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
public class TroutFish {
1414

1515

16-
public static final EntityModelLayer MODEL_TROUT_FISH_LAYER = new EntityModelLayer(new Identifier(NAMESPACE, "trout_fish"), "main");
16+
public static final EntityModelLayer MODEL_TROUT_FISH_LAYER = new EntityModelLayer(Identifier.of(NAMESPACE, "trout_fish"), "main");
1717

1818
public static void registerClient() {
1919

src/client/java/barch/mc_extended/render/entity/feature/LostOverlayFeatureRenderer.java

-30
This file was deleted.

src/client/java/barch/mc_extended/render/entity/renderer/EnderCubeEntityRenderer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
@Environment(EnvType.CLIENT)
1919
public class EnderCubeEntityRenderer extends MobEntityRenderer<EnderCubeEntity, EnderCubeEntityModel<EnderCubeEntity>> {
20-
private static final Identifier TEXTURE = new Identifier(NAMESPACE,"textures/entity/slimes/ender_cube.png");
20+
private static final Identifier TEXTURE = Identifier.of(NAMESPACE,"textures/entity/slimes/ender_cube.png");
2121

2222
public EnderCubeEntityRenderer(EntityRendererFactory.Context context) {
2323
super(context, new EnderCubeEntityModel(context.getPart(MODEL_ENDER_CUBE_LAYER)), 0.25F);

src/client/java/barch/mc_extended/render/entity/renderer/LostEntityRenderer.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,28 @@
22

33

44

5-
import barch.mc_extended.render.entity.feature.LostOverlayFeatureRenderer;
65
import net.minecraft.client.render.entity.EntityRendererFactory;
76
import net.minecraft.client.render.entity.SkeletonEntityRenderer;
7+
import net.minecraft.client.render.entity.feature.SkeletonOverlayFeatureRenderer;
88
import net.minecraft.client.render.entity.model.EntityModelLayers;
99
import net.minecraft.entity.mob.AbstractSkeletonEntity;
10+
import net.minecraft.entity.mob.StrayEntity;
1011
import net.minecraft.util.Identifier;
1112

1213
import static barch.mc_extended.MCExtended.NAMESPACE;
1314

1415
public class LostEntityRenderer extends SkeletonEntityRenderer {
15-
private static final Identifier TEXTURE = new Identifier(NAMESPACE,"textures/entity/skeleton/lost.png");
16+
private static final Identifier TEXTURE = Identifier.of(NAMESPACE,"textures/entity/skeleton/lost.png");
17+
private static final Identifier field_49165 = Identifier.of(NAMESPACE, "textures/entity/skeleton/lost_overlay.png");
1618

1719
public LostEntityRenderer(EntityRendererFactory.Context context) {
1820
super(context, EntityModelLayers.STRAY, EntityModelLayers.STRAY_INNER_ARMOR, EntityModelLayers.STRAY_OUTER_ARMOR);
19-
this.addFeature(new LostOverlayFeatureRenderer<>(this, context.getModelLoader()));
21+
this.addFeature(new SkeletonOverlayFeatureRenderer<>(this, context.getModelLoader(), EntityModelLayers.STRAY_OUTER, field_49165));
2022
}
2123

2224
public Identifier getTexture(AbstractSkeletonEntity abstractSkeletonEntity) {
2325
return TEXTURE;
2426
}
27+
2528
}
2629

src/client/java/barch/mc_extended/render/entity/renderer/SilverGolemEntityRenderer.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import static barch.mc_extended.MCExtended.NAMESPACE;
1313

1414
public class SilverGolemEntityRenderer extends MobEntityRenderer<SilverGolemEntity, SilverGolemEntityModel<SilverGolemEntity>> {
15-
private static final Identifier TEXTURE = new Identifier(NAMESPACE,"textures/entity/golems/silver_golem.png");
15+
private static final Identifier TEXTURE = Identifier.of(NAMESPACE,"textures/entity/golems/silver_golem.png");
1616

1717
public SilverGolemEntityRenderer(EntityRendererFactory.Context context) {
1818
super(context, new SilverGolemEntityModel<>(context.getPart(MODEL_SILVER_GOLEM_LAYER)), 0.7F);
@@ -25,13 +25,13 @@ public Identifier getTexture(SilverGolemEntity entity) {
2525
return TEXTURE;
2626
}
2727

28-
protected void setupTransforms(SilverGolemEntity silverGolemEntity, MatrixStack matrixStack, float f, float g, float h) {
29-
super.setupTransforms(silverGolemEntity, matrixStack, f, g, h);
30-
if (!((double)silverGolemEntity.limbAnimator.getSpeed() < 0.01)) {
31-
float i = 13.0F;
32-
float j = silverGolemEntity.limbAnimator.getPos(h) + 6.0F;
33-
float k = (Math.abs(j % 13.0F - 6.5F) - 3.25F) / 3.25F;
34-
matrixStack.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(6.5F * k));
35-
}
36-
}
28+
// protected void setupTransforms(SilverGolemEntity silverGolemEntity, MatrixStack matrixStack, float f, float g, float h) {
29+
// super.setupTransforms(silverGolemEntity, matrixStack, f, g, h);
30+
// if (!((double)silverGolemEntity.limbAnimator.getSpeed() < 0.01)) {
31+
// float i = 13.0F;
32+
// float j = silverGolemEntity.limbAnimator.getPos(h) + 6.0F;
33+
// float k = (Math.abs(j % 13.0F - 6.5F) - 3.25F) / 3.25F;
34+
// matrixStack.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(6.5F * k));
35+
// }
36+
// }
3737
}

src/client/java/barch/mc_extended/render/entity/renderer/TroutFishEntityRenderer.java

+19-19
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import static barch.mc_extended.Entities.TroutFish.MODEL_TROUT_FISH_LAYER;
1414

1515
public class TroutFishEntityRenderer extends MobEntityRenderer<TroutFishEntity, TroutFishEntityModel<TroutFishEntity>> {
16-
private static final Identifier TEXTURE = new Identifier(NAMESPACE,"textures/entity/fish/trout_fish.png");
16+
private static final Identifier TEXTURE = Identifier.of(NAMESPACE,"textures/entity/fish/trout_fish.png");
1717

1818
public TroutFishEntityRenderer(EntityRendererFactory.Context context) {
1919
super(context, new TroutFishEntityModel(context.getPart(MODEL_TROUT_FISH_LAYER)), 0.4F);
@@ -23,22 +23,22 @@ public Identifier getTexture(TroutFishEntity TroutFishEntity) {
2323
return TEXTURE;
2424
}
2525

26-
protected void setupTransforms(TroutFishEntity TroutFishEntity, MatrixStack matrixStack, float f, float g, float h) {
27-
super.setupTransforms(TroutFishEntity, matrixStack, f, g, h);
28-
float i = 1.0F;
29-
float j = 1.0F;
30-
if (!TroutFishEntity.isTouchingWater()) {
31-
i = 1.3F;
32-
j = 1.7F;
33-
}
34-
35-
float k = i * 4.3F * MathHelper.sin(j * 0.6F * f);
36-
matrixStack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(k));
37-
matrixStack.translate(0.0F, 0.0F, -0.4F);
38-
if (!TroutFishEntity.isTouchingWater()) {
39-
matrixStack.translate(0.2F, 0.1F, 0.0F);
40-
matrixStack.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(90.0F));
41-
}
42-
43-
}
26+
// protected void setupTransforms(TroutFishEntity TroutFishEntity, MatrixStack matrixStack, float f, float g, float h) {
27+
// super.setupTransforms(TroutFishEntity, matrixStack, f, g, h);
28+
// float i = 1.0F;
29+
// float j = 1.0F;
30+
// if (!TroutFishEntity.isTouchingWater()) {
31+
// i = 1.3F;
32+
// j = 1.7F;
33+
// }
34+
//
35+
// float k = i * 4.3F * MathHelper.sin(j * 0.6F * f);
36+
// matrixStack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(k));
37+
// matrixStack.translate(0.0F, 0.0F, -0.4F);
38+
// if (!TroutFishEntity.isTouchingWater()) {
39+
// matrixStack.translate(0.2F, 0.1F, 0.0F);
40+
// matrixStack.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(90.0F));
41+
// }
42+
//
43+
// }
4444
}

src/main/java/barch/mc_extended/Armor/ArmorMaterials.java

+48-21
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,58 @@
11
package barch.mc_extended.Armor;
22

33

4+
import net.minecraft.item.ArmorItem;
5+
import net.minecraft.item.ArmorMaterial;
6+
import net.minecraft.recipe.Ingredient;
7+
import net.minecraft.registry.Registries;
8+
import net.minecraft.registry.Registry;
9+
import net.minecraft.registry.entry.RegistryEntry;
10+
import net.minecraft.sound.SoundEvent;
11+
import net.minecraft.util.Identifier;
12+
13+
import java.net.Proxy;
14+
import java.util.EnumMap;
15+
import java.util.List;
16+
import java.util.Map;
17+
import java.util.function.Supplier;
18+
19+
import static barch.mc_extended.MCExtended.NAMESPACE;
20+
421
public class ArmorMaterials {
522

6-
public static final RubyArmorMaterial RUBY_ARMOR_MATERIAL = new RubyArmorMaterial();
7-
public static final SapphireArmorMaterial SAPPHIRE_ARMOR_MATERIAL = new SapphireArmorMaterial();
8-
public static final SilverArmorMaterial SILVER_ARMOR_MATERIAL = new SilverArmorMaterial();
9-
public static final BronzeArmorMaterial BRONZE_ARMOR_MATERIAL = new BronzeArmorMaterial();
10-
public static final CopperArmorMaterial COPPER_ARMOR_MATERIAL = new CopperArmorMaterial();
11-
public static final TinArmorMaterial TIN_ARMOR_MATERIAL = new TinArmorMaterial();
12-
public static final CorundumArmorMaterial CORUNDUM_ARMOR_MATERIAL = new CorundumArmorMaterial();
23+
public static RegistryEntry<ArmorMaterial> registerMaterial(String id, Map<ArmorItem.Type, Integer> defencePoints, int enchantability, RegistryEntry<SoundEvent> equipSound, Supplier<Ingredient> repairIngredientSupplier, float toughness, float knockbackResistance, boolean dyeable) {
24+
List<ArmorMaterial.Layer> layers = List.of(
25+
new ArmorMaterial.Layer(Identifier.of(NAMESPACE, id), "", dyeable)
26+
);
27+
28+
EnumMap<ArmorItem.Type, Integer> enumMap = new EnumMap(ArmorItem.Type.class);
29+
ArmorItem.Type[] var9 = ArmorItem.Type.values();
30+
int var10 = var9.length;
31+
32+
for(int var11 = 0; var11 < var10; ++var11) {
33+
ArmorItem.Type type = var9[var11];
34+
enumMap.put(type, (Integer)defencePoints.get(type));
35+
}
36+
37+
return Registry.registerReference(Registries.ARMOR_MATERIAL, Identifier.ofVanilla(id), new ArmorMaterial(enumMap, enchantability, equipSound, repairIngredientSupplier, layers, toughness, knockbackResistance));
38+
39+
}
1340
public static void RegisterAll() {
1441

15-
RUBY_ARMOR_MATERIAL.RegisterArmor();
16-
RUBY_ARMOR_MATERIAL.GroupArmor();
17-
SAPPHIRE_ARMOR_MATERIAL.RegisterArmor();
18-
SAPPHIRE_ARMOR_MATERIAL.GroupArmor();
19-
SILVER_ARMOR_MATERIAL.RegisterArmor();
20-
SILVER_ARMOR_MATERIAL.GroupArmor();
21-
BRONZE_ARMOR_MATERIAL.RegisterArmor();
22-
BRONZE_ARMOR_MATERIAL.GroupArmor();
23-
COPPER_ARMOR_MATERIAL.RegisterArmor();
24-
COPPER_ARMOR_MATERIAL.GroupArmor();
25-
TIN_ARMOR_MATERIAL.RegisterArmor();
26-
TIN_ARMOR_MATERIAL.GroupArmor();
27-
CORUNDUM_ARMOR_MATERIAL.RegisterArmor();
28-
CORUNDUM_ARMOR_MATERIAL.GroupArmor();
42+
RubyArmorData.RegisterArmor();
43+
RubyArmorData.GroupArmor();
44+
SapphireArmorData.RegisterArmor();
45+
SapphireArmorData.GroupArmor();
46+
SilverArmorData.RegisterArmor();
47+
SilverArmorData.GroupArmor();
48+
BronzeArmorData.RegisterArmor();
49+
BronzeArmorData.GroupArmor();
50+
CopperArmorData.RegisterArmor();
51+
CopperArmorData.GroupArmor();
52+
TinArmorData.RegisterArmor();
53+
TinArmorData.GroupArmor();
54+
CorundumArmorData.RegisterArmor();
55+
CorundumArmorData.GroupArmor();
2956

3057

3158
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
package barch.mc_extended.Armor;
2+
3+
import barch.mc_extended.Glue.ItemGrouped;
4+
import barch.mc_extended.Glue.ItemGrouper;
5+
import barch.mc_extended.Minerals.Bronze;
6+
import net.minecraft.item.*;
7+
import net.minecraft.recipe.Ingredient;
8+
import net.minecraft.registry.Registries;
9+
import net.minecraft.registry.Registry;
10+
import net.minecraft.registry.entry.RegistryEntry;
11+
import net.minecraft.sound.SoundEvent;
12+
import net.minecraft.sound.SoundEvents;
13+
import net.minecraft.util.Identifier;
14+
15+
import java.util.List;
16+
import java.util.Map;
17+
import java.util.function.Supplier;
18+
19+
import static barch.mc_extended.Armor.ArmorMaterials.registerMaterial;
20+
import static barch.mc_extended.MCExtended.*;
21+
import static net.minecraft.item.AnimalArmorItem.Type.EQUESTRIAN;
22+
23+
public class BronzeArmorData {
24+
25+
public static final RegistryEntry<ArmorMaterial> BRONZE = registerMaterial(
26+
"bronze",
27+
Map.of(
28+
ArmorItem.Type.HELMET, 2,
29+
ArmorItem.Type.CHESTPLATE, 6,
30+
ArmorItem.Type.LEGGINGS, 5,
31+
ArmorItem.Type.BOOTS, 2,
32+
ArmorItem.Type.BODY, 4
33+
34+
),
35+
10,
36+
SoundEvents.ITEM_ARMOR_EQUIP_GOLD,
37+
() -> Ingredient.ofItems(Bronze.BRONZE_INGOT),
38+
0.0F,
39+
0.0F,
40+
false);
41+
42+
43+
public static final Item BRONZE_HELMET = new ArmorItem(BRONZE, ArmorItem.Type.HELMET, new Item.Settings());
44+
public static final Item BRONZE_CHESTPLATE = new ArmorItem(BRONZE, ArmorItem.Type.CHESTPLATE, new Item.Settings());
45+
public static final Item BRONZE_LEGGINGS = new ArmorItem(BRONZE, ArmorItem.Type.LEGGINGS, new Item.Settings());
46+
public static final Item BRONZE_BOOTS = new ArmorItem(BRONZE, ArmorItem.Type.BOOTS, new Item.Settings());
47+
public static final Item BRONZE_HORSE_ARMOR = new AnimalArmorItem(BRONZE, EQUESTRIAN, false, new Item.Settings().maxCount(1));
48+
49+
50+
public static void RegisterArmor() {
51+
52+
Registry.register(Registries.ITEM, Identifier.of(NAMESPACE, "bronze_helmet"), BRONZE_HELMET);
53+
Registry.register(Registries.ITEM, Identifier.of(NAMESPACE, "bronze_chestplate"), BRONZE_CHESTPLATE);
54+
Registry.register(Registries.ITEM, Identifier.of(NAMESPACE, "bronze_leggings"), BRONZE_LEGGINGS);
55+
Registry.register(Registries.ITEM, Identifier.of(NAMESPACE, "bronze_boots"), BRONZE_BOOTS);
56+
Registry.register(Registries.ITEM, Identifier.of(NAMESPACE, "bronze_horse_armor"), BRONZE_HORSE_ARMOR);
57+
58+
}
59+
60+
public static void GroupArmor() {
61+
62+
ItemGrouper.GroupItem(BRONZE_HELMET, new ItemGrouped[]{new ItemGrouped(ItemGroups.COMBAT, Items.IRON_BOOTS)});
63+
ItemGrouper.GroupItem(BRONZE_CHESTPLATE, new ItemGrouped[]{new ItemGrouped(ItemGroups.COMBAT, BRONZE_HELMET)});
64+
ItemGrouper.GroupItem(BRONZE_LEGGINGS, new ItemGrouped[]{new ItemGrouped(ItemGroups.COMBAT, BRONZE_CHESTPLATE)});
65+
ItemGrouper.GroupItem(BRONZE_BOOTS, new ItemGrouped[]{new ItemGrouped(ItemGroups.COMBAT, BRONZE_LEGGINGS)});
66+
ItemGrouper.GroupItem(BRONZE_HORSE_ARMOR, new ItemGrouped[]{new ItemGrouped(ItemGroups.COMBAT, Items.IRON_HORSE_ARMOR)});
67+
68+
}
69+
}

0 commit comments

Comments
 (0)