Skip to content

Commit 5c079cd

Browse files
committed
killer rabbit
1 parent 8a1f956 commit 5c079cd

File tree

7 files changed

+54
-20
lines changed

7 files changed

+54
-20
lines changed

TODO.txt

+16-12
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ HEROES (in order of priority)
1818
- mana?
1919
- equipment
2020

21+
[✔] Updated the base Minecraft version to 1.20.1
22+
- Moving forward,
2123

22-
[❌] April fools mob ;)
23-
- Add plus jump power when targeting a ghast
24+
[✔] Added a new cheatcode: thebeastofcaerbannog
25+
- Not even Ghasts are safe from it :smiling_devil:
2426

2527
Bugfixes
2628
--------
@@ -30,21 +32,23 @@ Bugfixes
3032
[❌] gui scale not working?
3133

3234
[❌] Recreate tutorial world in 1.20.1
33-
[🟡] tutorial camera centering is off
35+
[🟡] Fixed camera centering on the tutorial world
3436
[🟡] Mounted piglins don't heal from nether terrain
35-
36-
[❌] cursor off in server but not on singleplayer?
37-
37+
[❌] Anchors not saving properly?
3838

3939
Quality of Life
4040
---------------
41-
[🟡] Add commands to send resources
42-
[❌] Ravagers that are mounted no longer aggro automatically onto buildings
43-
- This prevents them hurting themselves from the splash damage
44-
[🟡] Button to toggle spider climbing
45-
[🟡] Slimes and magma cubes no longer clip into log blocks, but are just slowed down
41+
[🟡] Added commands to send resources to allies:
42+
/sendfood <playername> <amount>
43+
/sendwood <playername> <amount>
44+
/sendore <playername> <amount>
45+
46+
[🟡] Ravagers that are mounted no longer automatically aggro onto buildings
47+
- This prevents them hurting themselves from their own splash damage
48+
[🟡] Spiders now have a button to toggle whether they climb on walls or not
49+
[🟡] Slimes and magma cubes can now no-clip through log and leaf blocks
4650
[✔] Turn cheats on by default for sandbox mode
47-
51+
[🟡] Healing Fountains now heal 1% of hp per second instead of a flat rate, up to a maximum of 1hp/s
4852

4953

5054
Balancing

src/main/java/com/solegendary/reignofnether/building/buildings/neutral/HealingFountain.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,13 @@ public void tick(Level tickLevel) {
8787
LivingEntity.class,
8888
this.level);
8989

90-
for (LivingEntity le : nearbyEntities)
91-
if (isBuilt && tickAgeAfterBuilt % 100 == 0) // only 1hp/4s
92-
le.addEffect(new MobEffectInstance(MobEffects.REGENERATION, 100, 0));
90+
for (LivingEntity le : nearbyEntities) {
91+
if (isBuilt && tickAgeAfterBuilt % 20 == 0) {
92+
// this actually isn't enough to cause a healing tick, but is just for effects
93+
le.addEffect(new MobEffectInstance(MobEffects.REGENERATION, 20, 0));
94+
le.heal(Math.min(1, le.getMaxHealth() / 100));
95+
}
96+
}
9397

