orban
This commit is contained in:
@@ -6,7 +6,7 @@ minecraft_version=1.20.1
|
||||
yarn_mappings=1.20.1+build.10
|
||||
loader_version=0.18.3
|
||||
# Mod Properties
|
||||
mod_version=26.4.13
|
||||
mod_version=26.4.13.1
|
||||
maven_group=dev.tggamesyt
|
||||
archives_base_name=szar
|
||||
# Dependencies
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,6 +548,10 @@ public class SzarClient implements ClientModInitializer {
|
||||
Szar.HitterEntityType,
|
||||
HitterEntityRenderer::new
|
||||
);
|
||||
EntityRendererRegistry.register(
|
||||
OrbanEntityType,
|
||||
OrbanEntityRenderer::new
|
||||
);
|
||||
EntityRendererRegistry.register(
|
||||
Szar.StalinEntityType,
|
||||
StalinEntityRenderer::new
|
||||
|
||||
@@ -5,11 +5,11 @@ import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.ai.goal.ActiveTargetGoal;
|
||||
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 -> {
|
||||
if (target instanceof TeamMember other) {
|
||||
if (target instanceof HunPartie other) {
|
||||
return !other.getTeam().equals(myTeam);
|
||||
}
|
||||
return false;
|
||||
18
src/main/java/dev/tggamesyt/szar/AttackEnemyWarGoal.java
Normal file
18
src/main/java/dev/tggamesyt/szar/AttackEnemyWarGoal.java
Normal 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;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.world.ServerWorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
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;
|
||||
@Nullable
|
||||
@@ -38,7 +38,7 @@ public class CommunistEntity extends PathAwareEntity implements Arrestable, Team
|
||||
this.goalSelector.add(1, new AK47AttackGoal(this, 16.0F, 2));
|
||||
|
||||
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
|
||||
this.targetSelector.add(2, new AttackEnemyTeamGoal(this, "communist"));
|
||||
this.targetSelector.add(2, new AttackEnemyWarGoal(this, "communist"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,12 +20,11 @@ import net.minecraft.world.ServerWorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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;
|
||||
|
||||
@@ -40,7 +39,7 @@ public class HitterEntity extends PathAwareEntity implements Arrestable, TeamMem
|
||||
this.goalSelector.add(3, new LookAroundGoal(this));
|
||||
|
||||
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
|
||||
this.targetSelector.add(2, new AttackEnemyTeamGoal(this, "nazi"));
|
||||
this.targetSelector.add(2, new AttackEnemyWarGoal(this, "nazi"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
5
src/main/java/dev/tggamesyt/szar/HunPartie.java
Normal file
5
src/main/java/dev/tggamesyt/szar/HunPartie.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
public interface HunPartie {
|
||||
String getTeam();
|
||||
}
|
||||
@@ -21,5 +21,6 @@ public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider {
|
||||
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.HELLO_DISC);
|
||||
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.ERIKA_DISC);
|
||||
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.USSR_DISC);
|
||||
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.HUN_DISC);
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.world.ServerWorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
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 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.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
|
||||
this.targetSelector.add(2, new AttackEnemyTeamGoal(this, "nazi"));
|
||||
this.targetSelector.add(2, new AttackEnemyWarGoal(this, "nazi"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
67
src/main/java/dev/tggamesyt/szar/OrbanEntity.java
Normal file
67
src/main/java/dev/tggamesyt/szar/OrbanEntity.java
Normal 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";
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ import java.util.List;
|
||||
|
||||
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;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class StalinEntity extends PathAwareEntity implements Arrestable, TeamMem
|
||||
this.goalSelector.add(3, new LookAroundGoal(this));
|
||||
|
||||
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
|
||||
this.targetSelector.add(2, new AttackEnemyTeamGoal(this, "communist"));
|
||||
this.targetSelector.add(2, new AttackEnemyWarGoal(this, "communist"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -286,6 +286,15 @@ public class Szar implements ModInitializer {
|
||||
.dimensions(EntityDimensions.fixed(0.6F, 1.8F)) // player-sized
|
||||
.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 =
|
||||
Registry.register(
|
||||
Registries.ENTITY_TYPE,
|
||||
@@ -443,6 +452,9 @@ public class Szar implements ModInitializer {
|
||||
entries.add(Szar.COMMUNIST_SPAWNEGG);
|
||||
entries.add(Szar.ERIKA_DISC);
|
||||
entries.add(Szar.USSR_DISC);
|
||||
// politics
|
||||
entries.add(Szar.ORBAN_SPAWNEGG);
|
||||
entries.add(Szar.HUN_DISC);
|
||||
// racism
|
||||
if (showRacist) {
|
||||
entries.add(Szar.CIGANYBLOCK);
|
||||
@@ -837,6 +849,10 @@ public class Szar implements ModInitializer {
|
||||
HitterEntityType,
|
||||
HitterEntity.createAttributes()
|
||||
);
|
||||
FabricDefaultAttributeRegistry.register(
|
||||
OrbanEntityType,
|
||||
OrbanEntity.createAttributes()
|
||||
);
|
||||
FabricDefaultAttributeRegistry.register(
|
||||
CommunistEntityType,
|
||||
CommunistEntity.createAttributes()
|
||||
@@ -905,7 +921,12 @@ public class Szar implements ModInitializer {
|
||||
1, // min 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(
|
||||
BiomeSelectors.includeByKey(BiomeKeys.WINDSWEPT_HILLS, BiomeKeys.WINDSWEPT_GRAVELLY_HILLS, BiomeKeys.STONY_PEAKS),
|
||||
SpawnGroup.MONSTER,
|
||||
@@ -2261,6 +2282,13 @@ public class Szar implements ModInitializer {
|
||||
new Identifier(MOD_ID, "baiter"),
|
||||
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 =
|
||||
SoundEvent.of(new Identifier(MOD_ID, "erika"));
|
||||
public static final Item ERIKA_DISC = Registry.register(
|
||||
@@ -2319,6 +2347,16 @@ public class Szar implements ModInitializer {
|
||||
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(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "hitler_spawn_egg"),
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
public interface TeamMember {
|
||||
String getTeam(); // returns "communist" or "tsarist" (or whatever your 2nd team is)
|
||||
}
|
||||
5
src/main/java/dev/tggamesyt/szar/WarParticipant.java
Normal file
5
src/main/java/dev/tggamesyt/szar/WarParticipant.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
public interface WarParticipant {
|
||||
String getTeam();
|
||||
}
|
||||
@@ -209,5 +209,11 @@
|
||||
"item.szar.ender_ingot": "Ender Ingot",
|
||||
|
||||
"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"
|
||||
}
|
||||
|
||||
6
src/main/resources/assets/szar/models/item/hun_disc.json
Normal file
6
src/main/resources/assets/szar/models/item/hun_disc.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "szar:item/hun_disc"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "minecraft:item/template_spawn_egg"
|
||||
}
|
||||
@@ -242,5 +242,13 @@
|
||||
"stream": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"hun_anthem": {
|
||||
"sounds": [
|
||||
{
|
||||
"name": "szar:hun_anthem",
|
||||
"stream": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
BIN
src/main/resources/assets/szar/sounds/hun_anthem.ogg
Normal file
BIN
src/main/resources/assets/szar/sounds/hun_anthem.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/szar/textures/entity/magyar.png
Normal file
BIN
src/main/resources/assets/szar/textures/entity/magyar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
BIN
src/main/resources/assets/szar/textures/entity/orban.png
Normal file
BIN
src/main/resources/assets/szar/textures/entity/orban.png
Normal file
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 |
BIN
src/main/resources/assets/szar/textures/item/hun_disc.png
Normal file
BIN
src/main/resources/assets/szar/textures/item/hun_disc.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 320 B |
Reference in New Issue
Block a user