Compare commits
1 Commits
szar-26.4.
...
szar-26.4.
| Author | SHA1 | Date | |
|---|---|---|---|
| cf267a959d |
@@ -6,7 +6,7 @@ minecraft_version=1.20.1
|
|||||||
yarn_mappings=1.20.1+build.10
|
yarn_mappings=1.20.1+build.10
|
||||||
loader_version=0.18.3
|
loader_version=0.18.3
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=26.4.14
|
mod_version=26.4.14.1
|
||||||
maven_group=dev.tggamesyt
|
maven_group=dev.tggamesyt
|
||||||
archives_base_name=szar
|
archives_base_name=szar
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|||||||
57
src/main/java/dev/tggamesyt/szar/EnderArmorMaterial.java
Normal file
57
src/main/java/dev/tggamesyt/szar/EnderArmorMaterial.java
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package dev.tggamesyt.szar;
|
||||||
|
|
||||||
|
import net.minecraft.item.ArmorItem;
|
||||||
|
import net.minecraft.item.ArmorMaterial;
|
||||||
|
import net.minecraft.recipe.Ingredient;
|
||||||
|
import net.minecraft.sound.SoundEvent;
|
||||||
|
import net.minecraft.sound.SoundEvents;
|
||||||
|
|
||||||
|
import static dev.tggamesyt.szar.Szar.MOD_ID;
|
||||||
|
|
||||||
|
public class EnderArmorMaterial implements ArmorMaterial {
|
||||||
|
|
||||||
|
public static final EnderArmorMaterial INSTANCE = new EnderArmorMaterial();
|
||||||
|
|
||||||
|
private static final int[] BASE_DURABILITY = {14, 17, 18, 12};
|
||||||
|
private static final int[] PROTECTION = {4, 9, 11, 4};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getDurability(ArmorItem.Type type) {
|
||||||
|
return BASE_DURABILITY[type.getEquipmentSlot().getEntitySlotId()] * 42;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getProtection(ArmorItem.Type type) {
|
||||||
|
return PROTECTION[type.getEquipmentSlot().getEntitySlotId()];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getEnchantability() {
|
||||||
|
return 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SoundEvent getEquipSound() {
|
||||||
|
return SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ingredient getRepairIngredient() {
|
||||||
|
return Ingredient.ofItems(Szar.ENDER_INGOT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return MOD_ID + ":ender";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getToughness() {
|
||||||
|
return 4F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getKnockbackResistance() {
|
||||||
|
return 0.2F;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -415,6 +415,10 @@ public class Szar implements ModInitializer {
|
|||||||
entries.add(Szar.ENDER_ORE_ITEM);
|
entries.add(Szar.ENDER_ORE_ITEM);
|
||||||
entries.add(Szar.RAW_ENDER);
|
entries.add(Szar.RAW_ENDER);
|
||||||
entries.add(Szar.ENDER_INGOT);
|
entries.add(Szar.ENDER_INGOT);
|
||||||
|
entries.add(Szar.ENDER_HELMET);
|
||||||
|
entries.add(Szar.ENDER_CHESTPLATE);
|
||||||
|
entries.add(Szar.ENDER_LEGGINGS);
|
||||||
|
entries.add(Szar.ENDER_BOOTS);
|
||||||
entries.add(Szar.SUPER_DIAMOND);
|
entries.add(Szar.SUPER_DIAMOND);
|
||||||
entries.add(Szar.SUPER_APPLE);
|
entries.add(Szar.SUPER_APPLE);
|
||||||
// blueprint stuff
|
// blueprint stuff
|
||||||
@@ -1457,8 +1461,78 @@ public class Szar implements ModInitializer {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
TheEndBiomeData.addEndBiomeReplacement(BiomeKeys.END_HIGHLANDS, Szar.CHORUS_FOREST, 0.7);
|
TheEndBiomeData.addEndBiomeReplacement(BiomeKeys.END_HIGHLANDS, Szar.CHORUS_FOREST, 0.7);
|
||||||
|
ServerLivingEntityEvents.ALLOW_DAMAGE.register((entity, source, amount) -> {
|
||||||
|
if (!(entity instanceof PlayerEntity player)) return true;
|
||||||
|
|
||||||
|
// Check if wearing full Ender armor (optional — remove if you want any piece to trigger)
|
||||||
|
boolean wearingFullSet =
|
||||||
|
player.getInventory().getArmorStack(0).isOf(ENDER_BOOTS) &&
|
||||||
|
player.getInventory().getArmorStack(1).isOf(ENDER_LEGGINGS) &&
|
||||||
|
player.getInventory().getArmorStack(2).isOf(ENDER_CHESTPLATE) &&
|
||||||
|
player.getInventory().getArmorStack(3).isOf(ENDER_HELMET);
|
||||||
|
|
||||||
|
if (!wearingFullSet) return true;
|
||||||
|
|
||||||
|
// If player would drop to <= 1 heart (2 HP)
|
||||||
|
if (player.getHealth() - amount <= 2.0F) {
|
||||||
|
|
||||||
|
if (player.getWorld() instanceof ServerWorld world) {
|
||||||
|
teleportRandomly(player, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false; // CANCEL DAMAGE
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void teleportRandomly(PlayerEntity player, ServerWorld world) {
|
||||||
|
Random RANDOM = new Random();
|
||||||
|
double x = player.getX();
|
||||||
|
double y = player.getY();
|
||||||
|
double z = player.getZ();
|
||||||
|
|
||||||
|
for (int i = 0; i < 16; i++) {
|
||||||
|
double newX = x + (RANDOM.nextDouble() - 0.5) * 32;
|
||||||
|
double newY = y + RANDOM.nextInt(16) - 8;
|
||||||
|
double newZ = z + (RANDOM.nextDouble() - 0.5) * 32;
|
||||||
|
|
||||||
|
BlockPos pos = BlockPos.ofFloored(newX, newY, newZ);
|
||||||
|
|
||||||
|
if (world.isAir(pos)) {
|
||||||
|
player.teleport(newX, newY, newZ);
|
||||||
|
world.playSound(null, player.getBlockPos(),
|
||||||
|
net.minecraft.sound.SoundEvents.ENTITY_ENDERMAN_TELEPORT,
|
||||||
|
player.getSoundCategory(), 1.0F, 1.0F);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static final Item ENDER_HELMET = Registry.register(
|
||||||
|
Registries.ITEM,
|
||||||
|
new Identifier(Szar.MOD_ID, "ender_helmet"),
|
||||||
|
new ArmorItem(EnderArmorMaterial.INSTANCE, ArmorItem.Type.HELMET, new Item.Settings())
|
||||||
|
);
|
||||||
|
|
||||||
|
public static final Item ENDER_CHESTPLATE = Registry.register(
|
||||||
|
Registries.ITEM,
|
||||||
|
new Identifier(Szar.MOD_ID, "ender_chestplate"),
|
||||||
|
new ArmorItem(EnderArmorMaterial.INSTANCE, ArmorItem.Type.CHESTPLATE, new Item.Settings())
|
||||||
|
);
|
||||||
|
|
||||||
|
public static final Item ENDER_LEGGINGS = Registry.register(
|
||||||
|
Registries.ITEM,
|
||||||
|
new Identifier(Szar.MOD_ID, "ender_leggings"),
|
||||||
|
new ArmorItem(EnderArmorMaterial.INSTANCE, ArmorItem.Type.LEGGINGS, new Item.Settings())
|
||||||
|
);
|
||||||
|
|
||||||
|
public static final Item ENDER_BOOTS = Registry.register(
|
||||||
|
Registries.ITEM,
|
||||||
|
new Identifier(Szar.MOD_ID, "ender_boots"),
|
||||||
|
new ArmorItem(EnderArmorMaterial.INSTANCE, ArmorItem.Type.BOOTS, new Item.Settings())
|
||||||
|
);
|
||||||
|
|
||||||
public static final Block TIC_TAC_TOE_BLOCK = Registry.register(
|
public static final Block TIC_TAC_TOE_BLOCK = Registry.register(
|
||||||
Registries.BLOCK, new Identifier(MOD_ID, "tictactoe"),
|
Registries.BLOCK, new Identifier(MOD_ID, "tictactoe"),
|
||||||
new TicTacToeBlock(AbstractBlock.Settings.create().strength(2f))
|
new TicTacToeBlock(AbstractBlock.Settings.create().strength(2f))
|
||||||
|
|||||||
@@ -218,5 +218,10 @@
|
|||||||
"item.szar.hun_disc": "Music Disc",
|
"item.szar.hun_disc": "Music Disc",
|
||||||
"item.szar.hun_disc.desc": "Kölcsey Ferenc - Hungarian Anthem",
|
"item.szar.hun_disc.desc": "Kölcsey Ferenc - Hungarian Anthem",
|
||||||
"item.szar.orban_spawn_egg": "Orbán Spawn Egg",
|
"item.szar.orban_spawn_egg": "Orbán Spawn Egg",
|
||||||
"item.szar.magyar_spawn_egg": "Magyar Spawn Egg"
|
"item.szar.magyar_spawn_egg": "Magyar Spawn Egg",
|
||||||
|
|
||||||
|
"item.szar.ender_chestplate": "Ender Chestplate",
|
||||||
|
"item.szar.ender_leggings": "Ender Leggings",
|
||||||
|
"item.szar.ender_boots": "Ender Boots",
|
||||||
|
"item.szar.ender_helmet": "Ender Helmet"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "szar:item/ender_boots"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "szar:item/ender_chestplate"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "szar:item/ender_helmet"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "szar:item/ender_leggings"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
src/main/resources/assets/szar/textures/item/ender_boots.png
Normal file
BIN
src/main/resources/assets/szar/textures/item/ender_boots.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 299 B |
Binary file not shown.
|
After Width: | Height: | Size: 348 B |
BIN
src/main/resources/assets/szar/textures/item/ender_helmet.png
Normal file
BIN
src/main/resources/assets/szar/textures/item/ender_helmet.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 311 B |
BIN
src/main/resources/assets/szar/textures/item/ender_leggings.png
Normal file
BIN
src/main/resources/assets/szar/textures/item/ender_leggings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 309 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 634 B |
15
src/main/resources/data/szar/recipes/ender_boots.json
Normal file
15
src/main/resources/data/szar/recipes/ender_boots.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
"X X",
|
||||||
|
"X X"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"X": {
|
||||||
|
"item": "szar:ender_ingot"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "szar:ender_boots"
|
||||||
|
}
|
||||||
|
}
|
||||||
16
src/main/resources/data/szar/recipes/ender_chestplate.json
Normal file
16
src/main/resources/data/szar/recipes/ender_chestplate.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
"X X",
|
||||||
|
"XXX",
|
||||||
|
"XXX"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"X": {
|
||||||
|
"item": "szar:ender_ingot"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "szar:ender_chestplate"
|
||||||
|
}
|
||||||
|
}
|
||||||
15
src/main/resources/data/szar/recipes/ender_helmet.json
Normal file
15
src/main/resources/data/szar/recipes/ender_helmet.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
"XXX",
|
||||||
|
"X X"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"X": {
|
||||||
|
"item": "szar:ender_ingot"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "szar:ender_helmet"
|
||||||
|
}
|
||||||
|
}
|
||||||
16
src/main/resources/data/szar/recipes/ender_leggings.json
Normal file
16
src/main/resources/data/szar/recipes/ender_leggings.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
"XXX",
|
||||||
|
"X X",
|
||||||
|
"X X"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"X": {
|
||||||
|
"item": "szar:ender_ingot"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "szar:ender_leggings"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user