Skip to content

Commit 8f5bef9

Browse files
committed
fixed rabbit movement
1 parent 2def072 commit 8f5bef9

File tree

11 files changed

+779
-409
lines changed

11 files changed

+779
-409
lines changed

TODO.txt

+6-4
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ Bugfixes
2828
--------
2929
[❌] Prevent superflat worlds generating regular worlds after a certain range
3030
[❌] Kicked for sending too many packets when spam clicking large army (rate-limit in server.properties?)
31-
[❌] groundYlevel not working if you're already below it?
31+
3232
[❌] gui scale not working?
3333

3434
[❌] Recreate tutorial world in 1.20.1
3535
[🟡] Fixed camera centering on the tutorial world
36-
[🟡] Mounted piglins don't heal from nether terrain
37-
[🟡] Anchors not saving properly?
36+
[] Mounted piglins don't heal from nether terrain
37+
[🟡] Anchors are now saved correctly on server restart
3838

3939
Quality of Life
4040
---------------
@@ -48,8 +48,10 @@ Quality of Life
4848
[🟡] Spiders now have a button to toggle whether they climb on walls or not
4949
[🟡] Slimes and magma cubes can now no-clip through log and leaf blocks
5050
[✔] Turn cheats on by default for sandbox mode
51-
[🟡] Healing Fountains now heal 1% of hp per second instead of a flat rate, up to a maximum of 1hp/s
51+
[✔] Healing Fountains now heal 1% of hp per second instead of a flat rate, up to a maximum of 1hp/s
52+
[🟡] Dripstone is now mineable by workers, worth 1 ore each
5253

54+
[❌] language updates
5355

5456
Balancing
5557
---------

TODO_backlog.txt

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Features
1010

1111
[❌] Add basic controls for non-rts units (so you can control modded units)
1212

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

1416
Bugfixes
1517
--------

src/main/java/com/solegendary/reignofnether/orthoview/OrthoviewClientEvents.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ public static boolean shouldHideLeaves() {
120120

121121
public static void setMinOrthoviewY(double value) {
122122
minOrthoviewY = value;
123-
if (MC.level != null && MC.player != null && MC.player.getY() < value) {
124-
MC.player.move(MoverType.SELF, new Vec3(0, minOrthoviewY - MC.player.getY(), 0));
123+
if (MC.level != null && MC.player != null && MC.player.getY() < value + 15) {
124+
MC.player.move(MoverType.SELF, new Vec3(0, minOrthoviewY - MC.player.getY() + 15, 0));
125125
}
126126
}
127127

@@ -157,7 +157,7 @@ public static void updateOrthoviewY() {
157157
int avgHeight = count > 0 ? sumHeights / count : playerPos.getY();
158158

159159
// Update ORTHOVIEW values based on the average height
160-
orthoviewPlayerBaseY = Math.max(avgHeight + 40, minOrthoviewY);
160+
orthoviewPlayerBaseY = Math.max(avgHeight + 30, minOrthoviewY);
161161
orthoviewPlayerMaxY = avgHeight + 100;
162162
}
163163
}

src/main/java/com/solegendary/reignofnether/player/PlayerServerEvents.java

-12
Original file line numberDiff line numberDiff line change
@@ -487,20 +487,8 @@ public static void startRTSBot(String name, Vec3 pos, Faction faction) {
487487
}
488488
}
489489

