Skip to content

Commit

Permalink
spotlessApply
Browse files Browse the repository at this point in the history
  • Loading branch information
Pilzinsel64 committed Dec 31, 2023
1 parent 1e7eeb5 commit a1bb0a0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/main/java/codechicken/chunkloader/BlockChunkLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p

if (!world.isRemote) {
TileChunkLoader tile = (TileChunkLoader) world.getTileEntity(x, y, z);
if (tile.owner == null || (ChunkLoaderManager.userInteract() && tile.owner.equals(player.getCommandSenderName()))
if (tile.owner == null
|| (ChunkLoaderManager.userInteract() && tile.owner.equals(player.getCommandSenderName()))
|| ChunkLoaderManager.opInteract() && ServerUtils.isPlayerOP(player.getCommandSenderName())) {
PacketCustom packet = new PacketCustom(ChunkLoaderSPH.channel, 12);
packet.writeCoord(x, y, z);
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/codechicken/chunkloader/ChunkLoaderManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@

import org.apache.logging.log4j.LogManager;

import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.ListMultimap;

import codechicken.core.CommonUtils;
import codechicken.core.ServerUtils;
import codechicken.lib.config.ConfigFile;
import codechicken.lib.config.ConfigTag;
import codechicken.lib.vec.BlockCoord;

import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.ListMultimap;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/codechicken/chunkloader/GuiChunkLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void initGui() {

ownerText = new GuiTextField(fontRendererObj, width / 2 - 80, height / 2 - 7, 80, 18);
ownerText.setText(tile.getOwner());

updateNames();

super.initGui();
Expand All @@ -63,8 +63,7 @@ public void drawScreen(int i, int j, float f) {
drawDefaultBackground();
drawContainerBackground();

if (enableOwner())
ownerText.drawTextBox();
if (enableOwner()) ownerText.drawTextBox();

super.drawScreen(i, j, f);// buttons

Expand Down Expand Up @@ -114,8 +113,7 @@ protected void actionPerformed(GuiButton guibutton) {
if (guibutton.id == 3) tile.renderInfo.showLasers = !tile.renderInfo.showLasers;
if (guibutton.id == 4)
ChunkLoaderCPH.sendShapeChange(tile, button == 1 ? tile.shape.prev() : tile.shape.next(), tile.radius);
if (guibutton.id == 5)
ChunkLoaderCPH.sendOwnerChange(tile, ownerText.getText());
if (guibutton.id == 5) ChunkLoaderCPH.sendOwnerChange(tile, ownerText.getText());
}

private void drawContainerBackground() {
Expand All @@ -128,7 +126,8 @@ private void drawContainerBackground() {
}

private boolean enableOwner() {
return ChunkLoaderManager.allowOwnerChange() && (!ChunkLoaderManager.userInteract() || (ChunkLoaderManager.opInteract() && ServerUtils.isPlayerOP(this.tile.owner)));
return ChunkLoaderManager.allowOwnerChange() && (!ChunkLoaderManager.userInteract()
|| (ChunkLoaderManager.opInteract() && ServerUtils.isPlayerOP(this.tile.owner)));
}

public boolean doesGuiPauseGame() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/codechicken/chunkloader/TileChunkLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraft.world.chunk.storage.ChunkLoader;

import codechicken.lib.packet.PacketCustom;

public class TileChunkLoader extends TileChunkLoaderBase {
Expand All @@ -35,7 +35,7 @@ public boolean setOwner(String newOwner) {
owner = newOwner;
return true;
}

// Disable for the old owner, then set the new owner and enable again.
deactivate();
owner = newOwner;
Expand Down

0 comments on commit a1bb0a0

Please sign in to comment.