use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class FlipHandler method swapWorld.
@InvokeEvent
public void swapWorld(WorldChangeEvent event) {
UUID id = UUIDUtil.getClientUUID();
if (id == null)
return;
Integer integer = rotateState.get(id);
rotateState.clear();
if (integer != null)
rotateState.put(id, integer);
}
use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class NotificationCenter method onClick.
@InvokeEvent
public void onClick(GuiClickEvent event) {
if (currentNotification != null && currentNotification.clickedCallback != null) {
ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
int left = currentNotification.getX(sr);
int top = currentNotification.getY(sr);
int right = left + currentNotification.width;
int bottom = top + currentNotification.height;
int mouseX = event.getMouseX();
int mouseY = event.getMouseY();
if (mouseX > left && mouseX < right && mouseY > top && mouseY < bottom) {
currentNotification.clickedCallback.run();
}
}
}
use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class MotionBlurMod method onClientTick.
@InvokeEvent
public void onClientTick(TickEvent event) {
if (Settings.MOTION_BLUR_ENABLED && !Minecraft.getMinecraft().entityRenderer.isShaderActive() && mc.theWorld != null && !isFastRenderEnabled()) {
applyShader();
}
if (domainResourceManagers == null) {
try {
Field[] var2 = SimpleReloadableResourceManager.class.getDeclaredFields();
for (Field field : var2) {
if (field.getType() == Map.class) {
field.setAccessible(true);
domainResourceManagers = (Map) field.get(Minecraft.getMinecraft().getResourceManager());
break;
}
}
} catch (Exception var6) {
throw new RuntimeException(var6);
}
}
if (!domainResourceManagers.containsKey("motionblur")) {
domainResourceManagers.put("motionblur", new MotionBlurResourceManager());
}
}
use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class NickHider method profileCheck.
@InvokeEvent
public void profileCheck(TickEvent event) {
if (nickHiderConfig.isMasterEnabled()) {
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
if (player == null)
return;
NetHandlerPlayClient sendQueue = player.sendQueue;
if (sendQueue == null)
return;
sendQueue.getPlayerInfoMap().stream().map(NetworkPlayerInfo::getGameProfile).forEach(gameProfile -> {
if (gameProfile.getId() != null && gameProfile.getId().equals(Minecraft.getMinecraft().getSession().getProfile().getId())) {
if (!gameProfile.getName().equalsIgnoreCase(Minecraft.getMinecraft().getSession().getProfile().getName())) {
remap(gameProfile.getName(), override == null ? Minecraft.getMinecraft().getSession().getProfile().getName() : override);
}
} else if (nickHiderConfig.isHideOtherNames()) {
remap(gameProfile.getName(), getPseudo(gameProfile.getName()));
}
});
}
}
use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class NickHider method bookCheck.
@InvokeEvent
public void bookCheck(TickEvent event) {
GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen;
if (currentScreen == null)
return;
if (currentScreen instanceof GuiScreenBook) {
NBTTagList bookPages = ((IMixinGuiScreenBook) currentScreen).getBookPages();
int currPage = ((IMixinGuiScreenBook) currentScreen).getCurrPage();
if (currPage < bookPages.tagCount()) {
try {
String textWithoutFormattingCodes = EnumChatFormatting.getTextWithoutFormattingCodes(IChatComponent.Serializer.jsonToComponent(bookPages.getStringTagAt(currPage)).getUnformattedText().replace("\n", " "));
Matcher matcher = newNick.matcher(textWithoutFormattingCodes);
if (matcher.find()) {
String nick = matcher.group("nick");
remap(nick, override == null ? Minecraft.getMinecraft().getSession().getProfile().getName() : override);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
Aggregations