Skip to content

Commit fcfafab

Browse files
committed
update cotton, fix some sync issues with the thief
1 parent c384124 commit fcfafab

File tree

6 files changed

+28
-20
lines changed

6 files changed

+28
-20
lines changed

build.gradle

+8-14
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ if(rootProject.file("private.gradle").exists()) { //Publishing details
3434

3535
archivesBaseName = "skillcheck"
3636
group = "io.github.cottonmc"
37-
version = "1.0.9+1.14.2"
37+
version = "1.1.0+1.14.2"
3838

3939
minecraft {
4040
refmapName = "mixins.skillcheck.refmap.json"
4141
}
4242

4343
repositories {
4444
maven {
45-
url "http://server.bbkr.space:8081/artifactory/libs-snapshot"
45+
url "http://server.bbkr.space:8081/artifactory/libs-release"
4646
}
4747
maven {
4848
url "https://minecraft.curseforge.com/api/maven"
@@ -53,24 +53,18 @@ dependencies {
5353
minecraft "com.mojang:minecraft:1.14.2"
5454
mappings "net.fabricmc:yarn:1.14.2+build.2"
5555
modCompile "net.fabricmc:fabric-loader:0.4.8+build.154"
56-
modCompile "net.fabricmc.fabric-api:fabric-api:0.3.0+build.170"
56+
modCompile "net.fabricmc.fabric-api:fabric-api:0.3.0+build.185"
5757

58-
modCompile "io.github.prospector.modmenu:ModMenu:1.5.3-84"
59-
modCompile "io.github.cottonmc:cotton:0.6.7+1.14.1-SNAPSHOT"
60-
include "io.github.cottonmc:cotton:0.6.7+1.14.1-SNAPSHOT"
58+
modCompile "io.github.prospector.modmenu:ModMenu:1.6.2-92"
59+
modCompile "io.github.cottonmc:cotton:0.8.2+1.14.2"
60+
include "io.github.cottonmc:cotton:0.8.2+1.14.2"
6161
modCompile "crochet:Crochet:1.0.4"
6262
include "crochet:Crochet:1.0.4"
6363
modCompile "cloth-config:ClothConfig:0.2.1.14"
6464
include "cloth-config:ClothConfig:0.2.1.14"
6565

66-
include "net.fabricmc.fabric-api:fabric-api-base:0.1.0+"
67-
include "net.fabricmc.fabric-api:fabric-commands-v0:0.1.1+"
68-
include "net.fabricmc.fabric-api:fabric-containers-v0:0.1.2+"
69-
include "net.fabricmc.fabric-api:fabric-events-interaction-v0:0.1.0+"
70-
include "net.fabricmc.fabric-api:fabric-item-groups-v0:0.1.0+"
71-
include "net.fabricmc.fabric-api:fabric-networking-v0:0.1.1+"
72-
include "net.fabricmc.fabric-api:fabric-resource-loader-v0:0.1.1+"
73-
include "net.fabricmc.fabric-api:fabric-tag-extensions-v0:0.1.0+"
66+
implementation "blue.endless:jankson:1.1.2"
67+
compileOnly ("com.google.code.findbugs:jsr305:3.0.2") { transitive = false }
7468
}
7569

7670
processResources {

src/main/java/io/github/cottonmc/skillcheck/api/traits/ClassManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package io.github.cottonmc.skillcheck.api.traits;
22

33
import com.raphydaphy.crochet.data.PlayerData;
4-
import io.github.cottonmc.repackage.blue.endless.jankson.annotation.Nullable;
54
import io.github.cottonmc.skillcheck.SkillCheck;
65
import net.minecraft.entity.player.PlayerEntity;
76
import net.minecraft.nbt.CompoundTag;
87
import net.minecraft.util.Identifier;
98

9+
import javax.annotation.Nullable;
1010
import java.util.HashMap;
1111
import java.util.Map;
1212
import java.util.Set;

src/main/java/io/github/cottonmc/skillcheck/mixins/MixinThiefClient.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.mojang.authlib.GameProfile;
44
import io.github.cottonmc.skillcheck.SkillCheck;
55
import io.github.cottonmc.skillcheck.api.traits.ClassManager;
6+
import io.github.cottonmc.skillcheck.util.SkillCheckNetworking;
67
import net.minecraft.block.BlockRenderType;
78
import net.minecraft.block.BlockState;
89
import net.minecraft.block.FluidBlock;
@@ -110,7 +111,7 @@ private void handleWallJump() {
110111

111112
this.setPosition(clingX, this.getPos().getY(), clingZ);
112113
Vec3d previousVelocity = this.getVelocity();
113-
this.fallDistance = 0.0F;
114+
SkillCheckNetworking.clearFall();
114115
double velY = previousVelocity.y;
115116

116117
if (previousVelocity.y < -0.5) {
@@ -260,6 +261,7 @@ private static void wallJump(PlayerEntity player, float up, float strafe, float
260261
StatusEffectInstance jumpBoostEffect = player.getStatusEffect(StatusEffects.JUMP_BOOST);
261262
if (jumpBoostEffect != null) jumpBoostLevel = jumpBoostEffect.getAmplifier() + 1;
262263

264+
SkillCheckNetworking.clearFall();
263265
player.setVelocity(player.getVelocity().x + (strafe * f2 - forward * f1), up + (jumpBoostLevel * .075), player.getVelocity().z + (forward * f2 + strafe * f1));
264266

265267
}
@@ -302,7 +304,7 @@ private void handleDoubleJump() {
302304
this.jump();
303305
jumpCount++;
304306

305-
this.fallDistance = 0.0F;
307+
SkillCheckNetworking.clearFall();
306308

307309
}
308310

src/main/java/io/github/cottonmc/skillcheck/mixins/MixinThiefCommon.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.github.cottonmc.skillcheck.mixins;
22

3-
import io.github.cottonmc.repackage.blue.endless.jankson.annotation.Nullable;
43
import io.github.cottonmc.skillcheck.SkillCheck;
54
import io.github.cottonmc.skillcheck.util.ArrowEffects;
65
import io.github.cottonmc.skillcheck.api.traits.ClassManager;
@@ -26,6 +25,8 @@
2625
import org.spongepowered.asm.mixin.injection.Inject;
2726
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
2827

28+
import javax.annotation.Nullable;
29+
2930
@Mixin(PlayerEntity.class)
3031
public abstract class MixinThiefCommon extends LivingEntity {
3132

src/main/java/io/github/cottonmc/skillcheck/util/SkillCheckConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.cottonmc.skillcheck.util;
22

33
import io.github.cottonmc.cotton.config.annotations.ConfigFile;
4-
import io.github.cottonmc.repackage.blue.endless.jankson.Comment;
4+
import blue.endless.jankson.Comment;
55

66
@ConfigFile(name = "SkillCheck")
77
public class SkillCheckConfig {

src/main/java/io/github/cottonmc/skillcheck/util/SkillCheckNetworking.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
import io.github.cottonmc.skillcheck.container.CharacterSheetContainer;
66
import io.netty.buffer.Unpooled;
77
import net.fabricmc.api.EnvType;
8-
import net.fabricmc.api.Environment;
98
import net.fabricmc.fabric.api.network.ClientSidePacketRegistry;
109
import net.fabricmc.fabric.api.network.ServerSidePacketRegistry;
1110
import net.fabricmc.loader.api.FabricLoader;
1211
import net.minecraft.client.MinecraftClient;
1312
import net.minecraft.client.network.packet.CustomPayloadS2CPacket;
1413
import net.minecraft.container.Container;
14+
import net.minecraft.entity.player.PlayerEntity;
1515
import net.minecraft.server.network.ServerPlayerEntity;
1616
import net.minecraft.server.network.packet.CustomPayloadC2SPacket;
1717
import net.minecraft.util.Identifier;
@@ -23,6 +23,8 @@ public class SkillCheckNetworking {
2323
public static final Identifier SYNC_LEVELUP = new Identifier(SkillCheck.MOD_ID, "sync_levelup");
2424
public static final Identifier SYNC_PLAYER_LEVEL = new Identifier(SkillCheck.MOD_ID, "sync_player_level");
2525

26+
public static final Identifier CLEAR_FALL = new Identifier(SkillCheck.MOD_ID, "clear_fall");
27+
2628
public static void init() {
2729
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) initClient();
2830
initServer();
@@ -53,6 +55,10 @@ public static void initServer() {
5355
ClassManager.levelUp(packetContext.getPlayer(), id);
5456
}
5557
});
58+
ServerSidePacketRegistry.INSTANCE.register(CLEAR_FALL, ((packetContext, packetByteBuf) -> {
59+
PlayerEntity player = packetContext.getPlayer();
60+
player.fallDistance = 0;
61+
}));
5662
}
5763

5864

@@ -74,4 +80,9 @@ public static void syncLevelup(Identifier id, int xpCost) {
7480
buf.writeInt(xpCost);
7581
MinecraftClient.getInstance().getNetworkHandler().getClientConnection().send(new CustomPayloadC2SPacket(SYNC_LEVELUP, buf));
7682
}
83+
84+
public static void clearFall() {
85+
PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
86+
MinecraftClient.getInstance().getNetworkHandler().getClientConnection().send(new CustomPayloadC2SPacket(CLEAR_FALL, buf));
87+
}
7788
}

0 commit comments

Comments
 (0)