9498
// spawn random healing particle
9599
if (!waterBlocks.isEmpty() && isBuilt) {

src/main/java/com/solegendary/reignofnether/resources/ResourcesServerEvents.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -295,17 +295,17 @@ public static void fellAdjacentLogs(BlockPos bp, ArrayList<BlockPos> bpsExcluded
295295
@SubscribeEvent
296296
public static void onRegisterCommand(RegisterCommandsEvent evt) {
297297

298-
evt.getDispatcher().register(Commands.literal("send-food")
298+
evt.getDispatcher().register(Commands.literal("sendfood")
299299
.then(Commands.argument("player", EntityArgument.player())
300300
.then(Commands.argument("amount", IntegerArgumentType.integer(0, Integer.MAX_VALUE))
301301
.executes((command) -> trySendingResources(command, ResourceName.FOOD)))));
302302

303-
evt.getDispatcher().register(Commands.literal("send-wood")
303+
evt.getDispatcher().register(Commands.literal("sendwood")
304304
.then(Commands.argument("player", EntityArgument.player())
305305
.then(Commands.argument("amount", IntegerArgumentType.integer(0, Integer.MAX_VALUE))
306306
.executes((command) -> trySendingResources(command, ResourceName.WOOD)))));
307307

308-
evt.getDispatcher().register(Commands.literal("send-ore")
308+
evt.getDispatcher().register(Commands.literal("sendore")
309309
.then(Commands.argument("player", EntityArgument.player())
310310
.then(Commands.argument("amount", IntegerArgumentType.integer(0, Integer.MAX_VALUE))
311311
.executes((command) -> trySendingResources(command, ResourceName.ORE)))));

src/main/java/com/solegendary/reignofnether/unit/goals/AbstractMeleeAttackUnitGoal.java

+4
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ else if (distSqr < 64)
126126
}
127127
}
128128

129+
public void checkAndPerformAttackIgnoreDist(LivingEntity target) {
130+
checkAndPerformAttack(target, 0);
131+
}
132+
129133
protected void checkAndPerformAttack(LivingEntity target, double distSqr) {
130134
double d = this.getAttackReachSqr(target);
131135
if (distSqr <= d && this.ticksUntilNextAttack <= 0) {

src/main/java/com/solegendary/reignofnether/unit/interfaces/AttackerUnit.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.solegendary.reignofnether.unit.Relationship;
77
import com.solegendary.reignofnether.unit.UnitServerEvents;
88
import com.solegendary.reignofnether.unit.goals.*;
9+
import com.solegendary.reignofnether.unit.units.villagers.RavagerUnit;
910
import com.solegendary.reignofnether.util.MiscUtil;
1011
import com.solegendary.reignofnether.util.MyMath;
1112
import net.minecraft.core.BlockPos;
@@ -213,7 +214,7 @@ public default void attackClosestEnemy(ServerLevel level) {
213214
setUnitAttackTarget(entity);
214215
return;
215216
}
216-
if (canAttackBuildings()) {
217+
if (canAttackBuildings() && !(this instanceof RavagerUnit && ((LivingEntity) this).isVehicle())) {
217218
Building closestBuilding = MiscUtil.findClosestAttackableBuilding((Mob) this, aggroRange, level);
218219
if (closestBuilding != null) {
219220
((Unit) this).getMoveGoal().stopMoving();

src/main/java/com/solegendary/reignofnether/unit/units/neutral/KillerRabbitUnit.java

+22-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.solegendary.reignofnether.unit.goals.*;
99
import com.solegendary.reignofnether.unit.interfaces.AttackerUnit;
1010
import com.solegendary.reignofnether.unit.interfaces.Unit;
11+
import com.solegendary.reignofnether.unit.units.piglins.GhastUnit;
1112
import com.solegendary.reignofnether.util.Faction;
1213
import net.minecraft.core.BlockPos;
1314
import net.minecraft.nbt.CompoundTag;
@@ -145,7 +146,10 @@ public static AttributeSupplier.Builder createAttributes() {
145146

146147
@Override
147148
protected float getJumpPower() {
148-
return super.getJumpPower() * 2;
149+
if (getTarget() instanceof GhastUnit && distanceTo(getTarget()) < 12)
150+
return super.getJumpPower() * 4;
151+
else
152+
return super.getJumpPower() * 2;
149153
}
150154

151155
@Override
@@ -156,6 +160,23 @@ public Variant getVariant() {
156160
@Override // immune to fall damage
157161
protected void checkFallDamage(double pY, boolean pOnGround, BlockState pState, BlockPos pPos) { }
158162

163+
@Override
164+
public void push(Entity pEntity) {
165+
super.push(pEntity);
166+
LivingEntity target = this.getTargetGoal().getTarget();
167+
if (target == pEntity) {
168+
this.attackGoal.checkAndPerformAttackIgnoreDist(target);
169+
}
170+
}
171+
172+
@Override
173+
public void setSpeedModifier(double pSpeedModifier) {
174+
if (pSpeedModifier >= 0.1f) {
175+
pSpeedModifier = 2.0f;
176+
}
177+
super.setSpeedModifier(pSpeedModifier);
178+
}
179+
159180
@Override
160181
public boolean doHurtTarget(Entity pEntity) {
161182
this.playSound(SoundEvents.RABBIT_ATTACK, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
Loading

0 commit comments

Comments
 (0)