Skip to content

Commit

Permalink
apply editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed Jul 28, 2024
1 parent b22c965 commit ceab1da
Show file tree
Hide file tree
Showing 14 changed files with 920 additions and 923 deletions.
2 changes: 1 addition & 1 deletion src/main/java/dev/hephaestus/glowcase/Glowcase.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import dev.hephaestus.glowcase.block.entity.MailboxBlockEntity;
import dev.hephaestus.glowcase.block.entity.TextBlockEntity;
import dev.hephaestus.glowcase.compat.PolydexCompatibility;
import dev.hephaestus.glowcase.networking.RegisterC2SNetworking;
import dev.hephaestus.glowcase.networking.NetworkPayloads;
import dev.hephaestus.glowcase.networking.RegisterC2SNetworking;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
import org.jetbrains.annotations.Nullable;

public class HyperlinkBlockEntity extends BlockEntity {
public static final int TITLE_MAX_LENGTH = 1024;
public static final int TITLE_MAX_LENGTH = 1024;
public static final int URL_MAX_LENGTH = 1024;
private String title = "";
private String url = "";

public HyperlinkBlockEntity(BlockPos pos, BlockState state) {
super(Glowcase.HYPERLINK_BLOCK_ENTITY.get(), pos, state);
}
public HyperlinkBlockEntity(BlockPos pos, BlockState state) {
super(Glowcase.HYPERLINK_BLOCK_ENTITY.get(), pos, state);
}

public String getText() {
return !title.isEmpty() ? title : url;
Expand All @@ -37,46 +37,48 @@ public void setTitle(String newTitle) {
dispatch();
}

public String getUrl() {
return url;
}
public String getUrl() {
return url;
}

public void setUrl(String newUrl) {
url = newUrl;
markDirty();
dispatch();
}
public void setUrl(String newUrl) {
url = newUrl;
markDirty();
dispatch();
}

@Override
public void writeNbt(NbtCompound tag, RegistryWrapper.WrapperLookup registryLookup) {
super.writeNbt(tag, registryLookup);
tag.putString("title", this.title);tag.putString("url", this.url);
}
@Override
public void writeNbt(NbtCompound tag, RegistryWrapper.WrapperLookup registryLookup) {
super.writeNbt(tag, registryLookup);
tag.putString("title", this.title);
tag.putString("url", this.url);
}

@Override
public void readNbt(NbtCompound tag, RegistryWrapper.WrapperLookup registryLookup) {
super.readNbt(tag, registryLookup);
this.title = tag.getString("title");this.url = tag.getString("url");
}
@Override
public void readNbt(NbtCompound tag, RegistryWrapper.WrapperLookup registryLookup) {
super.readNbt(tag, registryLookup);
this.title = tag.getString("title");
this.url = tag.getString("url");
}

public EditHyperlinkBlock createEditPacket() {
return new EditHyperlinkBlock(pos, url);
}
public EditHyperlinkBlock createEditPacket() {
return new EditHyperlinkBlock(pos, url);
}

// standard blockentity boilerplate
// standard blockentity boilerplate

public void dispatch() {
if (world instanceof ServerWorld sworld) sworld.getChunkManager().markForUpdate(pos);
}
public void dispatch() {
if (world instanceof ServerWorld sworld) sworld.getChunkManager().markForUpdate(pos);
}

@Override
public NbtCompound toInitialChunkDataNbt(RegistryWrapper.WrapperLookup registryLookup) {
return createNbt(registryLookup);
}
@Override
public NbtCompound toInitialChunkDataNbt(RegistryWrapper.WrapperLookup registryLookup) {
return createNbt(registryLookup);
}

@Nullable
@Override
public Packet<ClientPlayPacketListener> toUpdatePacket() {
return BlockEntityUpdateS2CPacket.create(this);
}
@Nullable
@Override
public Packet<ClientPlayPacketListener> toUpdatePacket() {
return BlockEntityUpdateS2CPacket.create(this);
}
}
Loading

0 comments on commit ceab1da

Please sign in to comment.