de.pewpewproject.lasertag.block.entity.LasertagCreditsButtonBlockEntity   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 8
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A openScreen(PlayerEntity) 0 3 2
A LasertagCreditsButtonBlockEntity(BlockPos,BlockState) 0 2 1
1
package de.pewpewproject.lasertag.block.entity;
2
3
import de.pewpewproject.lasertag.entity.Entities;
4
import net.minecraft.block.BlockState;
5
import net.minecraft.block.entity.BlockEntity;
6
import net.minecraft.entity.player.PlayerEntity;
7
import net.minecraft.util.math.BlockPos;
8
9
/**
10
 * Block entity for the lasertag credits block
11
 *
12
 * @author Étienne Muser
13
 */
14
public class LasertagCreditsButtonBlockEntity extends BlockEntity {
15
    public LasertagCreditsButtonBlockEntity(BlockPos pos, BlockState state) {
16
        super(Entities.LASERTAG_CREDITS_BLOCK_ENTITY, pos, state);
17
    }
18
19
    public void openScreen(PlayerEntity player) {
20
        if (player.getEntityWorld().isClient) {
21
            player.openLasertagCreditsScreen(player);
22
        }
23
    }
24
}
25