HyCodeYourTale
classpublicPriority 3

TintOperation

com.hypixel.hytale.builtin.buildertools.tooloperations.TintOperation

extends ToolOperation

1

Methods

1

Public Methods

1

Fields

1

Constructors

Constructors

public
TintOperation(Ref<EntityStore> ref, Player player, BuilderToolOnUseInteraction packet, ComponentAccessor<EntityStore> componentAccessor)

Methods

Public Methods (1)

public
void execute(ComponentAccessor<EntityStore> componentAccessor)
@Override

Fields

Private/Package Fields (1)

privateint tintColor

Inheritance

Parent
Current
Interface
Child

Use mouse wheel to zoom, drag to pan. Click nodes to navigate.

Related Classes

Source Code

package com.hypixel.hytale.builtin.buildertools.tooloperations;

import com.hypixel.hytale.component.ComponentAccessor;
import com.hypixel.hytale.component.Ref;
import com.hypixel.hytale.protocol.packets.buildertools.BuilderToolOnUseInteraction;
import com.hypixel.hytale.server.core.Message;
import com.hypixel.hytale.server.core.asset.util.ColorParseUtil;
import com.hypixel.hytale.server.core.entity.entities.Player;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import javax.annotation.Nonnull;

public class TintOperation extends ToolOperation {
   private final int tintColor;

   public TintOperation(
      @Nonnull Ref<EntityStore> ref,
      @Nonnull Player player,
      @Nonnull BuilderToolOnUseInteraction packet,
      @Nonnull ComponentAccessor<EntityStore> componentAccessor
   ) {
      super(ref, packet, componentAccessor);
      String colorText = (String)this.args.tool().get("TintColor");

      try {
         this.tintColor = ColorParseUtil.hexStringToRGBInt(colorText);
      } catch (NumberFormatException var7) {
         player.sendMessage(Message.translation("server.builderTools.tintOperation.colorParseError").param("value", colorText));
         throw var7;
      }
   }

   @Override
   public void execute(ComponentAccessor<EntityStore> componentAccessor) {
      this.builderState.tint(this.x, this.y, this.z, this.tintColor, this.shape, this.shapeRange, componentAccessor);
   }

   @Override
   boolean execute0(int x, int y, int z) {
      return true;
   }
}