Skip to content

Commit d352e5c

Browse files
authored
Merge pull request #241 from SoLegendary/1.20.1-1.1.4
1.20.1 1.1.4
2 parents 9ef1764 + c537623 commit d352e5c

File tree

87 files changed

+3928
-692
lines changed

Some content is hidden

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

87 files changed

+3928
-692
lines changed

TODO.txt

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
1.19.2-1.1.3a
2+
1.19.2-1.1.4
33

44
[✔] Done and tested
55
[🟡] Partially done and/or needs testing
@@ -8,19 +8,35 @@
88

99
Features
1010
--------
11-
11+
HEROES (in order of priority)
12+
- spells
13+
- spell animations
14+
- spell particles
15+
- levelling and exp
16+
- exp bar/level number above portrait, below name
17+
- spell levelling and requirements
18+
- mana?
19+
- equipment
1220

1321

1422
Bugfixes
1523
--------
16-
[✔] Fixed Pillagers not attacking
17-
[✔] Healing fountains now remove their water blocks when deleted
18-
[✔] Beacon win timers are now saved between server restarts
24+
[❌] Prevent superflat worlds generating regular worlds after a certain range
25+
[❌] Kicked for sending too many packets when spam clicking large army (rate-limit in server.properties?)
26+
1927

28+
Quality of Life
29+
---------------
2030

2131

2232
Balancing
2333
---------
34+
- Nerf sculk amplifiers? (can reduce damage)
35+
- Nerf ravager artillery? (take away bonus damage?)
36+
- Buff creepers?
37+
- Give witches autocast and attack move
38+
- Make AOE spherical instead of hemispherical
39+
- Add antifire and healing potions with upgrades
2440

2541

2642
Villagers

TODO_backlog.txt

+8-13
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,16 @@
66
Features
77
--------
88

9-
[❌] Piglin mines
10-
- Static defense for piglins, but can also be used to siege
11-
- When built, can be exploded manaully (or set to autoexplode on nearby enemies approaching)
12-
- Explodes into combination of soulsand and magma
9+
[❌] Import the Bedrock Minecraft Movie addon piglins
1310

11+
[❌] Add basic controls for non-rts units (so you can control modded units)
1412

13+
[❌] Config to allow changing resource block values, including modded blocks
1514

1615

1716
Bugfixes
1817
--------
1918

20-
[❌] Workers on a building that is still auto-building the foundation layer actually slows down building
21-
22-
[❌] Central portals sometimes do not ignite (and this somehow makes grunts spawn underground)
23-
2419
[❌] Dying in survival puts you in a bugged survival mode
2520

2621
[❌] Villagers with professions don't use the correct texture for their arms, esp. farmers
@@ -33,16 +28,16 @@ Quality of Life Features
3328

3429
[❌] Added /gamerule for bridges over void
3530

36-
[❌] Save transport portal links between server restarts
37-
3831
[❌] restore ores on /rts-reset
3932
- Have to track each ore block when it is mined or converted into nether terrain
4033

41-
34+
[❌] buff/debuff icons in vertical list to right of unit stats
35+
- potion effects
36+
- auras
37+
- hero passives
38+
- enchantments
4239

4340
Balancing
4441
---------
4542

4643
[❌] Soulfires created by blazes need to be made temporary
47-
48-
[❌] let allied survival players use transport portals

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ apply plugin: 'maven-publish'
1919
apply plugin: 'org.spongepowered.mixin'
2020
apply plugin: 'org.parchmentmc.librarian.forgegradle'
2121

22-
version = '1.1.3a-1.20.1-beta'
22+
version = '1.1.4'
2323
group = 'com.solegendary.reignofnether' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
2424
archivesBaseName = 'reignofnether'
2525

src/main/java/com/solegendary/reignofnether/CommonModEvents.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public static void registerRenderers(EntityRenderersEvent.RegisterRenderers evt)
106106
evt.registerEntityRenderer(EntityRegistrar.PANDA_UNIT.get(), PandaRenderer::new);
107107
evt.registerEntityRenderer(EntityRegistrar.WOLF_UNIT.get(), WolfRenderer::new);
108108
evt.registerEntityRenderer(EntityRegistrar.LLAMA_UNIT.get(), LlamaUnitRenderer::new);
109+
110+
evt.registerEntityRenderer(EntityRegistrar.PHANTOM_SUMMON.get(), PhantomRenderer::new);
111+
evt.registerEntityRenderer(EntityRegistrar.KILLER_RABBIT_UNIT.get(), RabbitRenderer::new);
109112
}
110113

