Skip to content

Commit

Permalink
fix drop pad re-appear when you switch to survival mode
Browse files Browse the repository at this point in the history
  • Loading branch information
MCTian-mi committed Oct 6, 2024
1 parent 7e709b4 commit db595d6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/supersymmetry/common/EventHandlers.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@ public class EventHandlers {
@SubscribeEvent
public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) {

if (event.player.isCreative()) return;

NBTTagCompound playerData = event.player.getEntityData();
NBTTagCompound data = playerData.hasKey(EntityPlayer.PERSISTED_NBT_TAG) ? playerData.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG) : new NBTTagCompound();

if(!event.player.getEntityWorld().isRemote && !data.getBoolean(FIRST_SPAWN)) {

data.setBoolean(FIRST_SPAWN, true);
if (event.player.isCreative()) return;
playerData.setTag(EntityPlayer.PERSISTED_NBT_TAG, data);

EntityDropPod dropPod = new EntityDropPod(event.player.getEntityWorld(), event.player.posX, event.player.posY + 256, event.player.posZ);
Expand Down

0 comments on commit db595d6

Please sign in to comment.