2021-03-22 23:06:40 +01:00
/ *
* This file is part of ViaVersion - https : //github.com/ViaVersion/ViaVersion
* Copyright ( C ) 2016 - 2021 ViaVersion and contributors
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
* /
2021-04-26 20:52:34 +02:00
package com.viaversion.viaversion.protocols.protocol1_9to1_8.storage ;
2016-03-12 00:07:13 +01:00
2016-03-26 15:17:00 +01:00
import com.google.common.cache.CacheBuilder ;
2016-05-10 11:26:49 +02:00
import com.google.common.collect.Sets ;
2021-04-26 20:52:34 +02:00
import com.viaversion.viaversion.api.Via ;
2021-04-28 11:10:16 +02:00
import com.viaversion.viaversion.api.legacy.bossbar.BossBar ;
import com.viaversion.viaversion.api.legacy.bossbar.BossColor ;
import com.viaversion.viaversion.api.legacy.bossbar.BossStyle ;
2021-04-26 21:35:29 +02:00
import com.viaversion.viaversion.api.connection.UserConnection ;
2021-04-26 20:52:34 +02:00
import com.viaversion.viaversion.api.minecraft.Position ;
2021-04-27 13:41:39 +02:00
import com.viaversion.viaversion.api.minecraft.entities.Entity1_10Types.EntityType ;
2021-04-26 20:52:34 +02:00
import com.viaversion.viaversion.api.minecraft.item.Item ;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata ;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_9 ;
2021-04-27 13:41:39 +02:00
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper ;
2021-04-26 20:52:34 +02:00
import com.viaversion.viaversion.api.type.Type ;
import com.viaversion.viaversion.api.type.types.version.Types1_9 ;
2021-04-27 13:41:39 +02:00
import com.viaversion.viaversion.data.EntityTracker ;
2021-04-26 20:52:34 +02:00
import com.viaversion.viaversion.protocols.protocol1_9to1_8.Protocol1_9To1_8 ;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.chat.GameMode ;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.metadata.MetadataRewriter1_9To1_8 ;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.BossBarProvider ;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.EntityIdProvider ;
2016-03-12 00:07:13 +01:00
2020-04-13 20:58:24 +02:00
import java.util.ArrayList ;
import java.util.Collections ;
import java.util.List ;
import java.util.Map ;
import java.util.Set ;
import java.util.UUID ;
2016-05-10 11:26:49 +02:00
import java.util.concurrent.ConcurrentHashMap ;
2016-03-26 15:17:00 +01:00
import java.util.concurrent.TimeUnit ;
2016-03-12 00:07:13 +01:00
2019-09-27 20:25:18 +02:00
public class EntityTracker1_9 extends EntityTracker {
2016-05-10 11:26:49 +02:00
private final Map < Integer , UUID > uuidMap = new ConcurrentHashMap < > ( ) ;
2016-05-27 02:00:01 +02:00
private final Map < Integer , List < Metadata > > metadataBuffer = new ConcurrentHashMap < > ( ) ;
2016-05-10 11:26:49 +02:00
private final Map < Integer , Integer > vehicleMap = new ConcurrentHashMap < > ( ) ;
private final Map < Integer , BossBar > bossBarMap = new ConcurrentHashMap < > ( ) ;
private final Set < Integer > validBlocking = Sets . newConcurrentHashSet ( ) ;
private final Set < Integer > knownHolograms = Sets . newConcurrentHashSet ( ) ;
2019-11-22 19:13:02 +01:00
private final Set < Position > blockInteractions = Collections . newSetFromMap ( CacheBuilder . newBuilder ( )
2021-04-16 08:45:33 +02:00
. maximumSize ( 1000 )
2019-11-22 19:13:02 +01:00
. expireAfterAccess ( 250 , TimeUnit . MILLISECONDS )
. < Position , Boolean > build ( )
. asMap ( ) ) ;
2016-03-16 22:52:00 +01:00
private boolean blocking = false ;
2016-03-17 00:34:03 +01:00
private boolean autoTeam = false ;
2016-04-13 17:54:18 +02:00
private Position currentlyDigging = null ;
2016-03-17 00:34:03 +01:00
private boolean teamExists = false ;
2016-05-08 20:49:13 +02:00
private GameMode gameMode ;
2019-01-07 17:06:23 +01:00
private String currentTeam ;
2021-04-05 18:53:57 +02:00
private int heldItemSlot ;
private Item itemInSecondHand = null ;
2016-03-12 00:07:13 +01:00
2019-05-08 12:14:41 +02:00
public EntityTracker1_9 ( UserConnection user ) {
super ( user , EntityType . PLAYER ) ;
2016-03-16 22:52:00 +01:00
}
2016-03-12 00:07:13 +01:00
public UUID getEntityUUID ( int id ) {
2018-09-30 20:48:23 +02:00
UUID uuid = uuidMap . get ( id ) ;
if ( uuid = = null ) {
uuid = UUID . randomUUID ( ) ;
2016-03-12 00:07:13 +01:00
uuidMap . put ( id , uuid ) ;
}
2018-09-30 20:48:23 +02:00
return uuid ;
2016-03-12 00:07:13 +01:00
}
2016-03-13 18:01:36 +01:00
2016-03-17 00:34:03 +01:00
public void setSecondHand ( Item item ) {
2019-05-08 12:14:41 +02:00
setSecondHand ( getClientEntityId ( ) , item ) ;
2016-03-26 14:07:06 +01:00
}
public void setSecondHand ( int entityID , Item item ) {
2021-04-26 22:54:43 +02:00
PacketWrapper wrapper = PacketWrapper . create ( 0x3C , null , getUser ( ) ) ;
2016-03-16 22:52:00 +01:00
wrapper . write ( Type . VAR_INT , entityID ) ;
wrapper . write ( Type . VAR_INT , 1 ) ; // slot
2021-04-05 18:53:57 +02:00
wrapper . write ( Type . ITEM , this . itemInSecondHand = item ) ;
2016-03-16 22:52:00 +01:00
try {
2019-04-23 16:34:17 +02:00
wrapper . send ( Protocol1_9To1_8 . class ) ;
2016-03-16 22:52:00 +01:00
} catch ( Exception e ) {
e . printStackTrace ( ) ;
}
}
2021-04-05 18:53:57 +02:00
public Item getItemInSecondHand ( ) {
return itemInSecondHand ;
}
/ * *
* It will set a shield to the offhand if a sword is in the main hand .
* The item in the offhand will be cleared if there is no sword in the main hand .
* /
public void syncShieldWithSword ( ) {
2021-04-12 16:56:53 +02:00
boolean swordInHand = hasSwordInHand ( ) ;
// Update if there is no sword in the main hand or if the player has no shield in the second hand but a sword in the main hand
if ( ! swordInHand | | this . itemInSecondHand = = null ) {
// Update shield in off hand depending if a sword is in the main hand
setSecondHand ( swordInHand ? new Item ( 442 , ( byte ) 1 , ( short ) 0 , null ) : null ) ;
}
}
/ * *
* Returns true if the item in the held inventory slot is a sword .
2021-04-27 13:41:39 +02:00
*
2021-04-12 16:56:53 +02:00
* @return player has a sword in the main hand
* /
public boolean hasSwordInHand ( ) {
2021-04-05 18:53:57 +02:00
InventoryTracker inventoryTracker = getUser ( ) . get ( InventoryTracker . class ) ;
// Get item in new selected slot
int inventorySlot = this . heldItemSlot + 36 ; // Hotbar slot index to inventory slot
int itemIdentifier = inventoryTracker . getItemId ( ( short ) 0 , ( short ) inventorySlot ) ;
2021-04-12 16:56:53 +02:00
return Protocol1_9To1_8 . isSword ( itemIdentifier ) ;
2021-04-05 18:53:57 +02:00
}
2019-05-08 12:14:41 +02:00
@Override
public void removeEntity ( int entityId ) {
super . removeEntity ( entityId ) ;
vehicleMap . remove ( entityId ) ;
uuidMap . remove ( entityId ) ;
validBlocking . remove ( entityId ) ;
knownHolograms . remove ( entityId ) ;
metadataBuffer . remove ( entityId ) ;
2016-03-14 17:51:56 +01:00
2019-05-08 12:14:41 +02:00
BossBar bar = bossBarMap . remove ( entityId ) ;
2016-03-14 17:51:56 +01:00
if ( bar ! = null ) {
bar . hide ( ) ;
2017-02-03 17:24:14 +01:00
// Send to provider
Via . getManager ( ) . getProviders ( ) . get ( BossBarProvider . class ) . handleRemove ( getUser ( ) , bar . getId ( ) ) ;
2016-03-14 17:51:56 +01:00
}
2016-03-13 18:01:36 +01:00
}
2016-03-16 22:52:00 +01:00
2016-03-26 15:17:00 +01:00
public boolean interactedBlockRecently ( int x , int y , int z ) {
2020-04-13 20:58:24 +02:00
return blockInteractions . contains ( new Position ( x , ( short ) y , z ) ) ;
2016-03-26 15:17:00 +01:00
}
public void addBlockInteraction ( Position p ) {
2019-11-22 19:13:02 +01:00
blockInteractions . add ( p ) ;
2016-03-26 15:17:00 +01:00
}
2019-05-08 12:14:41 +02:00
public void handleMetadata ( int entityId , List < Metadata > metadataList ) {
2021-04-26 21:16:10 +02:00
com . viaversion . viaversion . api . minecraft . entities . EntityType type = getEntity ( entityId ) ;
2018-09-30 20:48:23 +02:00
if ( type = = null ) {
2016-05-27 02:00:01 +02:00
return ;
}
2016-03-16 22:52:00 +01:00
for ( Metadata metadata : new ArrayList < > ( metadataList ) ) {
// Fix: wither (crash fix)
2019-05-09 14:43:48 +02:00
if ( type = = EntityType . WITHER ) {
2016-03-16 22:52:00 +01:00
if ( metadata . getId ( ) = = 10 ) {
metadataList . remove ( metadata ) ;
//metadataList.add(new Metadata(10, NewType.Byte.getTypeID(), Type.BYTE, 0));
}
}
// Fix: enderdragon (crash fix)
2019-05-09 14:43:48 +02:00
if ( type = = EntityType . ENDER_DRAGON ) {
2016-03-16 22:52:00 +01:00
if ( metadata . getId ( ) = = 11 ) {
metadataList . remove ( metadata ) ;
2016-03-17 00:34:03 +01:00
// metadataList.add(new Metadata(11, NewType.Byte.getTypeID(), Type.VAR_INT, 0));
2016-03-16 22:52:00 +01:00
}
}
2019-05-09 14:43:48 +02:00
if ( type = = EntityType . SKELETON ) {
2016-04-12 12:18:58 +02:00
if ( ( getMetaByIndex ( metadataList , 12 ) ) = = null ) {
2016-09-26 14:36:10 +02:00
metadataList . add ( new Metadata ( 12 , MetaType1_9 . Boolean , true ) ) ;
2016-04-12 12:18:58 +02:00
}
}
2016-06-08 12:29:08 +02:00
//ECHOPET Patch
2019-05-09 14:43:48 +02:00
if ( type = = EntityType . HORSE ) {
2016-06-08 12:29:08 +02:00
// Wrong metadata value from EchoPet, patch since it's discontinued. (https://github.com/DSH105/EchoPet/blob/06947a8b08ce40be9a518c2982af494b3b99d140/modules/API/src/main/java/com/dsh105/echopet/compat/api/entity/HorseArmour.java#L22)
if ( metadata . getId ( ) = = 16 & & ( int ) metadata . getValue ( ) = = Integer . MIN_VALUE )
metadata . setValue ( 0 ) ;
}
2019-05-09 14:43:48 +02:00
if ( type = = EntityType . PLAYER ) {
2016-03-16 22:52:00 +01:00
if ( metadata . getId ( ) = = 0 ) {
// Byte
byte data = ( byte ) metadata . getValue ( ) ;
2019-05-08 12:14:41 +02:00
if ( entityId ! = getProvidedEntityId ( ) & & Via . getConfig ( ) . isShieldBlocking ( ) ) {
2016-03-16 22:52:00 +01:00
if ( ( data & 0x10 ) = = 0x10 ) {
2019-05-08 12:14:41 +02:00
if ( validBlocking . contains ( entityId ) ) {
2019-11-24 21:55:46 +01:00
Item shield = new Item ( 442 , ( byte ) 1 , ( short ) 0 , null ) ;
2019-05-08 12:14:41 +02:00
setSecondHand ( entityId , shield ) ;
2017-06-01 18:23:16 +02:00
} else {
2019-05-08 12:14:41 +02:00
setSecondHand ( entityId , null ) ;
2016-03-16 22:52:00 +01:00
}
} else {
2019-05-08 12:14:41 +02:00
setSecondHand ( entityId , null ) ;
2016-03-16 22:52:00 +01:00
}
}
}
2019-03-05 23:47:44 +01:00
if ( metadata . getId ( ) = = 12 & & Via . getConfig ( ) . isLeftHandedHandling ( ) ) { // Player model
metadataList . add ( new Metadata (
13 , // Main hand
MetaType1_9 . Byte ,
( byte ) ( ( ( ( ( byte ) metadata . getValue ( ) ) & 0x80 ) ! = 0 ) ? 0 : 1 )
) ) ;
}
2016-03-16 22:52:00 +01:00
}
2019-05-09 14:43:48 +02:00
if ( type = = EntityType . ARMOR_STAND & & Via . getConfig ( ) . isHologramPatch ( ) ) {
2016-04-04 16:55:48 +02:00
if ( metadata . getId ( ) = = 0 & & getMetaByIndex ( metadataList , 10 ) ! = null ) {
Metadata meta = getMetaByIndex ( metadataList , 10 ) ; //Only happens if the armorstand is small
2016-03-16 22:52:00 +01:00
byte data = ( byte ) metadata . getValue ( ) ;
2016-04-06 14:50:09 +02:00
// Check invisible | Check small | Check if custom name is empty | Check if custom name visible is true
2020-11-20 13:23:23 +01:00
Metadata displayName ;
Metadata displayNameVisible ;
2016-04-06 14:50:09 +02:00
if ( ( data & 0x20 ) = = 0x20 & & ( ( byte ) meta . getValue ( ) & 0x01 ) = = 0x01
2020-11-20 13:23:23 +01:00
& & ( displayName = getMetaByIndex ( metadataList , 2 ) ) ! = null & & ! ( ( String ) displayName . getValue ( ) ) . isEmpty ( )
& & ( displayNameVisible = getMetaByIndex ( metadataList , 3 ) ) ! = null & & ( boolean ) displayNameVisible . getValue ( ) ) {
2019-05-08 12:14:41 +02:00
if ( ! knownHolograms . contains ( entityId ) ) {
knownHolograms . add ( entityId ) ;
2016-03-18 22:18:48 +01:00
try {
// Send movement
2021-04-26 22:54:43 +02:00
PacketWrapper wrapper = PacketWrapper . create ( 0x25 , null , getUser ( ) ) ;
2019-05-08 12:14:41 +02:00
wrapper . write ( Type . VAR_INT , entityId ) ;
2017-06-07 16:13:04 +02:00
wrapper . write ( Type . SHORT , ( short ) 0 ) ;
wrapper . write ( Type . SHORT , ( short ) ( 128D * ( Via . getConfig ( ) . getHologramYOffset ( ) * 32D ) ) ) ;
wrapper . write ( Type . SHORT , ( short ) 0 ) ;
wrapper . write ( Type . BOOLEAN , true ) ;
2019-04-23 16:34:17 +02:00
wrapper . send ( Protocol1_9To1_8 . class , true , false ) ;
2016-03-18 22:18:48 +01:00
} catch ( Exception ignored ) {
}
2016-03-16 22:52:00 +01:00
}
}
}
}
// Boss bar
2016-09-25 16:40:30 +02:00
if ( Via . getConfig ( ) . isBossbarPatch ( ) ) {
2019-05-09 14:43:48 +02:00
if ( type = = EntityType . ENDER_DRAGON | | type = = EntityType . WITHER ) {
2016-03-16 22:52:00 +01:00
if ( metadata . getId ( ) = = 2 ) {
2019-05-08 12:14:41 +02:00
BossBar bar = bossBarMap . get ( entityId ) ;
2016-03-16 22:52:00 +01:00
String title = ( String ) metadata . getValue ( ) ;
2019-05-09 14:43:48 +02:00
title = title . isEmpty ( ) ? ( type = = EntityType . ENDER_DRAGON ? " Ender Dragon " : " Wither " ) : title ;
2016-03-16 22:52:00 +01:00
if ( bar = = null ) {
2021-04-28 11:10:16 +02:00
bar = Via . getAPI ( ) . legacyAPI ( ) . createLegacyBossBar ( title , BossColor . PINK , BossStyle . SOLID ) ;
2019-05-08 12:14:41 +02:00
bossBarMap . put ( entityId , bar ) ;
2020-06-25 15:50:34 +02:00
bar . addConnection ( getUser ( ) ) ;
2016-03-16 22:52:00 +01:00
bar . show ( ) ;
2017-02-03 17:24:14 +01:00
// Send to provider
Via . getManager ( ) . getProviders ( ) . get ( BossBarProvider . class ) . handleAdd ( getUser ( ) , bar . getId ( ) ) ;
2016-03-16 22:52:00 +01:00
} else {
bar . setTitle ( title ) ;
}
2016-09-25 16:40:30 +02:00
} else if ( metadata . getId ( ) = = 6 & & ! Via . getConfig ( ) . isBossbarAntiflicker ( ) ) { // If anti flicker is enabled, don't update health
2019-05-08 12:14:41 +02:00
BossBar bar = bossBarMap . get ( entityId ) ;
2016-03-16 22:52:00 +01:00
// Make health range between 0 and 1
2019-05-09 14:43:48 +02:00
float maxHealth = type = = EntityType . ENDER_DRAGON ? 200 . 0f : 300 . 0f ;
2016-03-16 22:52:00 +01:00
float health = Math . max ( 0 . 0f , Math . min ( ( ( float ) metadata . getValue ( ) ) / maxHealth , 1 . 0f ) ) ;
if ( bar = = null ) {
2019-05-09 14:43:48 +02:00
String title = type = = EntityType . ENDER_DRAGON ? " Ender Dragon " : " Wither " ;
2021-04-28 11:10:16 +02:00
bar = Via . getAPI ( ) . legacyAPI ( ) . createLegacyBossBar ( title , health , BossColor . PINK , BossStyle . SOLID ) ;
2019-05-08 12:14:41 +02:00
bossBarMap . put ( entityId , bar ) ;
2020-06-25 15:50:34 +02:00
bar . addConnection ( getUser ( ) ) ;
2016-03-16 22:52:00 +01:00
bar . show ( ) ;
2017-02-03 17:24:14 +01:00
// Send to provider
Via . getManager ( ) . getProviders ( ) . get ( BossBarProvider . class ) . handleAdd ( getUser ( ) , bar . getId ( ) ) ;
2016-03-16 22:52:00 +01:00
} else {
bar . setHealth ( health ) ;
}
}
}
}
}
}
2016-03-17 00:34:03 +01:00
2016-04-04 16:55:48 +02:00
public Metadata getMetaByIndex ( List < Metadata > list , int index ) {
for ( Metadata meta : list )
2020-11-20 13:23:23 +01:00
if ( index = = meta . getId ( ) ) {
2016-04-04 16:55:48 +02:00
return meta ;
2020-11-20 13:23:23 +01:00
}
2016-04-04 16:55:48 +02:00
return null ;
}
2017-06-29 21:04:40 +02:00
public void sendTeamPacket ( boolean add , boolean now ) {
2021-04-26 22:54:43 +02:00
PacketWrapper wrapper = PacketWrapper . create ( 0x41 , null , getUser ( ) ) ;
2016-03-17 00:34:03 +01:00
wrapper . write ( Type . STRING , " viaversion " ) ; // Use viaversion as name
2017-06-29 21:04:40 +02:00
if ( add ) {
2016-03-17 00:34:03 +01:00
// add
if ( ! teamExists ) {
wrapper . write ( Type . BYTE , ( byte ) 0 ) ; // make team
wrapper . write ( Type . STRING , " viaversion " ) ;
2020-08-21 01:58:34 +02:00
wrapper . write ( Type . STRING , " §f " ) ; // prefix
2016-03-17 00:34:03 +01:00
wrapper . write ( Type . STRING , " " ) ; // suffix
wrapper . write ( Type . BYTE , ( byte ) 0 ) ; // friendly fire
wrapper . write ( Type . STRING , " " ) ; // nametags
wrapper . write ( Type . STRING , " never " ) ; // collision rule :)
2020-08-21 01:58:34 +02:00
wrapper . write ( Type . BYTE , ( byte ) 15 ) ; // color
2016-03-17 00:34:03 +01:00
} else {
wrapper . write ( Type . BYTE , ( byte ) 3 ) ;
}
2020-06-07 12:19:36 +02:00
wrapper . write ( Type . STRING_ARRAY , new String [ ] { getUser ( ) . getProtocolInfo ( ) . getUsername ( ) } ) ;
2016-03-17 00:34:03 +01:00
} else {
wrapper . write ( Type . BYTE , ( byte ) 1 ) ; // remove team
}
2017-06-29 21:04:40 +02:00
teamExists = add ;
2016-03-17 00:34:03 +01:00
try {
2019-04-23 16:34:17 +02:00
wrapper . send ( Protocol1_9To1_8 . class , true , now ) ;
2016-03-17 00:34:03 +01:00
} catch ( Exception e ) {
e . printStackTrace ( ) ;
}
}
2016-05-27 02:00:01 +02:00
public void addMetadataToBuffer ( int entityID , List < Metadata > metadataList ) {
2018-09-30 20:48:23 +02:00
final List < Metadata > metadata = metadataBuffer . get ( entityID ) ;
if ( metadata ! = null ) {
metadata . addAll ( metadataList ) ;
2016-05-27 02:00:01 +02:00
} else {
metadataBuffer . put ( entityID , metadataList ) ;
}
}
2019-05-08 12:14:41 +02:00
public void sendMetadataBuffer ( int entityId ) {
List < Metadata > metadataList = metadataBuffer . get ( entityId ) ;
2018-09-30 20:48:23 +02:00
if ( metadataList ! = null ) {
2021-04-26 22:54:43 +02:00
PacketWrapper wrapper = PacketWrapper . create ( 0x39 , null , getUser ( ) ) ;
2019-05-08 12:14:41 +02:00
wrapper . write ( Type . VAR_INT , entityId ) ;
2018-09-30 20:48:23 +02:00
wrapper . write ( Types1_9 . METADATA_LIST , metadataList ) ;
2021-04-27 15:56:34 +02:00
Via . getManager ( ) . getProtocolManager ( ) . getProtocol ( Protocol1_9To1_8 . class ) . get ( MetadataRewriter1_9To1_8 . class )
2019-09-27 20:25:18 +02:00
. handleMetadata ( entityId , metadataList , getUser ( ) ) ;
2019-05-08 12:14:41 +02:00
handleMetadata ( entityId , metadataList ) ;
if ( ! metadataList . isEmpty ( ) ) {
2016-05-27 02:00:01 +02:00
try {
2019-04-23 16:34:17 +02:00
wrapper . send ( Protocol1_9To1_8 . class ) ;
2016-05-27 02:00:01 +02:00
} catch ( Exception e ) {
e . printStackTrace ( ) ;
}
}
2019-05-08 12:14:41 +02:00
metadataBuffer . remove ( entityId ) ;
2016-05-27 02:00:01 +02:00
}
}
2016-11-02 18:07:21 +01:00
public int getProvidedEntityId ( ) {
try {
return Via . getManager ( ) . getProviders ( ) . get ( EntityIdProvider . class ) . getEntityId ( getUser ( ) ) ;
} catch ( Exception e ) {
2019-05-08 12:14:41 +02:00
return getClientEntityId ( ) ;
2016-11-02 18:07:21 +01:00
}
}
2020-04-13 20:58:24 +02:00
public Map < Integer , UUID > getUuidMap ( ) {
return uuidMap ;
}
public Map < Integer , List < Metadata > > getMetadataBuffer ( ) {
return metadataBuffer ;
}
public Map < Integer , Integer > getVehicleMap ( ) {
return vehicleMap ;
}
public Map < Integer , BossBar > getBossBarMap ( ) {
return bossBarMap ;
}
public Set < Integer > getValidBlocking ( ) {
return validBlocking ;
}
public Set < Integer > getKnownHolograms ( ) {
return knownHolograms ;
}
public Set < Position > getBlockInteractions ( ) {
return blockInteractions ;
}
public boolean isBlocking ( ) {
return blocking ;
}
public void setBlocking ( boolean blocking ) {
this . blocking = blocking ;
}
public boolean isAutoTeam ( ) {
return autoTeam ;
}
public void setAutoTeam ( boolean autoTeam ) {
this . autoTeam = autoTeam ;
}
public Position getCurrentlyDigging ( ) {
return currentlyDigging ;
}
public void setCurrentlyDigging ( Position currentlyDigging ) {
this . currentlyDigging = currentlyDigging ;
}
public boolean isTeamExists ( ) {
return teamExists ;
}
public GameMode getGameMode ( ) {
return gameMode ;
}
public void setGameMode ( GameMode gameMode ) {
this . gameMode = gameMode ;
}
public String getCurrentTeam ( ) {
return currentTeam ;
}
public void setCurrentTeam ( String currentTeam ) {
this . currentTeam = currentTeam ;
}
2021-04-05 18:53:57 +02:00
public void setHeldItemSlot ( int heldItemSlot ) {
this . heldItemSlot = heldItemSlot ;
}
2016-03-12 00:07:13 +01:00
}