forked from virt-mirrors/Sit
Merge branch '1.20-1.20.1' into dev
# Conflicts: # src/main/java/one/oth3r/sit/PacketBuilder.java # src/main/java/one/oth3r/sit/Sit.java
This commit is contained in:
commit
715585f693
5 changed files with 16 additions and 16 deletions
|
@ -4,16 +4,16 @@ org.gradle.parallel=true
|
|||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
minecraft_version=1.20.2
|
||||
yarn_mappings=1.20.2+build.1
|
||||
loader_version=0.14.22
|
||||
minecraft_version=1.20.1
|
||||
yarn_mappings=1.20.1+build.10
|
||||
loader_version=0.14.24
|
||||
|
||||
# Mod Properties
|
||||
mod_version=1.1.0+1.20.2
|
||||
mod_version=1.1.0+1.20-1.20.1
|
||||
maven_group=one.oth3r
|
||||
archives_base_name=sit!
|
||||
|
||||
# Dependencies
|
||||
fabric_version=0.89.0+1.20.2
|
||||
modmenu_version=8.0.0
|
||||
yacl_version=3.2.1+1.20.2
|
||||
fabric_version=0.91.0+1.20.1
|
||||
modmenu_version=7.0.0
|
||||
yacl_version=3.2.1+1.20
|
||||
|
|
|
@ -159,12 +159,10 @@ public class Events {
|
|||
}
|
||||
}
|
||||
}
|
||||
//1.20.2 mounting pos change (shifts everything down by .25)
|
||||
double oneTwentyTwo = .25;
|
||||
entity.updatePositionAndAngles(entity.getX(),entity.getY()+oneTwentyTwo,entity.getZ(),0,0);
|
||||
entity.updatePositionAndAngles(entity.getX(),entity.getY(),entity.getZ(),0,0);
|
||||
entity.setBoundingBox(Box.of(Vec3d.of(pos),1.5,hitBoxY,1.5));
|
||||
//change pitch based on if player is sitting below block height or not
|
||||
if (entity.getY() <= pos.getY()+.35+oneTwentyTwo) entity.setPitch(90); // below
|
||||
if (entity.getY() <= pos.getY()+.35) entity.setPitch(90); // below
|
||||
else entity.setPitch(-90); // above
|
||||
}
|
||||
public static void register() {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package one.oth3r.sit;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.fabricmc.fabric.api.networking.v1.PacketByteBufs;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
@ -11,11 +12,11 @@ import java.nio.charset.StandardCharsets;
|
|||
public class PacketBuilder {
|
||||
public static final String SETTINGS = "settings_v1.0";
|
||||
private final String message;
|
||||
private PacketByteBuf packetByteBuf = PacketByteBufs.create();
|
||||
public PacketBuilder(PacketByteBuf buf) {
|
||||
private final PacketByteBuf packetByteBuf = PacketByteBufs.create();
|
||||
public PacketBuilder(ByteBuf buf) {
|
||||
// Read any data sent in the packet
|
||||
message = buf.toString(StandardCharsets.UTF_8);
|
||||
packetByteBuf = buf;
|
||||
packetByteBuf.writeBytes(buf);
|
||||
}
|
||||
public PacketBuilder(String message) {
|
||||
this.message = message;
|
||||
|
|
|
@ -41,7 +41,8 @@ public class Sit implements ModInitializer {
|
|||
//PACKETS
|
||||
ServerPlayNetworking.registerGlobalReceiver(PacketBuilder.getIdentifier(),
|
||||
(server, player, handler, buf, responseSender) -> {
|
||||
PacketBuilder packet = new PacketBuilder(buf);
|
||||
// copy to not throw errors
|
||||
PacketBuilder packet = new PacketBuilder(buf.copy());
|
||||
server.execute(() -> {
|
||||
Type hashMapToken = new TypeToken<HashMap<String, Object>>() {}.getType();
|
||||
Gson gson = new GsonBuilder().disableHtmlEscaping().create();
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
},
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.21",
|
||||
"minecraft": "=1.20.2",
|
||||
"minecraft": ">=1.20 <=1.20.1",
|
||||
"java": ">=17",
|
||||
"fabric-api": "*"
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue