mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-17 08:05:25 +01:00
Renamed CustomBlock#getBlockStateId to CustomBlock#getDefaultBlockStateId
This commit is contained in:
parent
7b93881e59
commit
e2940c9aee
@ -37,7 +37,7 @@ public class PlayerBlockPlaceEvent extends CancellableEvent {
|
||||
* @param customBlock the custom block to place
|
||||
*/
|
||||
public void setCustomBlock(CustomBlock customBlock) {
|
||||
setBlockStateId(customBlock.getBlockStateId());
|
||||
setBlockStateId(customBlock.getDefaultBlockStateId());
|
||||
setCustomBlockId(customBlock.getCustomBlockId());
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ public class PlayerBlockPlaceEvent extends CancellableEvent {
|
||||
* @param customBlockId the custom block id to place
|
||||
*/
|
||||
public void setCustomBlock(short customBlockId) {
|
||||
CustomBlock customBlock = BLOCK_MANAGER.getCustomBlock(customBlockId);
|
||||
final CustomBlock customBlock = BLOCK_MANAGER.getCustomBlock(customBlockId);
|
||||
setCustomBlock(customBlock);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ public class PlayerBlockPlaceEvent extends CancellableEvent {
|
||||
* @param customBlockId the custom block id to place
|
||||
*/
|
||||
public void setCustomBlock(String customBlockId) {
|
||||
CustomBlock customBlock = BLOCK_MANAGER.getCustomBlock(customBlockId);
|
||||
final CustomBlock customBlock = BLOCK_MANAGER.getCustomBlock(customBlockId);
|
||||
setCustomBlock(customBlock);
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ public class InstanceContainer extends Instance {
|
||||
@Override
|
||||
public void setCustomBlock(int x, int y, int z, short customBlockId, Data data) {
|
||||
final CustomBlock customBlock = BLOCK_MANAGER.getCustomBlock(customBlockId);
|
||||
setBlock(x, y, z, customBlock.getBlockStateId(), customBlock, data);
|
||||
setBlock(x, y, z, customBlock.getDefaultBlockStateId(), customBlock, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,7 @@ public class BlockBatch implements InstanceBatch {
|
||||
public void setCustomBlock(int x, int y, int z, short customBlockId, Data data) {
|
||||
final Chunk chunk = this.instance.getChunkAt(x, z);
|
||||
final CustomBlock customBlock = BLOCK_MANAGER.getCustomBlock(customBlockId);
|
||||
addBlockData(chunk, x, y, z, true, customBlock.getBlockStateId(), customBlockId, data);
|
||||
addBlockData(chunk, x, y, z, true, customBlock.getDefaultBlockStateId(), customBlockId, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -9,7 +9,6 @@ import net.minestom.server.instance.block.CustomBlock;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@ -38,8 +37,8 @@ public class ChunkBatch implements InstanceBatch {
|
||||
|
||||
@Override
|
||||
public void setCustomBlock(int x, int y, int z, short customBlockId, Data data) {
|
||||
CustomBlock customBlock = BLOCK_MANAGER.getCustomBlock(customBlockId);
|
||||
addBlockData((byte) x, y, (byte) z, true, customBlock.getBlockStateId(), customBlockId, data);
|
||||
final CustomBlock customBlock = BLOCK_MANAGER.getCustomBlock(customBlockId);
|
||||
addBlockData((byte) x, y, (byte) z, true, customBlock.getDefaultBlockStateId(), customBlockId, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,15 +44,15 @@ public abstract class CustomBlock {
|
||||
return firstBreaker.getEntityId() + 1;
|
||||
}
|
||||
|
||||
private final short blockStateId;
|
||||
private final short defaultBlockStateId;
|
||||
private final String identifier;
|
||||
|
||||
/**
|
||||
* @param blockStateId the block state id
|
||||
* @param identifier the custom block identifier
|
||||
* @param defaultBlockStateId the default block state id
|
||||
* @param identifier the custom block identifier
|
||||
*/
|
||||
public CustomBlock(short blockStateId, String identifier) {
|
||||
this.blockStateId = blockStateId;
|
||||
public CustomBlock(short defaultBlockStateId, String identifier) {
|
||||
this.defaultBlockStateId = defaultBlockStateId;
|
||||
this.identifier = identifier;
|
||||
}
|
||||
|
||||
@ -194,8 +194,8 @@ public abstract class CustomBlock {
|
||||
*
|
||||
* @return the default visual block id
|
||||
*/
|
||||
public short getBlockStateId() {
|
||||
return blockStateId;
|
||||
public short getDefaultBlockStateId() {
|
||||
return defaultBlockStateId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -55,11 +55,11 @@ public class PlayerDiggingListener {
|
||||
addEffect(player);
|
||||
}
|
||||
|
||||
sendAcknowledgePacket(player, blockPosition, customBlock.getBlockStateId(),
|
||||
sendAcknowledgePacket(player, blockPosition, customBlock.getDefaultBlockStateId(),
|
||||
ClientPlayerDiggingPacket.Status.STARTED_DIGGING, true);
|
||||
} else {
|
||||
// Unsuccessful digging
|
||||
sendAcknowledgePacket(player, blockPosition, customBlock.getBlockStateId(),
|
||||
sendAcknowledgePacket(player, blockPosition, customBlock.getDefaultBlockStateId(),
|
||||
ClientPlayerDiggingPacket.Status.STARTED_DIGGING, false);
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user