111114
@SubscribeEvent
@@ -115,6 +118,7 @@ public static void registerAttributes(EntityAttributeCreationEvent evt) {
115118
evt.put(EntityRegistrar.PANDA_UNIT.get(), PandaUnit.createAttributes().build());
116119
evt.put(EntityRegistrar.WOLF_UNIT.get(), WolfUnit.createAttributes().build());
117120
evt.put(EntityRegistrar.LLAMA_UNIT.get(), WolfUnit.createAttributes().build());
121+
evt.put(EntityRegistrar.PHANTOM_SUMMON.get(), PhantomSummon.createAttributes().build());
118122

119123
evt.put(EntityRegistrar.ZOMBIE_UNIT.get(), ZombieUnit.createAttributes().build());
120124
evt.put(EntityRegistrar.ZOMBIE_PIGLIN_UNIT.get(), ZombiePiglinUnit.createAttributes().build());
@@ -150,7 +154,7 @@ public static void registerAttributes(EntityAttributeCreationEvent evt) {
150154
evt.put(EntityRegistrar.ROYAL_GUARD_UNIT.get(), RoyalGuardUnit.createAttributes().build());
151155
evt.put(EntityRegistrar.NECROMANCER_UNIT.get(), NecromancerUnit.createAttributes().build());
152156
evt.put(EntityRegistrar.PIGLIN_MERCHANT_UNIT.get(), PiglinMerchantUnit.createAttributes().build());
153-
157+
evt.put(EntityRegistrar.KILLER_RABBIT_UNIT.get(), KillerRabbitUnit.createAttributes().build());
154158
}
155159

156160
@SubscribeEvent
@@ -214,7 +218,6 @@ public static void creativeTabSetup(BuildCreativeModeTabContentsEvent event) {
214218
event.accept(ItemRegistrar.ROYAL_GUARD_UNIT_SPAWN_EGG);
215219
event.accept(ItemRegistrar.NECROMANCER_UNIT_SPAWN_EGG);
216220
event.accept(ItemRegistrar.PIGLIN_MERCHANT_UNIT_SPAWN_EGG);
217-
218221
}
219222
}
220223
}

