style: fix AnnotationUseStyle (#4710)

This commit is contained in:
Tobias Nett 2021-05-26 15:52:56 +02:00 committed by GitHub
parent 2db9a7ea36
commit 8e265d0e08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 99 additions and 97 deletions

View file

@ -144,14 +144,14 @@ private static Appender<ILoggingEvent> mockAppender() {
}
private static class SystemWithValidCommand extends BaseComponentSystem {
@Command()
@Command
public String validCommandName(@CommandParam(value = "parameter") String value, @Sender EntityRef sender) {
return value;
}
}
private static class SystemWithCommandMissingSenderAnnotation extends BaseComponentSystem {
@Command()
@Command
public String commandWithoutSenderAnnotation(@CommandParam(value = "parameter") String value, EntityRef sender) {
return value;
}

View file

@ -27,7 +27,7 @@ protected final Setting<T> getSetting() {
return setting;
}
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
protected C getConstraint() {
return (C) setting.getConstraint();
}

View file

@ -29,7 +29,7 @@ public class LoadingChunkEventSystem extends BaseComponentSystem {
* @param chunkAvailable an event which includes the position of the new chunk
* @param worldEntity the world entity that this event was sent to
*/
@ReceiveEvent(components = {WorldComponent.class})
@ReceiveEvent(components = WorldComponent.class)
public void onNewChunk(OnChunkLoaded chunkAvailable, EntityRef worldEntity) {
GameEngine gameEngine = context.get(GameEngine.class);

View file

@ -48,7 +48,7 @@
public class ModuleManager {
/** Set this property to "true" to allow modules on the classpath. */
public final static String LOAD_CLASSPATH_MODULES_PROPERTY = "org.terasology.load_classpath_modules";
public static final String LOAD_CLASSPATH_MODULES_PROPERTY = "org.terasology.load_classpath_modules";
private static final Logger logger = LoggerFactory.getLogger(ModuleManager.class);
private final StandardPermissionProviderFactory permissionProviderFactory = new StandardPermissionProviderFactory();
@ -96,6 +96,14 @@ public ModuleManager(String masterServerAddress, List<Class<?>> classesOnClasspa
installManager = new ModuleInstallManager(this, masterServerAddress);
}
public ModuleManager(Config config) {
this(config, Collections.emptyList());
}
public ModuleManager(Config config, List<Class<?>> classesOnClasspathsToAddToEngine) {
this(config.getNetwork().getMasterServer(), classesOnClasspathsToAddToEngine);
}
/**
* I wondered why this is important, and found MovingBlocks/Terasology#1450.
* It's not a worry that the engine module wouldn't be loaded without it.
@ -154,14 +162,6 @@ private Module loadEngineModule(List<Class<?>> classesOnClasspathsToAddToEngine)
return engine;
}
public ModuleManager(Config config) {
this(config, Collections.emptyList());
}
public ModuleManager(Config config, List<Class<?>> classesOnClasspathsToAddToEngine) {
this(config.getNetwork().getMasterServer(), classesOnClasspathsToAddToEngine);
}
private ModuleMetadataJsonAdapter newMetadataReader() {
final ModuleMetadataJsonAdapter metadataJsonAdapter = new ModuleMetadataJsonAdapter();
for (ModuleExtension ext : StandardModuleExtension.values()) {
@ -194,7 +194,7 @@ private void setupSandbox() {
*
* @deprecated Use {@link #resolveAndLoadEnvironment} if you need module dependency resolution.
*/
@Deprecated(/*since="4.4.0"*/)
@Deprecated/*(since="4.4.0")*/
public ModuleRegistry getRegistry() {
return registry;
}

View file

@ -38,7 +38,7 @@ public class PlaySoundAction extends BaseComponentSystem {
* @param event contains the details for the predicted event, used here for location purposes
* @param entity is source of the playsound
*/
@ReceiveEvent(components = {PlaySoundActionComponent.class})
@ReceiveEvent(components = PlaySoundActionComponent.class)
public void onActivationPredicted(ActivationPredicted event, EntityRef entity) {
PlaySoundActionComponent playSound = entity.getComponent(PlaySoundActionComponent.class);
StaticSound sound = random.nextItem(playSound.sounds);
@ -65,7 +65,7 @@ public void onActivationPredicted(ActivationPredicted event, EntityRef entity) {
* @param event contains the details for the active event, used here for location purposes
* @param entity is source of the playsound
*/
@ReceiveEvent(components = {PlaySoundActionComponent.class})
@ReceiveEvent(components = PlaySoundActionComponent.class)
public void onActivate(ActivateEvent event, EntityRef entity) {
if (event.getInstigator().equals(localPlayer.getCharacterEntity())) {
return; // owner has heard sound from prediction

View file

@ -237,7 +237,7 @@ private boolean foodInFront() {
}
//TODO change eating thingy to use this
@ReceiveEvent(components = {HierarchicalAIComponent.class})
@ReceiveEvent(components = HierarchicalAIComponent.class)
public void onBump(HorizontalCollisionEvent event, EntityRef entity, CharacterMovementComponent moveComp) {
if (moveComp != null && moveComp.grounded) {
moveComp.jump = true;

View file

@ -81,7 +81,7 @@ public void update(float delta) {
}
}
@ReceiveEvent(components = {SimpleAIComponent.class})
@ReceiveEvent(components = SimpleAIComponent.class)
public void onBump(HorizontalCollisionEvent event, EntityRef entity) {
CharacterMovementComponent moveComp = entity.getComponent(CharacterMovementComponent.class);
if (moveComp != null && moveComp.grounded) {

View file

@ -174,7 +174,7 @@ public String getDamageTypeName(Prefab damageType) {
}
}
@ReceiveEvent(components = {CharacterComponent.class}, netFilter = RegisterMode.CLIENT)
@ReceiveEvent(components = CharacterComponent.class, netFilter = RegisterMode.CLIENT)
public void onAttackRequest(AttackButton event, EntityRef entity, CharacterHeldItemComponent characterHeldItemComponent) {
if (!event.isDown()) {
return;
@ -232,7 +232,7 @@ public void onAttackRequest(AttackRequest event, EntityRef character, CharacterC
}
}
@ReceiveEvent(components = {CharacterComponent.class})
@ReceiveEvent(components = CharacterComponent.class)
public void onItemUse(OnItemUseEvent event, EntityRef entity, CharacterHeldItemComponent characterHeldItemComponent) {
long currentTime = time.getGameTimeInMs();
if (characterHeldItemComponent.nextItemUseTime > currentTime) {

View file

@ -102,7 +102,7 @@ public void onDestroy(final BeforeDeactivateComponent event, final EntityRef ent
lastInputEvent.remove(entity);
}
@ReceiveEvent(components = {AliveCharacterComponent.class})
@ReceiveEvent(components = AliveCharacterComponent.class)
public void onSetMovementModeEvent(SetMovementModeEvent event, EntityRef character,
CharacterMovementComponent movementComponent) {
CircularBuffer<CharacterStateEvent> stateBuffer = characterStates.get(character);

View file

@ -57,7 +57,7 @@ public void onActivatedVisualCharacter(OnActivatedComponent event, EntityRef ent
}
@ReceiveEvent(components = {VisualCharacterComponent.class})
@ReceiveEvent(components = VisualCharacterComponent.class)
public void onBeforeDeactivatedVisualCharacter(BeforeDeactivateComponent event, EntityRef entity,
VisualCharacterComponent visualCharacterComponent) {
visualCharacterComponent.visualCharacter.destroy();

View file

@ -26,7 +26,7 @@ public class InteractionSystem extends BaseComponentSystem {
@In
private NUIManager nuiManager;
@ReceiveEvent(components = {InteractionTargetComponent.class}, netFilter = RegisterMode.AUTHORITY)
@ReceiveEvent(components = InteractionTargetComponent.class, netFilter = RegisterMode.AUTHORITY)
public void onActivate(ActivateEvent event, EntityRef target) {
EntityRef instigator = event.getInstigator();
@ -46,7 +46,7 @@ public void onActivate(ActivateEvent event, EntityRef target) {
}
@ReceiveEvent(components = {InteractionTargetComponent.class})
@ReceiveEvent(components = InteractionTargetComponent.class)
public void onActivationPredicted(ActivationPredicted event, EntityRef target) {
EntityRef character = event.getInstigator();
CharacterComponent characterComponent = character.getComponent(CharacterComponent.class);
@ -64,17 +64,17 @@ public void onActivationPredicted(ActivationPredicted event, EntityRef target) {
}
}
@ReceiveEvent(components = {CharacterComponent.class}, netFilter = RegisterMode.AUTHORITY)
@ReceiveEvent(components = CharacterComponent.class, netFilter = RegisterMode.AUTHORITY)
public void onActivationRequestDenied(ActivationRequestDenied event, EntityRef character) {
character.send(new InteractionEndEvent(event.getActivationId()));
}
@ReceiveEvent(components = {}, netFilter = RegisterMode.AUTHORITY)
@ReceiveEvent(netFilter = RegisterMode.AUTHORITY)
public void onInteractionEndRequest(InteractionEndRequest request, EntityRef instigator) {
InteractionUtil.cancelInteractionAsServer(instigator);
}
@ReceiveEvent(components = {CharacterComponent.class})
@ReceiveEvent(components = CharacterComponent.class)
public void onInteractionEnd(InteractionEndEvent event, EntityRef character, CharacterComponent characterComponent) {
if (event.getInteractionId() == characterComponent.predictedInteractionId) {
InteractionUtil.cancelInteractionAsClient(character, false);
@ -88,7 +88,7 @@ public void onInteractionEndPredicted(InteractionEndPredicted event, EntityRef t
}
@ReceiveEvent(components = {InteractionScreenComponent.class})
@ReceiveEvent(components = InteractionScreenComponent.class)
public void onInteractionStartPredicted(InteractionStartPredicted event, EntityRef container,
InteractionScreenComponent interactionScreenComponent) {
EntityRef investigator = event.getInstigator();
@ -109,7 +109,7 @@ public void onInteractionStartPredicted(InteractionStartPredicted event, EntityR
* <p>
* When it happens then it cancels the interaction.
*/
@ReceiveEvent(components = {ClientComponent.class})
@ReceiveEvent(components = ClientComponent.class)
public void onScreenLayerClosed(ScreenLayerClosedEvent event, EntityRef container, ClientComponent clientComponent) {
EntityRef character = clientComponent.character;
ResourceUrn activeInteractionScreenUri = InteractionUtil.getActiveInteractionScreenUri(character);

View file

@ -22,14 +22,14 @@ public class ChunkEventErrorLogger extends BaseComponentSystem {
private Set<Vector3ic> loadedChunks = Sets.newHashSet();
@ReceiveEvent(components = {WorldComponent.class})
@ReceiveEvent(components = WorldComponent.class)
public void onNewChunk(OnChunkLoaded chunkAvailable, EntityRef worldEntity) {
if (!loadedChunks.add(chunkAvailable.getChunkPos())) {
logger.error("Multiple loads of chunk {}", chunkAvailable.getChunkPos());
}
}
@ReceiveEvent(components = {WorldComponent.class})
@ReceiveEvent(components = WorldComponent.class)
public void onRemoveChunk(BeforeChunkUnload chunkUnload, EntityRef worldEntity) {
if (!loadedChunks.remove(chunkUnload.getChunkPos())) {
logger.error("Unload event for not loaded chunk {}", chunkUnload.getChunkPos());

View file

@ -12,7 +12,7 @@
@RegisterSystem(RegisterMode.AUTHORITY)
public class LocationChangedSystem extends BaseComponentSystem {
@ReceiveEvent(components = {LocationComponent.class})
@ReceiveEvent(components = LocationComponent.class)
public void onItemUpdate(OnChangedComponent event, EntityRef entity) {
LocationComponent lc = entity.getComponent(LocationComponent.class);
if (!lc.lastPosition.equals(lc.position) || !lc.lastRotation.equals(lc.rotation)) {

View file

@ -38,7 +38,7 @@ public void onNameTagOwnerActivated(OnActivatedComponent event, EntityRef entity
createOrUpdateNameTagFor(entity, nameTagComponent);
}
@ReceiveEvent(components = {NameTagComponent.class })
@ReceiveEvent(components = NameTagComponent.class)
public void onDisplayNameChange(OnChangedComponent event, EntityRef entity,
NameTagComponent nameTagComponent) {
createOrUpdateNameTagFor(entity, nameTagComponent);
@ -84,7 +84,7 @@ private void destroyNameTagOf(EntityRef entity) {
}
@ReceiveEvent(components = {NameTagComponent.class })
@ReceiveEvent(components = NameTagComponent.class)
public void onNameTagOwnerRemoved(BeforeDeactivateComponent event, EntityRef entity) {
destroyNameTagOf(entity);
}

View file

@ -12,7 +12,6 @@
import org.terasology.engine.core.Time;
import org.terasology.engine.core.subsystem.config.BindsManager;
import org.terasology.engine.entitySystem.entity.EntityRef;
import org.terasology.engine.entitySystem.event.EventPriority;
import org.terasology.engine.entitySystem.event.ReceiveEvent;
import org.terasology.engine.entitySystem.systems.BaseComponentSystem;
import org.terasology.engine.entitySystem.systems.RenderSystem;
@ -255,13 +254,13 @@ public void onMouseMove(MouseAxisEvent event, EntityRef entity) {
event.consume();
}
@ReceiveEvent(components = {CharacterComponent.class})
@ReceiveEvent(components = CharacterComponent.class)
public void updateRotationYaw(RotationYawAxis event, EntityRef entity) {
lookYawDelta = event.getValue();
event.consume();
}
@ReceiveEvent(components = {CharacterComponent.class})
@ReceiveEvent(components = CharacterComponent.class)
public void updateRotationPitch(RotationPitchAxis event, EntityRef entity) {
lookPitchDelta = event.getValue();
event.consume();
@ -277,7 +276,7 @@ public void onJump(JumpButton event, EntityRef entity) {
}
}
@ReceiveEvent(components = {ClientComponent.class})
@ReceiveEvent(components = ClientComponent.class)
public void updateForwardsMovement(ForwardsMovementAxis event, EntityRef entity) {
relativeMovement.z = (float) event.getValue();
if (relativeMovement.z == 0f && isAutoMove) {
@ -286,37 +285,37 @@ public void updateForwardsMovement(ForwardsMovementAxis event, EntityRef entity)
event.consume();
}
@ReceiveEvent(components = {ClientComponent.class})
@ReceiveEvent(components = ClientComponent.class)
public void updateStrafeMovement(StrafeMovementAxis event, EntityRef entity) {
relativeMovement.x = (float) event.getValue();
event.consume();
}
@ReceiveEvent(components = {ClientComponent.class})
@ReceiveEvent(components = ClientComponent.class)
public void updateVerticalMovement(VerticalMovementAxis event, EntityRef entity) {
relativeMovement.y = (float) event.getValue();
event.consume();
}
@ReceiveEvent(components = {ClientComponent.class})
@ReceiveEvent(components = ClientComponent.class)
public void updateForwardsMovement(ForwardsRealMovementAxis event, EntityRef entity) {
relativeMovement.z = (float) event.getValue();
event.consume();
}
@ReceiveEvent(components = {ClientComponent.class})
@ReceiveEvent(components = ClientComponent.class)
public void updateStrafeMovement(StrafeRealMovementAxis event, EntityRef entity) {
relativeMovement.x = (float) event.getValue();
event.consume();
}
@ReceiveEvent(components = {ClientComponent.class})
@ReceiveEvent(components = ClientComponent.class)
public void updateVerticalMovement(VerticalRealMovementAxis event, EntityRef entity) {
relativeMovement.y = (float) event.getValue();
event.consume();
}
@ReceiveEvent(components = {ClientComponent.class}, priority = EventPriority.PRIORITY_NORMAL)
@ReceiveEvent(components = ClientComponent.class)
public void onToggleSpeedTemporarily(ToggleSpeedTemporarilyButton event, EntityRef entity) {
boolean toggle = event.isDown();
run = runPerDefault ^ toggle;
@ -324,14 +323,14 @@ public void onToggleSpeedTemporarily(ToggleSpeedTemporarilyButton event, EntityR
}
// Crouches if button is pressed. Stands if button is released.
@ReceiveEvent(components = {ClientComponent.class}, priority = EventPriority.PRIORITY_NORMAL)
@ReceiveEvent(components = ClientComponent.class)
public void onCrouchTemporarily(CrouchButton event, EntityRef entity) {
boolean toggle = event.isDown();
crouch = crouchPerDefault ^ toggle;
event.consume();
}
@ReceiveEvent(components = {ClientComponent.class}, priority = EventPriority.PRIORITY_NORMAL)
@ReceiveEvent(components = ClientComponent.class)
public void onCrouchMode(CrouchModeButton event, EntityRef entity) {
if (event.isDown()) {
crouchPerDefault = !crouchPerDefault;
@ -340,7 +339,7 @@ public void onCrouchMode(CrouchModeButton event, EntityRef entity) {
event.consume();
}
@ReceiveEvent(components = {ClientComponent.class}, priority = EventPriority.PRIORITY_NORMAL)
@ReceiveEvent(components = ClientComponent.class)
public void onAutoMoveMode(AutoMoveButton event, EntityRef entity) {
if (event.isDown()) {
if (!isAutoMove) {
@ -352,7 +351,7 @@ public void onAutoMoveMode(AutoMoveButton event, EntityRef entity) {
event.consume();
}
@ReceiveEvent(components = {ClientComponent.class}, priority = EventPriority.PRIORITY_NORMAL)
@ReceiveEvent(components = ClientComponent.class)
public void onToggleSpeedPermanently(ToggleSpeedPermanentlyButton event, EntityRef entity) {
if (event.isDown()) {
runPerDefault = !runPerDefault;
@ -378,7 +377,10 @@ public void onTargetChanged(PlayerTargetChangedEvent event, EntityRef entity) {
MeshComponent mesh = target.getComponent(MeshComponent.class);
if (mesh != null && mesh.mesh != null) {
aabb.set(mesh.mesh.getAABB());
aabb.transform(new Matrix4f().translationRotateScale(location.getWorldPosition(new Vector3f()), location.getWorldRotation(new Quaternionf()), location.getWorldScale()));
aabb.transform(new Matrix4f().translationRotateScale(
location.getWorldPosition(new Vector3f()),
location.getWorldRotation(new Quaternionf()),
location.getWorldScale()));
}
}
}
@ -430,7 +432,7 @@ private void updateCamera(CharacterMovementComponent charMovementComp, Vector3f
}
}
@ReceiveEvent(components = {CharacterComponent.class})
@ReceiveEvent(components = CharacterComponent.class)
public void onFrobButton(FrobButton event, EntityRef character) {
if (event.getState() != ButtonState.DOWN) {
return;
@ -447,7 +449,7 @@ public void onFrobButton(FrobButton event, EntityRef character) {
}
}
@ReceiveEvent(components = {CharacterComponent.class})
@ReceiveEvent(components = CharacterComponent.class)
public void onUseItemButton(UseItemButton event, EntityRef entity,
CharacterHeldItemComponent characterHeldItemComponent) {
if (!event.isDown()) {

View file

@ -73,7 +73,7 @@ public void onScreenshotCapture(ScreenshotButton event, EntityRef entity) {
}
}
@ReceiveEvent(components = {CharacterComponent.class})
@ReceiveEvent(components = CharacterComponent.class)
public void onPlayerDeath(PlayerDeathEvent event, EntityRef character) {
EntityRef client = character.getComponent(CharacterComponent.class).controller;
if (client.getComponent(ClientComponent.class).local) {

View file

@ -202,7 +202,7 @@ public void onDisconnect(DisconnectedEvent event, EntityRef entity) {
removeRelevanceEntity(entity);
}
@ReceiveEvent(priority = EventPriority.PRIORITY_CRITICAL, components = {ClientComponent.class})
@ReceiveEvent(priority = EventPriority.PRIORITY_CRITICAL, components = ClientComponent.class)
public void setSpawnLocationOnRespawnRequest(RespawnRequestEvent event, EntityRef entity) {
ClientComponent clientComponent = entity.getComponent(ClientComponent.class);
EntityRef character = clientComponent.character;
@ -220,7 +220,7 @@ public void setSpawnLocationOnRespawnRequest(RespawnRequestEvent event, EntityRe
character.saveComponent(loc);
}
@ReceiveEvent(priority = EventPriority.PRIORITY_TRIVIAL, components = {ClientComponent.class})
@ReceiveEvent(priority = EventPriority.PRIORITY_TRIVIAL, components = ClientComponent.class)
public void onRespawnRequest(RespawnRequestEvent event, EntityRef entity) {
Vector3f spawnPosition = entity.getComponent(LocationComponent.class).getWorldPosition(new Vector3f());

View file

@ -33,7 +33,7 @@ public class LocalPlayerBlockSelectionByItemSystem extends BaseComponentSystem {
private EntityRef blockSelectionComponentEntity;
@ReceiveEvent(components = {OnItemActivateSelectionComponent.class})
@ReceiveEvent(components = OnItemActivateSelectionComponent.class)
public void onPlaced(ActivateEvent event, EntityRef itemEntity) {
if (event.getTargetLocation() == null) {
return;
@ -60,7 +60,7 @@ public void onPlaced(ActivateEvent event, EntityRef itemEntity) {
}
}
@ReceiveEvent(components = {LocationComponent.class})
@ReceiveEvent(components = LocationComponent.class)
public void onCamTargetChanged(CameraTargetChangedEvent event, EntityRef entity) {
// This method will update the block selection to whatever block is targeted in the players view
if (null == blockSelectionComponentEntity) {
@ -106,7 +106,7 @@ public void onCamTargetChanged(CameraTargetChangedEvent event, EntityRef entity)
* @param event The event sent
* @param blockSelectionComponentEntity The entity sending the event. This entity must have the {@link BlockSelectionComponent}
*/
@ReceiveEvent(components = {BlockSelectionComponent.class})
@ReceiveEvent(components = BlockSelectionComponent.class)
public void onMovableBlockSelectionStart(MovableSelectionStartEvent event, EntityRef blockSelectionComponentEntity) {
this.blockSelectionComponentEntity = blockSelectionComponentEntity;
}

View file

@ -53,7 +53,7 @@ public void onAddNetworkComponent(OnActivatedComponent event, EntityRef entity)
}
}
@ReceiveEvent(components = {EntityInfoComponent.class})
@ReceiveEvent(components = EntityInfoComponent.class)
public void onOwnershipChanged(OnChangedComponent event, EntityRef entity) {
networkSystem.updateOwnership(entity);
}

View file

@ -48,7 +48,7 @@ public class ParticleSystemManagerImpl extends BaseComponentSystem implements Up
private ParticleUpdater particleUpdater;
@ReceiveEvent(components = {ParticleEmitterComponent.class})
@ReceiveEvent(components = ParticleEmitterComponent.class)
public void onEmitterActivated(OnActivatedComponent event, EntityRef entity, ParticleEmitterComponent particleEmitterComponent) {
particleEmitterComponent.ownerEntity = entity;
particleEmitterComponent.locationComponent = entity.getComponent(LocationComponent.class);
@ -60,12 +60,12 @@ public void onEmitterActivated(OnActivatedComponent event, EntityRef entity, Par
particleUpdater.configureEmitter(particleEmitterComponent);
}
@ReceiveEvent(components = {ParticleEmitterComponent.class})
@ReceiveEvent(components = ParticleEmitterComponent.class)
public void onEmitterChanged(ParticleSystemUpdateEvent event, EntityRef entity, ParticleEmitterComponent emitter) {
particleUpdater.configureEmitter(emitter);
}
@ReceiveEvent(components = {ParticleEmitterComponent.class})
@ReceiveEvent(components = ParticleEmitterComponent.class)
public void onEmitterDeactivated(BeforeDeactivateComponent event, EntityRef entity, ParticleEmitterComponent particleEmitterComponent) {
particleUpdater.removeEmitter(entity);
}

View file

@ -9,7 +9,7 @@
import org.terasology.engine.utilities.random.Random;
@RegisterParticleSystemFunction()
@RegisterParticleSystemFunction
public final class AccelerationAffectorFunction extends AffectorFunction<AccelerationAffectorComponent> {
public AccelerationAffectorFunction() {
super(ParticleDataMask.VELOCITY);

View file

@ -9,7 +9,7 @@
import org.terasology.engine.utilities.random.Random;
@RegisterParticleSystemFunction()
@RegisterParticleSystemFunction
public final class VelocityAffectorFunction extends AffectorFunction<VelocityAffectorComponent> {
public VelocityAffectorFunction() {
super(ParticleDataMask.POSITION, ParticleDataMask.VELOCITY);

View file

@ -11,7 +11,7 @@
/**
* Created by Linus on 11-3-2015.
*/
@RegisterParticleSystemFunction()
@RegisterParticleSystemFunction
public final class ColorRangeGeneratorFunction extends GeneratorFunction<ColorRangeGeneratorComponent> {
public ColorRangeGeneratorFunction() {

View file

@ -11,7 +11,7 @@
/**
* Created by Linus on 11-3-2015.
*/
@RegisterParticleSystemFunction()
@RegisterParticleSystemFunction
public final class EnergyRangeGeneratorFunction extends GeneratorFunction<EnergyRangeGeneratorComponent> {
public EnergyRangeGeneratorFunction() {

View file

@ -11,7 +11,7 @@
/**
* Created by Linus on 11-3-2015.
*/
@RegisterParticleSystemFunction()
@RegisterParticleSystemFunction
public final class PositionRangeGeneratorFunction extends GeneratorFunction<PositionRangeGeneratorComponent> {
public PositionRangeGeneratorFunction() {

View file

@ -11,7 +11,7 @@
/**
* Created by Linus on 11-3-2015.
*/
@RegisterParticleSystemFunction()
@RegisterParticleSystemFunction
public final class ScaleRangeGeneratorFunction extends GeneratorFunction<ScaleRangeGeneratorComponent> {
public ScaleRangeGeneratorFunction() {
super(ParticleDataMask.SCALE);

View file

@ -12,7 +12,7 @@
/**
* Created by Linus on 13-4-2015.
*/
@RegisterParticleSystemFunction()
@RegisterParticleSystemFunction
public class TextureOffsetGeneratorFunction extends GeneratorFunction<TextureOffsetGeneratorComponent> {
public TextureOffsetGeneratorFunction() {

View file

@ -11,7 +11,7 @@
/**
* Created by Linus on 11-3-2015.
*/
@RegisterParticleSystemFunction()
@RegisterParticleSystemFunction
public final class VelocityRangeGeneratorFunction extends GeneratorFunction<VelocityRangeGeneratorComponent> {
public VelocityRangeGeneratorFunction() {
super(ParticleDataMask.VELOCITY);

View file

@ -24,7 +24,7 @@ public <T> Optional<TypeHandler<T>> create(TypeInfo<T> typeInfo, TypeHandlerCont
return Optional.empty();
}
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
TypeHandler<T> typeHandler = new AssetTypeHandler(rawType);
return Optional.of(typeHandler);

View file

@ -90,17 +90,17 @@ public void newTrigger(OnActivatedComponent event, EntityRef entity) {
physics.updateTrigger(entity);
}
@ReceiveEvent(components = {RigidBodyComponent.class})
@ReceiveEvent(components = RigidBodyComponent.class)
public void onImpulse(ImpulseEvent event, EntityRef entity) {
physics.getRigidBody(entity).applyImpulse(event.getImpulse());
}
@ReceiveEvent(components = {RigidBodyComponent.class})
@ReceiveEvent(components = RigidBodyComponent.class)
public void onForce(ForceEvent event, EntityRef entity) {
physics.getRigidBody(entity).applyForce(event.getForce());
}
@ReceiveEvent(components = {RigidBodyComponent.class})
@ReceiveEvent(components = RigidBodyComponent.class)
public void onChangeVelocity(ChangeVelocityEvent event, EntityRef entity) {
if (event.getAngularVelocity() != null) {
physics.getRigidBody(entity).setAngularVelocity(event.getAngularVelocity());
@ -130,7 +130,7 @@ public void updateRigidBody(OnChangedComponent event, EntityRef entity) {
physics.updateRigidBody(entity);
}
@ReceiveEvent(components = {BlockComponent.class})
@ReceiveEvent(components = BlockComponent.class)
public void onBlockAltered(OnChangedBlock event, EntityRef entity) {
physics.awakenArea(new Vector3f(event.getBlockPosition()), 0.6f);
}

View file

@ -171,13 +171,13 @@ public void renderOverlay() {
public void renderShadows() {
}
@ReceiveEvent(components = {FloatingTextComponent.class})
@ReceiveEvent(components = FloatingTextComponent.class)
public void onDisplayNameChange(OnChangedComponent event, EntityRef entity) {
disposeCachedMeshOfEntity(entity);
}
@ReceiveEvent(components = {FloatingTextComponent.class})
@ReceiveEvent(components = FloatingTextComponent.class)
public void onNameTagOwnerRemoved(BeforeDeactivateComponent event, EntityRef entity) {
disposeCachedMeshOfEntity(entity);
}

View file

@ -237,7 +237,7 @@ public static <T> Type getTypeParameterForSuper(Type target, Class<T> superClass
* @param type The {@link TypeInfo} describing the type of the array.
* @param <C> The component type of the array.
*/
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
public static <C> TypeInfo<C> getComponentType(TypeInfo<C[]> type) {
if (type.getType() instanceof GenericArrayType) {
GenericArrayType arrayType = (GenericArrayType) type.getType();
@ -258,7 +258,7 @@ public static <C> TypeInfo<C> getComponentType(TypeInfo<C[]> type) {
* @param type The {@link TypeInfo} describing the type of the {@link Collection}.
* @param <E> The element type of the {@link Collection}.
*/
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
public static <E> TypeInfo<E> getElementType(TypeInfo<? extends Collection<E>> type) {
Type elementType = getTypeParameterForSuper(type.getType(), Collection.class, 0);

View file

@ -85,7 +85,7 @@ private void notifyNeighboursOfChangedBlocks() {
largeBlockUpdateCount--;
}
@ReceiveEvent(components = {BlockComponent.class})
@ReceiveEvent(components = BlockComponent.class)
public void blockUpdate(OnChangedBlock event, EntityRef blockEntity) {
if (largeBlockUpdateCount > 0) {
blocksUpdatedInLargeBlockUpdate.add(event.getBlockPosition());

View file

@ -17,7 +17,7 @@ public class BlockPlacingSystem extends BaseComponentSystem {
@In
private WorldProvider worldProvider;
@ReceiveEvent(components = {WorldComponent.class}, priority = EventPriority.PRIORITY_TRIVIAL)
@ReceiveEvent(components = WorldComponent.class, priority = EventPriority.PRIORITY_TRIVIAL)
public void placeBlockInWorld(PlaceBlocks event, EntityRef world) {
worldProvider.setBlocks(event.getBlocks());
}

View file

@ -63,7 +63,7 @@ public void registerBlockStructuralSupport(BlockStructuralSupport blockStructura
supports.add(blockStructuralSupport);
}
@ReceiveEvent(components = {BlockComponent.class})
@ReceiveEvent(components = BlockComponent.class)
public void checkForSupportRemoved(OnChangedBlock event, EntityRef entity) {
PerformanceMonitor.startActivity("StructuralCheck");
try {

View file

@ -390,7 +390,7 @@ public boolean hasPermanentBlockEntity(Vector3ic blockPos) {
return false;
}
@ReceiveEvent(components = {BlockComponent.class})
@ReceiveEvent(components = BlockComponent.class)
public void onActivateBlock(OnActivatedComponent event, EntityRef entity) {
BlockComponent block = entity.getComponent(BlockComponent.class);
EntityRef oldEntity = blockEntityLookup.put(block.getPosition(new Vector3i()), entity);
@ -400,7 +400,7 @@ public void onActivateBlock(OnActivatedComponent event, EntityRef entity) {
}
}
@ReceiveEvent(components = {BlockComponent.class})
@ReceiveEvent(components = BlockComponent.class)
public void onDeactivateBlock(BeforeDeactivateComponent event, EntityRef entity) {
BlockComponent block = entity.getComponent(BlockComponent.class);
if (blockEntityLookup.get(block.getPosition()) == entity) {
@ -408,7 +408,7 @@ public void onDeactivateBlock(BeforeDeactivateComponent event, EntityRef entity)
}
}
@ReceiveEvent(components = {BlockRegionComponent.class})
@ReceiveEvent(components = BlockRegionComponent.class)
public void onBlockRegionActivated(OnActivatedComponent event, EntityRef entity) {
BlockRegionComponent regionComp = entity.getComponent(BlockRegionComponent.class);
blockRegions.put(entity, regionComp.region);
@ -417,7 +417,7 @@ public void onBlockRegionActivated(OnActivatedComponent event, EntityRef entity)
}
}
@ReceiveEvent(components = {BlockRegionComponent.class})
@ReceiveEvent(components = BlockRegionComponent.class)
public void onBlockRegionChanged(OnChangedComponent event, EntityRef entity) {
BlockRegion oldRegion = blockRegions.get(entity);
for (Vector3ic pos : oldRegion) {
@ -430,7 +430,7 @@ public void onBlockRegionChanged(OnChangedComponent event, EntityRef entity) {
}
}
@ReceiveEvent(components = {BlockRegionComponent.class})
@ReceiveEvent(components = BlockRegionComponent.class)
public void onBlockRegionDeactivated(BeforeDeactivateComponent event, EntityRef entity) {
BlockRegion oldRegion = blockRegions.get(entity);
for (Vector3ic pos : oldRegion) {

View file

@ -213,7 +213,7 @@ public <T> void addInstanceCreator(TypeInfo<T> typeInfo, InstanceCreator<T> inst
* @param type The {@link Type} describing the type for which to retrieve the {@link TypeHandler}.
* @return The {@link TypeHandler} for the specified type, if available.
*/
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
public Optional<TypeHandler<?>> getTypeHandler(Type type) {
TypeInfo typeInfo = TypeInfo.of(type);
return (Optional<TypeHandler<?>>) getTypeHandler(typeInfo);

View file

@ -12,7 +12,7 @@
* the provided name value as its field name.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
@Target(ElementType.FIELD)
public @interface SerializedName {
/**
* @return the desired name of the field when it is serialized or deserialized.

View file

@ -50,7 +50,7 @@ public Optional<Object> deserialize(PersistedData data) {
return Optional.empty();
}
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
List<E> items = data.getAsArray().getAsValueArray().stream()
.map(itemData -> elementTypeHandler.deserialize(itemData))
.filter(Optional::isPresent)

View file

@ -46,7 +46,7 @@ public RuntimeDelegatingTypeHandler(TypeHandler<T> delegateHandler, TypeInfo<T>
this.sandbox = context.getSandbox();
}
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
@Override
public PersistedData serializeNonNull(T value, PersistedDataSerializer serializer) {
// If primitive, don't go looking for the runtime type, serialize as is
@ -157,7 +157,7 @@ private Type getRuntimeTypeIfMoreSpecific(T value) {
return ReflectionUtil.parameterizeandResolveRawType(typeInfo.getType(), value.getClass());
}
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
@Override
public Optional<T> deserialize(PersistedData data) {
if (!data.isValueMap()) {

View file

@ -35,14 +35,14 @@ public <T> Optional<TypeHandler<T>> create(TypeInfo<T> typeInfo, TypeHandlerCont
Optional<TypeHandler<?>> declaredElementTypeHandler =
context.getTypeHandlerLibrary().getTypeHandler(elementType);
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
TypeHandler<?> elementTypeHandler = new RuntimeDelegatingTypeHandler(
declaredElementTypeHandler.orElse(null),
elementTypeInfo,
context
);
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
TypeHandler<T> typeHandler = new ArrayTypeHandler(elementTypeHandler, elementTypeInfo);
return Optional.of(typeHandler);

View file

@ -50,7 +50,7 @@ public <T> Optional<TypeHandler<T>> create(TypeInfo<T> typeInfo, TypeHandlerCont
Optional<TypeHandler<?>> declaredElementTypeHandler =
context.getTypeHandlerLibrary().getTypeHandler(elementType);
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
TypeHandler<?> elementTypeHandler = new RuntimeDelegatingTypeHandler(
declaredElementTypeHandler.orElse(null),
elementTypeInfo,
@ -59,7 +59,7 @@ public <T> Optional<TypeHandler<T>> create(TypeInfo<T> typeInfo, TypeHandlerCont
CollectionCopyConstructor constructor = ConstructorLibrary.getCollectionCopyConstructor((TypeInfo) typeInfo);
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
TypeHandler<T> typeHandler = new CollectionTypeHandler(elementTypeHandler, constructor);
return Optional.of(typeHandler);

View file

@ -41,7 +41,7 @@ public <T> Optional<TypeHandler<T>> create(TypeInfo<T> typeInfo, TypeHandlerCont
TypeInfo<?> valueTypeInfo = TypeInfo.of(valueType);
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
TypeHandler<?> valueTypeHandler = new RuntimeDelegatingTypeHandler(
declaredValueTypeHandler.orElse(null),
valueTypeInfo,
@ -54,7 +54,7 @@ public <T> Optional<TypeHandler<T>> create(TypeInfo<T> typeInfo, TypeHandlerCont
Optional<TypeHandler<?>> declaredKeyTypeHandler =
context.getTypeHandlerLibrary().getTypeHandler(keyType);
TypeInfo<?> keyTypeInfo = TypeInfo.of(keyType);
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
TypeHandler<?> keyTypeHandler = new RuntimeDelegatingTypeHandler(
declaredKeyTypeHandler.orElse(null),
keyTypeInfo,