mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 23:03:01 +00:00
The Great Reformat; moving to google-java-style w/ 4 space indent and 120 column line wrap
This commit is contained in:
1 parent
c632cc6af9
commit
e0b7ea62a4
933 files changed
+95734
-108818
No files matched your search
@@ -1,5 +1,7 @@
|
||||
package mekanism.common;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.network.PacketFlamethrowerData.FlamethrowerDataMessage;
|
||||
@@ -9,9 +11,6 @@ import mekanism.common.network.PacketScubaTankData;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class PlayerState {
|
||||
|
||||
private Set<String> activeJetpacks = new HashSet<>();
|
||||
@@ -36,7 +35,6 @@ public class PlayerState {
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
|
||||
// ----------------------
|
||||
//
|
||||
// Jetpack state tracking
|
||||
@@ -71,12 +69,6 @@ public class PlayerState {
|
||||
}
|
||||
}
|
||||
|
||||
public void setActiveJetpacks(Set<String> newActiveJetpacks) {
|
||||
for (String activeUser: newActiveJetpacks) {
|
||||
setJetpackState(activeUser, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isJetpackOn(EntityPlayer p) {
|
||||
return activeJetpacks.contains(p.getName());
|
||||
}
|
||||
@@ -85,6 +77,12 @@ public class PlayerState {
|
||||
return activeJetpacks;
|
||||
}
|
||||
|
||||
public void setActiveJetpacks(Set<String> newActiveJetpacks) {
|
||||
for (String activeUser : newActiveJetpacks) {
|
||||
setJetpackState(activeUser, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------
|
||||
//
|
||||
// Gasmask state tracking
|
||||
@@ -105,7 +103,8 @@ public class PlayerState {
|
||||
if (changed && world.isRemote) {
|
||||
// If the player is the "local" player, we need to tell the server the state has changed
|
||||
if (isLocal) {
|
||||
Mekanism.packetHandler.sendToServer(PacketScubaTankData.ScubaTankDataMessage.UPDATE(playerId, isActive));
|
||||
Mekanism.packetHandler
|
||||
.sendToServer(PacketScubaTankData.ScubaTankDataMessage.UPDATE(playerId, isActive));
|
||||
}
|
||||
|
||||
// Start a sound playing if the person is now using a gasmask
|
||||
@@ -115,12 +114,6 @@ public class PlayerState {
|
||||
}
|
||||
}
|
||||
|
||||
public void setActiveGasmasks(Set<String> newActiveGasmasks) {
|
||||
for (String activeUser: newActiveGasmasks) {
|
||||
setGasmaskState(activeUser, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isGasmaskOn(EntityPlayer p) {
|
||||
return activeGasmasks.contains(p.getName());
|
||||
}
|
||||
@@ -129,6 +122,12 @@ public class PlayerState {
|
||||
return activeGasmasks;
|
||||
}
|
||||
|
||||
public void setActiveGasmasks(Set<String> newActiveGasmasks) {
|
||||
for (String activeUser : newActiveGasmasks) {
|
||||
setGasmaskState(activeUser, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------
|
||||
//
|
||||
// Flamethrower state tracking
|
||||
@@ -150,7 +149,7 @@ public class PlayerState {
|
||||
// If the player is the "local" player, we need to tell the server the state has changed
|
||||
if (isLocal) {
|
||||
Mekanism.packetHandler.sendToServer(new FlamethrowerDataMessage(FlamethrowerPacket.UPDATE, null,
|
||||
playerId, isActive));
|
||||
playerId, isActive));
|
||||
}
|
||||
|
||||
// Start a sound playing if the person is now using a flamethrower
|
||||
|
||||
Reference in new issue
Block a user