orban
All checks were successful
Build Minecraft Mod / build (push) Successful in 4m2s
Build Minecraft Mod / release (push) Successful in 15s

This commit is contained in:
2026-04-13 11:24:11 +02:00
parent c79d223f7e
commit 6b355a1f47
24 changed files with 201 additions and 20 deletions

View File

@@ -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.13 mod_version=26.4.13.1
maven_group=dev.tggamesyt maven_group=dev.tggamesyt
archives_base_name=szar archives_base_name=szar
# Dependencies # Dependencies

View File

@@ -0,0 +1,26 @@
package dev.tggamesyt.szar.client;
import dev.tggamesyt.szar.OrbanEntity;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.render.entity.MobEntityRenderer;
import net.minecraft.client.render.entity.model.BipedEntityModel;
import net.minecraft.client.render.entity.model.EntityModelLayers;
import net.minecraft.util.Identifier;
public class OrbanEntityRenderer
extends MobEntityRenderer<OrbanEntity, BipedEntityModel<OrbanEntity>> {
public OrbanEntityRenderer(EntityRendererFactory.Context context) {
super(
context,
new BipedEntityModel<>(context.getPart(EntityModelLayers.PLAYER)),
0.5F
);
}
@Override
public Identifier getTexture(OrbanEntity entity) {
return new Identifier("szar", "textures/entity/orban.png");
}
}

View File

@@ -548,6 +548,10 @@ public class SzarClient implements ClientModInitializer {
Szar.HitterEntityType, Szar.HitterEntityType,
HitterEntityRenderer::new HitterEntityRenderer::new
); );
EntityRendererRegistry.register(
OrbanEntityType,
OrbanEntityRenderer::new
);
EntityRendererRegistry.register( EntityRendererRegistry.register(
Szar.StalinEntityType, Szar.StalinEntityType,
StalinEntityRenderer::new StalinEntityRenderer::new

View File

@@ -5,11 +5,11 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.goal.ActiveTargetGoal; import net.minecraft.entity.ai.goal.ActiveTargetGoal;
import net.minecraft.entity.mob.PathAwareEntity; import net.minecraft.entity.mob.PathAwareEntity;
public class AttackEnemyTeamGoal extends ActiveTargetGoal<LivingEntity> { public class AttackEnemyHunGoal extends ActiveTargetGoal<LivingEntity> {
public AttackEnemyTeamGoal(PathAwareEntity mob, String myTeam) { public AttackEnemyHunGoal(PathAwareEntity mob, String myTeam) {
super(mob, LivingEntity.class, true, target -> { super(mob, LivingEntity.class, true, target -> {
if (target instanceof TeamMember other) { if (target instanceof HunPartie other) {
return !other.getTeam().equals(myTeam); return !other.getTeam().equals(myTeam);
} }
return false; return false;

View File

@@ -0,0 +1,18 @@
// AttackEnemyTeamGoal.java
package dev.tggamesyt.szar;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.goal.ActiveTargetGoal;
import net.minecraft.entity.mob.PathAwareEntity;
public class AttackEnemyWarGoal extends ActiveTargetGoal<LivingEntity> {
public AttackEnemyWarGoal(PathAwareEntity mob, String myTeam) {
super(mob, LivingEntity.class, true, target -> {
if (target instanceof WarParticipant other) {
return !other.getTeam().equals(myTeam);
}
return false;
});
}
}

View File

@@ -21,7 +21,7 @@ import net.minecraft.world.ServerWorldAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class CommunistEntity extends PathAwareEntity implements Arrestable, TeamMember { public class CommunistEntity extends PathAwareEntity implements Arrestable, WarParticipant {
public static boolean arrestable = false; public static boolean arrestable = false;
@Nullable @Nullable
@@ -38,7 +38,7 @@ public class CommunistEntity extends PathAwareEntity implements Arrestable, Team
this.goalSelector.add(1, new AK47AttackGoal(this, 16.0F, 2)); this.goalSelector.add(1, new AK47AttackGoal(this, 16.0F, 2));
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this)); this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
this.targetSelector.add(2, new AttackEnemyTeamGoal(this, "communist")); this.targetSelector.add(2, new AttackEnemyWarGoal(this, "communist"));
} }

View File

@@ -20,12 +20,11 @@ import net.minecraft.world.ServerWorldAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import static dev.tggamesyt.szar.Szar.NaziEntityType; import static dev.tggamesyt.szar.Szar.NaziEntityType;
public class HitterEntity extends PathAwareEntity implements Arrestable, TeamMember { public class HitterEntity extends PathAwareEntity implements Arrestable, WarParticipant {
public static boolean arrestable = true; public static boolean arrestable = true;
@@ -40,7 +39,7 @@ public class HitterEntity extends PathAwareEntity implements Arrestable, TeamMem
this.goalSelector.add(3, new LookAroundGoal(this)); this.goalSelector.add(3, new LookAroundGoal(this));
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this)); this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
this.targetSelector.add(2, new AttackEnemyTeamGoal(this, "nazi")); this.targetSelector.add(2, new AttackEnemyWarGoal(this, "nazi"));
} }

View File

@@ -0,0 +1,5 @@
package dev.tggamesyt.szar;
public interface HunPartie {
String getTeam();
}

View File

@@ -21,5 +21,6 @@ public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider {
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.HELLO_DISC); getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.HELLO_DISC);
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.ERIKA_DISC); getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.ERIKA_DISC);
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.USSR_DISC); getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.USSR_DISC);
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.HUN_DISC);
} }
} }

