Skip to content

Commit

Permalink
trying to fix render bug(untested!!!)
Browse files Browse the repository at this point in the history
  • Loading branch information
LNatit committed Sep 7, 2021
1 parent a738a29 commit c68b813
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ apply plugin: 'org.spongepowered.mixin'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.0'
version = 'beta 0.1.4'
group = 'com.lnatit.hr10' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'hr10'

Expand Down Expand Up @@ -156,7 +156,7 @@ jar {
attributes([
"Specification-Title" : "hr10",
"Specification-Vendor" : "L_Natit",
"Specification-Version" : "beta 0.1.3",
"Specification-Version" : "beta 0.1.4",
"Implementation-Title" : project.name,
"Implementation-Version" : "${version}",
"Implementation-Vendor" : "L_Natit",
Expand Down
39 changes: 39 additions & 0 deletions src/main/java/lnatit/hr10/handler/PlayerDataSyncHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package lnatit.hr10.handler;

import lnatit.hr10.interfaces.IDuallableEntity;
import lnatit.hr10.network.NetworkReg;
import lnatit.hr10.network.SleepInfoPacket;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.world.server.ServerWorld;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

import java.util.List;

import static lnatit.hr10.hr10.MOD_ID;

@Mod.EventBusSubscriber(modid = MOD_ID)
public class PlayerDataSyncHandler
{
//TODO untested!!!
@SubscribeEvent
public static void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event)
{
PlayerEntity player = event.getPlayer();

if (player instanceof ServerPlayerEntity)
{
ServerWorld world = ((ServerPlayerEntity) player).getServerWorld();
List<ServerPlayerEntity> playerList = world.getPlayers();

for (ServerPlayerEntity serverPlayer : playerList)
{
NetworkReg.serverSendToPlayer(new SleepInfoPacket(((IDuallableEntity) serverPlayer).getSleepSide(),
serverPlayer.getEntityId()
), (ServerPlayerEntity) player);
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ modId="hr10" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
# see the associated build.gradle script for how to populate this completely automatically during a build
version="beta 0.1.3" #mandatory
version="beta 0.1.4" #mandatory
# A display name for the mod
displayName="hr10" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/
Expand Down

0 comments on commit c68b813

Please sign in to comment.