Skip to content

Commit

Permalink
chore: sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulvdberge committed Apr 4, 2024
1 parent a60e8e9 commit 04f0cb4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.stream.Collectors;

public class SecurityNetworkComponentImpl implements SecurityNetworkComponent {
protected final Set<SecurityDecisionProvider> providers = new LinkedHashSet<>();
private final Set<SecurityDecisionProvider> providers = new LinkedHashSet<>();
private final SecurityPolicy defaultPolicy;

public SecurityNetworkComponentImpl(final SecurityPolicy defaultPolicy) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@

public class PlatformSecurityNetworkComponentImpl extends SecurityNetworkComponentImpl
implements PlatformSecurityNetworkComponent {
private final SecurityPolicy defaultPolicy;

public PlatformSecurityNetworkComponentImpl(final SecurityPolicy defaultPolicy) {
super(defaultPolicy);
this.defaultPolicy = defaultPolicy;
}

@Override
public boolean isAllowed(final Permission permission, final ServerPlayer player) {
if (providers.isEmpty()) {
return defaultPolicy.isAllowed(permission);
}
final MinecraftServer server = player.getServer();
if (server == null) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;

// TODO: sonar fixes
public class NetworkNodeBlockItem extends BaseBlockItem {
public NetworkNodeBlockItem(final Block block) {
super(block);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public class BlockModelProviderImpl extends BlockModelProvider {
private static final ResourceLocation ALL_CUTOUT = createIdentifier("block/all_cutout");
private static final ResourceLocation NORTH_CUTOUT = createIdentifier("block/north_cutout");

private static final String NORTH = "north";
private static final String SOUTH = "south";

private static final ResourceLocation BOTTOM_TEXTURE = createIdentifier("block/bottom");

public BlockModelProviderImpl(final PackOutput output, final ExistingFileHelper existingFileHelper) {
Expand Down Expand Up @@ -90,9 +93,9 @@ private void registerGrids(final String name,
final ResourceLocation top = createIdentifier(BLOCK_PREFIX + "/" + name + "/top");
withExistingParent(BLOCK_PREFIX + "/" + name + "/" + variantName, baseModel)
.texture(PARTICLE_TEXTURE, right)
.texture("north", front)
.texture(NORTH, front)
.texture("east", right)
.texture("south", back)
.texture(SOUTH, back)
.texture("west", left)
.texture("up", top)
.texture("down", BOTTOM_TEXTURE)
Expand Down Expand Up @@ -185,9 +188,9 @@ private void registerSecurityManagers() {
);
withExistingParent("block/security_manager/" + color.getName(), EMISSIVE_CUTOUT)
.texture(PARTICLE_TEXTURE, back)
.texture("north", front)
.texture(NORTH, front)
.texture("east", right)
.texture("south", back)
.texture(SOUTH, back)
.texture("west", left)
.texture("up", top)
.texture("down", BOTTOM_TEXTURE)
Expand All @@ -205,9 +208,9 @@ private void registerSecurityManagers() {
final ResourceLocation cutoutTop = createIdentifier("block/security_manager/cutouts/top/inactive");
withExistingParent("block/security_manager/inactive", CUTOUT)
.texture(PARTICLE_TEXTURE, back)
.texture("north", front)
.texture(NORTH, front)
.texture("east", right)
.texture("south", back)
.texture(SOUTH, back)
.texture("west", left)
.texture("up", top)
.texture("down", BOTTOM_TEXTURE)
Expand Down

0 comments on commit 04f0cb4

Please sign in to comment.