View File

@@ -21,7 +21,7 @@ import net.minecraft.world.ServerWorldAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class NaziEntity extends PathAwareEntity implements Arrestable, TeamMember { public class NaziEntity extends PathAwareEntity implements Arrestable, WarParticipant {
private boolean hithandPlaying = false; private boolean hithandPlaying = false;
private int hithandTimer = 0; // ticks remaining private int hithandTimer = 0; // ticks remaining
@@ -91,7 +91,7 @@ public class NaziEntity extends PathAwareEntity implements Arrestable, TeamMembe
this.goalSelector.add(1, new AK47AttackGoal(this, 16.0F, 2)); this.goalSelector.add(1, new AK47AttackGoal(this, 16.0F, 2));
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this)); this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
this.targetSelector.add(2, new AttackEnemyTeamGoal(this, "nazi")); this.targetSelector.add(2, new AttackEnemyWarGoal(this, "nazi"));
} }

View File

@@ -0,0 +1,67 @@
package dev.tggamesyt.szar;
import net.minecraft.entity.EntityData;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnReason;
import net.minecraft.entity.ai.goal.MeleeAttackGoal;
import net.minecraft.entity.ai.goal.WanderAroundFarGoal;
import net.minecraft.entity.attribute.DefaultAttributeContainer;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.mob.PathAwareEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtList;
import net.minecraft.nbt.NbtString;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.world.LocalDifficulty;
import net.minecraft.world.ServerWorldAccess;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
public class OrbanEntity extends PathAwareEntity implements Arrestable, HunPartie {
public static boolean arrestable = false;
public OrbanEntity(EntityType<? extends PathAwareEntity> type, World world) {
super(type, world);
}
@Override
protected void initGoals() {
this.goalSelector.add(2, new FollowLeaderWanderGoal(this, 1.0D, 6.0F));
this.goalSelector.add(3, new WanderAroundFarGoal(this, 0.8D));
this.goalSelector.add(1, new MeleeAttackGoal(this, 1.0, true));
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
this.targetSelector.add(2, new AttackEnemyHunGoal(this, "fidesz"));
}
public static DefaultAttributeContainer.Builder createAttributes() {
return MobEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 20.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.25)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 2);
}
@Override
protected void dropLoot(DamageSource source, boolean causedByPlayer) {
var rand = this.getRandom();
if (rand.nextFloat() < 0.01F) {
this.dropItem(Szar.HUN_DISC);
}
}
@Override
public boolean isArrestable() {
return arrestable;
}
@Override
public String getTeam() {
return "fidesz";
}
}

View File

@@ -26,7 +26,7 @@ import java.util.List;
import static dev.tggamesyt.szar.Szar.CommunistEntityType; import static dev.tggamesyt.szar.Szar.CommunistEntityType;
public class StalinEntity extends PathAwareEntity implements Arrestable, TeamMember { public class StalinEntity extends PathAwareEntity implements Arrestable, WarParticipant {
public static boolean arrestable = true; public static boolean arrestable = true;
@@ -41,7 +41,7 @@ public class StalinEntity extends PathAwareEntity implements Arrestable, TeamMem
this.goalSelector.add(3, new LookAroundGoal(this)); this.goalSelector.add(3, new LookAroundGoal(this));
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this)); this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
this.targetSelector.add(2, new AttackEnemyTeamGoal(this, "communist")); this.targetSelector.add(2, new AttackEnemyWarGoal(this, "communist"));
} }

View File