490-
// commands for ops to give resources
491490
@SubscribeEvent
492491
public static void onPlayerChat(ServerChatEvent evt) {
493-
/*
494-
if (evt.getMessage().getString().equals("test spiders")) {
495-
UnitServerEvents.convertAllToUnit(
496-
evt.getPlayer().getName().getString(),
497-
evt.getPlayer().getLevel(),
498-
(LivingEntity entity) ->
499-
entity instanceof SpiderUnit sUnit &&
500-
sUnit.getOwnerName().equals(evt.getPlayer().getName().getString()),
501-
EntityRegistrar.POISON_SPIDER_UNIT.get()
502-
);
503-
}*/
504492
if (evt.getPlayer().hasPermissions(4)) {
505493
String msg = evt.getMessage().getString();
506494
String[] words = msg.split(" ");

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

+7
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,13 @@ public static List<ItemStack> getFoodItemsFromAnimal(Animal animal) {
353353
1,
354354
ResourceName.ORE
355355
),
356+
new ResourceSource("Dripstone",
357+
List.of(Blocks.POINTED_DRIPSTONE),
358+
List.of(Items.POINTED_DRIPSTONE),
359+
20,
360+
1,
361+
ResourceName.ORE
362+
),
356363
new ResourceSource("Tier 1 Nether Ores",
357364
List.of(Blocks.NETHER_QUARTZ_ORE),
358365
List.of(Items.QUARTZ),

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,17 @@ public static void onRegisterCommand(RegisterCommandsEvent evt) {
297297

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

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

308308
evt.getDispatcher().register(Commands.literal("sendore")
309309
.then(Commands.argument("player", EntityArgument.player())
310-
.then(Commands.argument("amount", IntegerArgumentType.integer(0, Integer.MAX_VALUE))
310+
.then(Commands.argument("amount", IntegerArgumentType.integer(1, Integer.MAX_VALUE))
311311
.executes((command) -> trySendingResources(command, ResourceName.ORE)))));
312312
}
313313

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import com.solegendary.reignofnether.research.ResearchServerEvents;
99
import com.solegendary.reignofnether.resources.*;
1010
import com.solegendary.reignofnether.unit.TargetResourcesSave;
11-
import com.solegendary.reignofnether.unit.packets.UnitSyncClientboundPacket;
1211
import com.solegendary.reignofnether.unit.interfaces.Unit;
1312
import com.solegendary.reignofnether.unit.interfaces.WorkerUnit;
13+
import com.solegendary.reignofnether.unit.packets.UnitSyncClientboundPacket;
1414
import com.solegendary.reignofnether.unit.units.villagers.VillagerUnit;
1515
import com.solegendary.reignofnether.unit.units.villagers.VillagerUnitProfession;
1616
import com.solegendary.reignofnether.util.MiscUtil;
@@ -21,7 +21,6 @@
2121
import net.minecraft.world.item.ItemStack;
2222
import net.minecraft.world.level.block.Blocks;
2323
import net.minecraft.world.level.block.state.BlockState;
24-
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
2524
import net.minecraft.world.phys.AABB;
2625

2726
import javax.annotation.Nullable;
@@ -320,7 +319,7 @@ else if (expName == ResourceName.ORE)
320319
}
321320

322321
// replace workers' mine ores with cobble to prevent creating potholes
323-
if (data.targetResourceSource.resourceName == ResourceName.ORE) {
322+
if (data.targetResourceSource.resourceName == ResourceName.ORE && bsTarget.getBlock() != Blocks.POINTED_DRIPSTONE) {
324323
BlockState replaceBs;
325324
if (BuildingUtils.isInNetherRange(mob.level().isClientSide(), data.gatherTarget))
326325
replaceBs = BlockRegistrar.WALKABLE_MAGMA_BLOCK.get().defaultBlockState();

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

+11-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import net.minecraft.world.level.Level;
3131
import net.minecraft.world.level.ServerLevelAccessor;
3232
import net.minecraft.world.level.block.state.BlockState;
33+
import net.minecraft.world.phys.Vec3;
3334

3435
import javax.annotation.Nullable;
3536
import java.util.ArrayList;
@@ -146,10 +147,18 @@ public static AttributeSupplier.Builder createAttributes() {
146147

147148
@Override
148149
protected float getJumpPower() {
150+
float jumpPower = super.getJumpPower();
149151
if (getTarget() instanceof GhastUnit && distanceTo(getTarget()) < 12)
150-
return super.getJumpPower() * 4;
152+
return jumpPower * 4;
153+
else if (jumpPower > 0.1f && jumpPower < 0.3f) {
154+
// prevents getting stuck jumping on the spot when pushed flush against a block
155+
double x = (random.nextDouble() - 0.5f) / 0.5f;
156+
double z = (random.nextDouble() - 0.5f) / 0.5f;
157+
move(MoverType.SELF, new Vec3(x, 0, z));
158+
return jumpPower * 3;
159+
}
151160
else
152-
return super.getJumpPower() * 2;
161+
return jumpPower * 2;
153162
}
154163

155164
@Override

src/main/resources/META-INF/accesstransformer.cfg

+6-1
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,9 @@ public net.minecraft.world.entity.Entity m_20272_
8686

8787
protected net.minecraft.world.entity.ExperienceOrb f_20771_
8888
public net.minecraft.world.entity.ExperienceOrb f_147072_
89-
protected net.minecraft.world.entity.ExperienceOrb m_147103_()V
89+
protected net.minecraft.world.entity.ExperienceOrb m_147103_()V
90+
91+
92+
93+
94+

src/main/resources/assets/reignofnether/lang/en_us.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@
646646
"server.resources.reignofnether.sent_ore": "You gave %d ore to %d!",
647647
"server.resources.reignofnether.received_ore": "You received %d ore from %d!",
648648
"server.resources.reignofnether.not_allies": "You can only send resources to allies",
649-
"server.resources.reignofnether.sending_to_self": "You can't send resources to yourself'",
649+
"server.resources.reignofnether.sending_to_self": "You can't send resources to yourself",
650650

651651
"research.reignofnether.upgrade_completed": "Upgrade completed: %s",
652652
"research.reignofnether.advanced_portals": "Advanced Portals",

0 commit comments

Comments
 (0)