src/main/java/com/solegendary/reignofnether/ReignOfNether.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
public class ReignOfNether {
4747
public static final Logger LOGGER = LogManager.getLogger();
4848
public static final String MOD_ID = "reignofnether";
49-
public static final String VERSION_STRING = "1.1.3a-1.20.1-beta";
49+
public static final String VERSION_STRING = "1.1.4";
5050

5151
// Fields from ClientReset
5252
public static final Field handshakeField;

src/main/java/com/solegendary/reignofnether/ability/Ability.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
public class Ability {
1616
public final UnitAction action; // null for worker building production items (handled specially in BuildingClientEvents)
1717
public final Level level;
18-
public final float cooldownMax;
18+
public float cooldownMax;
1919
private float cooldown = 0;
2020
public final float range; // if <= 0, is melee
2121
public final float radius; // if <= 0, is single target
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package com.solegendary.reignofnether.ability;
2+
3+
import com.solegendary.reignofnether.registrars.PacketHandler;
4+
import com.solegendary.reignofnether.unit.UnitAction;
5+
import com.solegendary.reignofnether.unit.UnitClientEvents;
6+
import com.solegendary.reignofnether.unit.UnitServerEvents;
7+
import com.solegendary.reignofnether.unit.interfaces.Unit;
8+
import com.solegendary.reignofnether.unit.packets.UnitActionServerboundPacket;
9+
import net.minecraft.network.FriendlyByteBuf;
10+
import net.minecraft.world.entity.LivingEntity;
11+
import net.minecraftforge.network.NetworkEvent;
12+
13+
import java.util.concurrent.atomic.AtomicBoolean;
14+
import java.util.function.Supplier;
15+
16+
public class AbilityServerboundPacket {
17+
18+
private final int unitId;
19+
private final UnitAction unitAction;
20+
21+
public static void rankUpAbility(int unitId, UnitAction abilityAction) {
22+
PacketHandler.INSTANCE.sendToServer(new AbilityServerboundPacket(unitId, abilityAction));
23+
}
24+
25+
public AbilityServerboundPacket(
26+
int unitId,
27+
UnitAction unitAction
28+
) {
29+
this.unitId = unitId;
30+
this.unitAction = unitAction;
31+
}
32+
33+
public AbilityServerboundPacket(FriendlyByteBuf buffer) {
34+
this.unitId = buffer.readInt();
35+
this.unitAction = buffer.readEnum(UnitAction.class);
36+
}
37+
38+
public void encode(FriendlyByteBuf buffer) {
39+
buffer.writeInt(this.unitId);
40+
buffer.writeEnum(this.unitAction);
41+
}
42+
43+
// server-side packet-consuming functions
44+
public boolean handle(Supplier<NetworkEvent.Context> ctx) {
45+
final var success = new AtomicBoolean(false);
46+
ctx.get().enqueueWork(() -> {
47+
success.set(true);
48+
for (LivingEntity entity : UnitServerEvents.getAllUnits())
49+
if (entity.getId() == this.unitId && entity instanceof Unit unit)
50+
for (Ability ability : unit.getAbilities())
51+
if (ability.action == this.unitAction && ability instanceof HeroAbility heroAbility)
52+
heroAbility.rankUp();
53+
});
54+
ctx.get().setPacketHandled(true);
55+
return success.get();
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
package com.solegendary.reignofnether.ability;
2+
3+
import com.solegendary.reignofnether.ReignOfNether;
4+
import com.solegendary.reignofnether.hud.AbilityButton;
5+
import com.solegendary.reignofnether.hud.Button;
6+
import com.solegendary.reignofnether.keybinds.Keybinding;
7+
import com.solegendary.reignofnether.keybinds.Keybindings;
8+
import com.solegendary.reignofnether.unit.UnitAction;
9+
import com.solegendary.reignofnether.unit.interfaces.HeroUnit;
10+
import com.solegendary.reignofnether.unit.interfaces.Unit;
11+
import net.minecraft.client.resources.language.I18n;
12+
import net.minecraft.network.chat.Style;
13+
import net.minecraft.resources.ResourceLocation;
14+
import net.minecraft.util.FormattedCharSequence;
15+
import net.minecraft.world.entity.Entity;
16+
17+
import java.util.List;
18+
19+
import static com.solegendary.reignofnether.util.MiscUtil.fcs;
20+
21+
public abstract class HeroAbility extends Ability {
22+
23+
// can be ranked up when the hero levels up
24+
// requires a HeroUnit to be passed
25+
26+
public final HeroUnit hero;
27+
public int rank = 0; // 0 == not learnt
28+
public final int maxRank;
29+
30+
public HeroAbility(HeroUnit hero, int maxRank, UnitAction action, int cooldownMax, float range, float radius, boolean canTargetEntities) {
31+
super(action, ((Entity) hero).level(), cooldownMax, range, radius, canTargetEntities);
32+
this.hero = hero;
33+
this.maxRank = maxRank;
34+
}
35+
36+
public int getLevelRequirement() {
37+
if (maxRank <= 1) {
38+
return 6;
39+
} else {
40+
return (rank * 2) + 1;
41+
}
42+
}
43+
44+
public boolean rankUp() {
45+
if (rank < maxRank && hero.getSkillPoints() > 0 && hero.getHeroLevel() >= getLevelRequirement()) {
46+
rank += 1;
47+
hero.setSkillPoints(hero.getSkillPoints() - 1);
48+
return true;
49+
}
50+
return false;
51+
}
52+
53+
protected String rankString() {
54+
return rank > 0 ? I18n.get("abilities.reignofnether.rank", rank) : I18n.get("abilities.reignofnether.unlearnt");
55+
}
56+
57+
public List<FormattedCharSequence> getRankUpTooltipLines() {
58+
return List.of();
59+
}
60+
61+
public List<FormattedCharSequence> getTooltipLines() {
62+
return List.of();
63+
}
64+
65+
public AbilityButton getButton(Keybinding hotkey) {
66+
return null;
67+
}
68+
69+
// rank up button for this specific ability
70+
public Button getRankUpButton() {
71+
return null;
72+
}
73+
74+
protected Button getRankUpButtonProtected(String name, ResourceLocation resourceLocation) {
75+
Button button = new Button(name,
76+
14,
77+
new ResourceLocation(ReignOfNether.MOD_ID, "textures/hud/level_up_skill.png"),
78+
(Keybinding) null,
79+
() -> false,
80+
() -> !hero.isRankUpMenuOpen() || rank >= maxRank,
81+
() -> hero.getSkillPoints() > 0 && hero.getHeroLevel() >= getLevelRequirement(),
82+
() -> {
83+
if (rankUp()) {
84+
AbilityServerboundPacket.rankUpAbility(((Entity) hero).getId(), action);
85+
((Unit) hero).updateAbilityButtons();
86+
}
87+
if (hero.getSkillPoints() <= 0)
88+
hero.showRankUpMenu(false);
89+
},
90+
null,
91+
getRankUpTooltipLines()
92+
);
93+
button.bgIconResource = resourceLocation;
94+
return button;
95+
}
96+
97+
// button that all heroes have to show ability level up options
98+
public static Button getRankUpMenuButton(HeroUnit hero) {
99+
Button menuButton = new Button("Rank up abilities",
100+
14,
101+
hero.isRankUpMenuOpen() ?
102+
new ResourceLocation(ReignOfNether.MOD_ID, "textures/hud/cross.png") :
103+
new ResourceLocation(ReignOfNether.MOD_ID, "textures/hud/tick.png"),
104+
Keybindings.keyU,
105+
() -> false,
106+
() -> hero.getHeroLevel() >= HeroUnit.MAX_HERO_LEVEL && hero.getSkillPoints() <= 0,
107+
() -> true,
108+
() -> hero.showRankUpMenu(!hero.isRankUpMenuOpen()),
109+
null,
110+
List.of(fcs(I18n.get("abilities.reignofnether.rank_up_menu", hero.getSkillPoints()), true))
111+
);
112+
menuButton.isFlashing = () -> !hero.isRankUpMenuOpen() && hero.getSkillPoints() > 0;
113+
return menuButton;
114+
}
115+
116+
public Style getLevelReqStyle() {
117+
return Style.EMPTY.withColor(hero.getHeroLevel() >= getLevelRequirement() ? 0x00FF00 : 0xFF0000);
118+
}
119+
}

0 commit comments

Comments
 (0)