@@ -286,6 +286,15 @@ public class Szar implements ModInitializer {
.dimensions(EntityDimensions.fixed(0.6F, 1.8F)) // player-sized .dimensions(EntityDimensions.fixed(0.6F, 1.8F)) // player-sized
.build() .build()
); );
public static final EntityType<OrbanEntity> OrbanEntityType =
Registry.register(
Registries.ENTITY_TYPE,
new Identifier(MOD_ID, "orban"),
FabricEntityTypeBuilder
.create(SpawnGroup.CREATURE, OrbanEntity::new)
.dimensions(EntityDimensions.fixed(0.6F, 1.8F))
.build()
);
public static final EntityType<StalinEntity> StalinEntityType = public static final EntityType<StalinEntity> StalinEntityType =
Registry.register( Registry.register(
Registries.ENTITY_TYPE, Registries.ENTITY_TYPE,
@@ -443,6 +452,9 @@ public class Szar implements ModInitializer {
entries.add(Szar.COMMUNIST_SPAWNEGG); entries.add(Szar.COMMUNIST_SPAWNEGG);
entries.add(Szar.ERIKA_DISC); entries.add(Szar.ERIKA_DISC);
entries.add(Szar.USSR_DISC); entries.add(Szar.USSR_DISC);
// politics
entries.add(Szar.ORBAN_SPAWNEGG);
entries.add(Szar.HUN_DISC);
// racism // racism
if (showRacist) { if (showRacist) {
entries.add(Szar.CIGANYBLOCK); entries.add(Szar.CIGANYBLOCK);
@@ -837,6 +849,10 @@ public class Szar implements ModInitializer {
HitterEntityType, HitterEntityType,
HitterEntity.createAttributes() HitterEntity.createAttributes()
); );
FabricDefaultAttributeRegistry.register(
OrbanEntityType,
OrbanEntity.createAttributes()
);
FabricDefaultAttributeRegistry.register( FabricDefaultAttributeRegistry.register(
CommunistEntityType, CommunistEntityType,
CommunistEntity.createAttributes() CommunistEntity.createAttributes()
@@ -905,7 +921,12 @@ public class Szar implements ModInitializer {
1, // min group size 1, // min group size
2 // max group size 2 // max group size
); );
BiomeModifications.addSpawn(
BiomeSelectors.includeByKey(BiomeKeys.PLAINS, BiomeKeys.FLOWER_FOREST, BiomeKeys.FOREST),
SpawnGroup.MONSTER,
OrbanEntityType,
1, 1, 1
);
BiomeModifications.addSpawn( BiomeModifications.addSpawn(
BiomeSelectors.includeByKey(BiomeKeys.WINDSWEPT_HILLS, BiomeKeys.WINDSWEPT_GRAVELLY_HILLS, BiomeKeys.STONY_PEAKS), BiomeSelectors.includeByKey(BiomeKeys.WINDSWEPT_HILLS, BiomeKeys.WINDSWEPT_GRAVELLY_HILLS, BiomeKeys.STONY_PEAKS),
SpawnGroup.MONSTER, SpawnGroup.MONSTER,
@@ -2261,6 +2282,13 @@ public class Szar implements ModInitializer {
new Identifier(MOD_ID, "baiter"), new Identifier(MOD_ID, "baiter"),
new MusicDiscItem(12, BAITER, new Item.Settings().maxCount(1).rarity(Rarity.RARE), 172) new MusicDiscItem(12, BAITER, new Item.Settings().maxCount(1).rarity(Rarity.RARE), 172)
); );
public static final SoundEvent HUN_ANTHEM =
SoundEvent.of(new Identifier(MOD_ID, "hun_anthem"));
public static final Item HUN_DISC = Registry.register(
Registries.ITEM,
new Identifier(MOD_ID, "hun_disc"),
new MusicDiscItem(8, HUN_ANTHEM, new Item.Settings().maxCount(1).rarity(Rarity.RARE), 120)
);
public static final SoundEvent ERIKA = public static final SoundEvent ERIKA =
SoundEvent.of(new Identifier(MOD_ID, "erika")); SoundEvent.of(new Identifier(MOD_ID, "erika"));
public static final Item ERIKA_DISC = Registry.register( public static final Item ERIKA_DISC = Registry.register(
@@ -2319,6 +2347,16 @@ public class Szar implements ModInitializer {
new Item.Settings() new Item.Settings()
) )
); );
public static final Item ORBAN_SPAWNEGG = Registry.register(
Registries.ITEM,
new Identifier(MOD_ID, "orban_spawn_egg"),
new SpawnEggItem(
OrbanEntityType,
0xFD8100,
0xFFFFFF,
new Item.Settings()
)
);
public static final Item HITTER_SPAWNEGG = Registry.register( public static final Item HITTER_SPAWNEGG = Registry.register(
Registries.ITEM, Registries.ITEM,
new Identifier(MOD_ID, "hitler_spawn_egg"), new Identifier(MOD_ID, "hitler_spawn_egg"),

View File

@@ -1,5 +0,0 @@
package dev.tggamesyt.szar;
public interface TeamMember {
String getTeam(); // returns "communist" or "tsarist" (or whatever your 2nd team is)
}

View File

@@ -0,0 +1,5 @@
package dev.tggamesyt.szar;
public interface WarParticipant {
String getTeam();
}

View File

@@ -209,5 +209,11 @@
"item.szar.ender_ingot": "Ender Ingot", "item.szar.ender_ingot": "Ender Ingot",
"advancement.szar.april_game_beaten.title": "We are so back", "advancement.szar.april_game_beaten.title": "We are so back",
"advancement.szar.april_game_beaten.description": "Beat the game on april 1st to flip the game back." "advancement.szar.april_game_beaten.description": "Beat the game on april 1st to flip the game back.",
"entity.szar.orban": "Orbán Viktor",
"entity.szar.magyar": "Magyar Péter",
"item.szar.hun_disc": "Music Disc",
"item.szar.hun_disc.desc": "Kölcsey Ferenc - Hungarian Anthem",
"item.szar.orban_spawn_egg": "Orbán Spawn Egg"
} }

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "szar:item/hun_disc"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/template_spawn_egg"
}

View File

@@ -242,5 +242,13 @@
"stream": true "stream": true
} }
] ]
},
"hun_anthem": {
"sounds": [
{
"name": "szar:hun_anthem",
"stream": true
}
]
} }
} }

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 895 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B