Commit graph

19 commits

Author SHA1 Message Date
modmuss50
9ff28f4026
Split client only code into its own sourceset. (#2179)
A common source of crashes on modded Minecraft servers comes from modders accidently calling client only code from the client, this PR is another large step towards elimitating that.

This PR has been months in the making and years in the planning, requiring major changes to Loom & Loader. In recent Minecraft versions Mojang has made it easier than ever to cleanly split the jar, going against the status-quo of merging the client and server into one jar.

From the start we have designed Fabric to have a very clear split between client and common (client & server) code. Fabric has always encoraged keeping client only code seprate from the server, this can be seen at a fundamental level with the entrypoints in Loader. Fabric API's have all been designed with this mind.

This PR provides a compile safety net around Fabric API using client only code on the server. Even though there are almost 400 changed files, minimal changes beyond moving the files were required to achieve this in Fabric API, thanks to the effort of all contributors in the past.

These changes should not affect modders or players in anyway, a single "universal" jar is still produced. Im happy to awnswer any questions.
2022-05-21 16:26:46 +01:00
Player
f71b366fb1
Update command registration API to reflect 1.19 vanilla changes (#2227)
* Update command registration API to reflect vanilla changes

* Allow module versions in impl+mixin packages

* Use v2 module, keeping v1 for server commands at least

* update, address review

Co-authored-by: modmuss50 <modmuss50@gmail.com>
2022-05-20 18:39:10 +01:00
Technici4n
6b21378a26 Add AllowElytraFlight event (#1815)
Use explicit casts instead of .class.cast in mixins

Reorganize API class, and make it work for any living entity

add LivingEntityFeatureRenderEvents to disable cape rendering

Reorganize/rename hook, and add ALLOW event

Fix missing mixin return & cosmetic adjustements
2021-11-23 17:26:51 +00:00
modmuss50
b4f4f6cda4 Update Loom and Loader. Cleanup/improve buildscript. 2021-11-12 15:02:54 +00:00
modmuss50
65d505fc8a Bump versions
All of the version need to be bumped due to fabric-api-base being updated, this highlights the need for a better solution.
2021-11-05 17:09:48 +00:00
modmuss50
e14f9c8f05 21w44a 2021-11-03 18:57:29 +00:00
modmuss50
938d6de077 21w42a 2021-10-20 21:31:17 +01:00
Juuxel
86675b35dc Add two more sleep events (#1755)
* Add event for setting bed occupation state

* Add wake up pos event and update tests

* Bump version

Just in case. I have a bad feeling that
this could become a patch version otherwise.

* Add code tags for true/false/null in EntitySleepEvents jd

* Add Dynamic annotations for lambda body mixins

* Update class javadoc to contain the new events
2021-10-17 19:15:37 +01:00
modmuss50
8f2c3e04fb Bump version 2021-09-21 11:41:06 +01:00
Juuxel
87cc6e4c30
Sleeping event fixes (#1681)
* Un-hardcode FACING property checks from only BedBlocks

* Use a better injection point for EntitySleepEvents.ALLOW_BED

* Fix #1680

* Bump entity events version

* Clarify javadoc

* Let's not forget license headers

* Add a note about the vanilla bug

* Update BedBlockMixin.java
2021-08-31 13:59:48 +01:00
modmuss50
62e33f4127 Fix dedicated dev server crash #1670 2021-08-25 20:05:23 +01:00
modmuss50
077fc48468 Work around shadowed fields from super classes not getting remapped... dejavu anyone?
See: 2e359e933a (diff-0956caa3cd38a54f5910979f0cfd98198a93e4d585e111300f2f7ab7301ad122)
2021-08-24 21:49:05 +01:00
Juuxel
8a9f12e01d
Add sleeping events (#1633)
* Add sleeping events

* Fix wake up event triggering on every wakeUp() call

* Make direction modifications stackable

* Simplify by not using Optional in MODIFY_SLEEPING_DIRECTION

* Add two new events

* Let's call it VERIFY_BED

* And it's ALLOW_BED now

* Add the rest of the events

* Clarify docs

* Expand docs, add missing vanillaResult

* WAKE_UP -> STOP_SLEEPING, javadoc

* Make sleepingPos checks more consistent in LivingEntityMixin
2021-08-24 17:44:12 +01:00
modmuss50
a02b4463f9 21w19a 2021-05-12 20:23:04 +01:00
Player
8d89ed54f2 Bump versions 2021-05-01 23:36:32 +02:00
modmuss50
92519afafe Version bump 2021-01-19 19:38:22 +00:00
modmuss50
05c818887e Bump version 2021-01-03 16:35:12 +00:00
modmuss50
ce504de521 Bump versions 2021-01-01 14:50:26 +00:00
i509VCB
1d561d2678 Entity Events v1 (#957)
* Entity Events v1.

First up is an event fired after a living entity is damaged. All vanilla living entities except armor stands work with this event.

* Events related to killing of entities, changing world, player respawn/copyFrom

Death related:
an entity killing something and an entity being killed by an adversary

Player related:
After respawn, copy to

* Adversary stuff isn't needed

* checkstyle again

* Call AFTER_KILLED_OTHER on a ServerPlayerEntity upon death.

* Add event which is fired when a player first joined a server and add functional interface annotations

* Update build.gradle

* mispelled

* Some renames, test events, drop damage event

Damage events need further consideration in future

* Comments and null check

* Update for mappings

* Warning comment

* Remove first join event and teleport helper

First join does not work atm and teleport is in dimensions pr

* Module dependencies

* Javadoc tweaks

* The serverening

(cherry picked from commit 79b23bee5b)
2020-12-30 17:10:56 +00:00