Вот вам 1 завоз ! EXP 3.1 ! RichEsp

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
20 Апр 2023
Сообщения
157
Реакции
0
    1. package im.expensive.functions.impl.render;
    2. import com.google.common.eventbus.Subscribe;
    3. import com.mojang.blaze3d.systems.RenderSystem;
    4. import im.expensive.events.EventDisplay;
    5. import im.expensive.functions.api.Category;
    6. import im.expensive.functions.api.Function;
    7. import im.expensive.functions.api.FunctionRegister;
    8. import im.expensive.functions.settings.impl.ModeSetting;
    9. import im.expensive.utils.math.MathUtil;
    10. import im.expensive.utils.projections.ProjectionUtil;
    11. import im.expensive.utils.render.ColorUtils;
    12. import im.expensive.utils.render.DisplayUtils;
    13. import net.minecraft.client.renderer.BufferBuilder;
    14. import net.minecraft.client.renderer.Tessellator;
    15. import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
    16. import net.minecraft.entity.Entity;
    17. import net.minecraft.entity.item.ItemEntity;
    18. import net.minecraft.item.ItemStack;
    19. import net.minecraft.item.Items;
    20. import net.minecraft.util.math.AxisAlignedBB;
    21. import net.minecraft.util.math.vector.Vector2f;
    22. import net.minecraft.util.math.vector.Vector3d;
    23. import net.minecraft.util.math.vector.Vector4f;
    24. import java.util.HashMap;
    25. import java.util.Map;
    26. @FunctionRegister(name = "RichEsp", type = Category.Render)
    27. public class RichEsp extends Function {
    28. private final HashMap<Entity, Vector4f> positions = new HashMap<>();
    29. //
    30. private final ModeSetting modeSetting = new ModeSetting("Mode", "All", "", "", "", "", "All");
    31. public RichEsp() {
    32. addSettings(modeSetting);
    33. }
    34. @Subscribe
    35. public void onDisplay(EventDisplay e) {
    36. if (mc.world == null || e.getType() != EventDisplay.Type.PRE) {
    37. return;
    38. }
    39. positions.clear();
    40. for (Entity entity : mc.world.getAllEntities()) {
    41. if (!(entity instanceof ItemEntity itemEntity)) continue;
    42. //
    43. ItemStack itemStack = itemEntity.getItem();
    44. boolean isDiamond = itemStack.getItem() == Items.DIAMOND;
    45. boolean isPlayerHead = itemStack.getItem() == Items.PLAYER_HEAD;
    46. boolean isTotem = itemStack.getItem() == Items.TOTEM_OF_UNDYING;
    47. boolean isОТМЫЧКа = itemStack.getItem() == Items.TRIPWIRE_HOOK;
    48. boolean isNetheriteIngot = itemStack.getItem() == Items.NETHERITE_INGOT;
    49. boolean isNetheriteSword = itemStack.getItem() == Items.NETHERITE_SWORD;
    50. boolean isNetheritePickaxe = itemStack.getItem() == Items.NETHERITE_PICKAXE;
    51. //
    52. if (!isEntityVisible(isDiamond, isPlayerHead, isTotem, isОТМЫЧКа, isNetheriteIngot, isNetheritePickaxe, isNetheriteSword)) continue;
    53. //
    54. double x = MathUtil.interpolate(entity.getPosX(), entity.lastTickPosX, e.getPartialTicks());
    55. double y = MathUtil.interpolate(entity.getPosY(), entity.lastTickPosY, e.getPartialTicks());
    56. double z = MathUtil.interpolate(entity.getPosZ(), entity.lastTickPosZ, e.getPartialTicks());
    57. Vector3d size = new Vector3d(entity.getBoundingBox().maxX - entity.getBoundingBox().minX, entity.getBoundingBox().maxY - entity.getBoundingBox().minY, entity.getBoundingBox().maxZ - entity.getBoundingBox().minZ);
    58. AxisAlignedBB aabb = new AxisAlignedBB(x - size.x / 1.5f, y, z - size.z / 1.5f, x + size.x / 1.5f, y + size.y + 0.1f, z + size.z / 1.5f);
    59. Vector4f position = null;
    60. for (int i = 0; i < 8; i++) {
    61. Vector2f vector = ProjectionUtil.project(i % 2 == 0 ? aabb.minX : aabb.maxX, (i / 2) % 2 == 0 ? aabb.minY : aabb.maxY, (i / 4) % 2 == 0 ? aabb.minZ : aabb.maxZ);
    62. if (position == null) {
    63. position = new Vector4f(vector.x, vector.y, 1, 1.0f);
    64. } else {
    65. position.x = Math.min(vector.x, position.x);
    66. position.y = Math.min(vector.y, position.y);
    67. position.z = Math.max(vector.x, position.z);
    68. position.w = Math.max(vector.y, position.w);
    69. }
    70. }
    71. positions.put(entity, position);
    72. }
    73. RenderSystem.enableBlend();
    74. RenderSystem.disableTexture();
    75. RenderSystem.defaultBlendFunc();
    76. RenderSystem.shadeModel(7425);
    77. BufferBuilder builder = Tessellator.getInstance().getBuffer();
    78. builder.begin(7, DefaultVertexFormats.POSITION_COLOR);
    79. for (Map.Entry<Entity, Vector4f> entry : positions.entrySet()) {
    80. Vector4f position = entry.getValue();
    81. ItemEntity itemEntity = (ItemEntity) entry.getKey();
    82. //
    83. int color = 0;
    84. if (itemEntity instanceof ItemEntity) {
    85. if (itemEntity.getItem().getItem() == Items.DIAMOND) {
    86. color = ColorUtils.rgba(0, 0, 255, 255); //
    87. } else if (itemEntity.getItem().getItem() == Items.PLAYER_HEAD) {
    88. color = ColorUtils.rgba(255, 0, 0, 255); //
    89. } else if (itemEntity.getItem().getItem() == Items.TOTEM_OF_UNDYING) {
    90. color = ColorUtils.rgba(255, 128, 0, 255); //
    91. } else if (itemEntity.getItem().getItem() == Items.TRIPWIRE_HOOK) {
    92. color = ColorUtils.rgba(128, 0, 128, 255); //
    93. } else if (itemEntity.getItem().getItem() == Items.NETHERITE_INGOT) {
    94. color = ColorUtils.rgba(0, 255, 0, 255); //
    95. } else if (itemEntity.getItem().getItem() == Items.NETHERITE_PICKAXE) {
    96. color = ColorUtils.rgba(255, 0, 127, 255); //
    97. } else if (itemEntity.getItem().getItem() == Items.NETHERITE_SWORD) {
    98. color = ColorUtils.rgba(102, 255, 255, 255); //
    99. }
    100. DisplayUtils.drawBox(position.x, position.y, position.z, position.w, 1.5F, color);
    101. }
    102. }
    103. Tessellator.getInstance().draw();
    104. RenderSystem.shadeModel(7424);
    105. RenderSystem.enableTexture();
    106. RenderSystem.disableBlend();
    107. }
    108. private boolean isEntityVisible(boolean isDiamond, boolean isPlayerHead, boolean isTotem, boolean isОТМЫЧКА, boolean isNetheriteIngot, boolean isNetheritePickaxe, boolean isNetheriteSword) {
    109. switch (modeSetting.getName()) {
    110. case "Diamonds":
    111. return isDiamond;
    112. case "Player_Heads":
    113. return isPlayerHead;
    114. case "Totems":
    115. return isTotem;
    116. case "NetheriteIngot":
    117. return isNetheriteIngot;
    118. case "NetheritePickaxe":
    119. return isNetheriteIngot;
    120. case "NetheriteSword":
    121. return isNetheriteIngot;
    122. case "TRIPWIRE_HOOK":
    123. return isОТМЫЧКА; //
    124. case "All":
    125. default:
    126. return isDiamond || isPlayerHead || isTotem || isОТМЫЧКА || isNetheriteIngot || isNetheritePickaxe || isNetheriteSword;
    127. }
    128. }
    129. //
    130. }
    Пастите если такое название было не обесуйте поменяете название вроде на юге было такое же ток это другое код другой(:
 
Последнее редактирование:
    1. package im.expensive.functions.impl.render;
    2. import com.google.common.eventbus.Subscribe;
    3. import com.mojang.blaze3d.systems.RenderSystem;
    4. import im.expensive.events.EventDisplay;
    5. import im.expensive.functions.api.Category;
    6. import im.expensive.functions.api.Function;
    7. import im.expensive.functions.api.FunctionRegister;
    8. import im.expensive.functions.settings.impl.ModeSetting;
    9. import im.expensive.utils.math.MathUtil;
    10. import im.expensive.utils.projections.ProjectionUtil;
    11. import im.expensive.utils.render.ColorUtils;
    12. import im.expensive.utils.render.DisplayUtils;
    13. import net.minecraft.client.renderer.BufferBuilder;
    14. import net.minecraft.client.renderer.Tessellator;
    15. import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
    16. import net.minecraft.entity.Entity;
    17. import net.minecraft.entity.item.ItemEntity;
    18. import net.minecraft.item.ItemStack;
    19. import net.minecraft.item.Items;
    20. import net.minecraft.util.math.AxisAlignedBB;
    21. import net.minecraft.util.math.vector.Vector2f;
    22. import net.minecraft.util.math.vector.Vector3d;
    23. import net.minecraft.util.math.vector.Vector4f;
    24. import java.util.HashMap;
    25. import java.util.Map;
    26. @FunctionRegister(name = "RichEsp", type = Category.Render)
    27. public class RichEsp extends Function {
    28. private final HashMap<Entity, Vector4f> positions = new HashMap<>();
    29. //
    30. private final ModeSetting modeSetting = new ModeSetting("Mode", "All", "", "", "", "", "All");
    31. public RichEsp() {
    32. addSettings(modeSetting);
    33. }
    34. @Subscribe
    35. public void onDisplay(EventDisplay e) {
    36. if (mc.world == null || e.getType() != EventDisplay.Type.PRE) {
    37. return;
    38. }
    39. positions.clear();
    40. for (Entity entity : mc.world.getAllEntities()) {
    41. if (!(entity instanceof ItemEntity itemEntity)) continue;
    42. //
    43. ItemStack itemStack = itemEntity.getItem();
    44. boolean isDiamond = itemStack.getItem() == Items.DIAMOND;
    45. boolean isPlayerHead = itemStack.getItem() == Items.PLAYER_HEAD;
    46. boolean isTotem = itemStack.getItem() == Items.TOTEM_OF_UNDYING;
    47. boolean isОТМЫЧКа = itemStack.getItem() == Items.TRIPWIRE_HOOK;
    48. boolean isNetheriteIngot = itemStack.getItem() == Items.NETHERITE_INGOT;
    49. boolean isNetheriteSword = itemStack.getItem() == Items.NETHERITE_SWORD;
    50. boolean isNetheritePickaxe = itemStack.getItem() == Items.NETHERITE_PICKAXE;
    51. //
    52. if (!isEntityVisible(isDiamond, isPlayerHead, isTotem, isОТМЫЧКа, isNetheriteIngot, isNetheritePickaxe, isNetheriteSword)) continue;
    53. //
    54. double x = MathUtil.interpolate(entity.getPosX(), entity.lastTickPosX, e.getPartialTicks());
    55. double y = MathUtil.interpolate(entity.getPosY(), entity.lastTickPosY, e.getPartialTicks());
    56. double z = MathUtil.interpolate(entity.getPosZ(), entity.lastTickPosZ, e.getPartialTicks());
    57. Vector3d size = new Vector3d(entity.getBoundingBox().maxX - entity.getBoundingBox().minX, entity.getBoundingBox().maxY - entity.getBoundingBox().minY, entity.getBoundingBox().maxZ - entity.getBoundingBox().minZ);
    58. AxisAlignedBB aabb = new AxisAlignedBB(x - size.x / 1.5f, y, z - size.z / 1.5f, x + size.x / 1.5f, y + size.y + 0.1f, z + size.z / 1.5f);
    59. Vector4f position = null;
    60. for (int i = 0; i < 8; i++) {
    61. Vector2f vector = ProjectionUtil.project(i % 2 == 0 ? aabb.minX : aabb.maxX, (i / 2) % 2 == 0 ? aabb.minY : aabb.maxY, (i / 4) % 2 == 0 ? aabb.minZ : aabb.maxZ);
    62. if (position == null) {
    63. position = new Vector4f(vector.x, vector.y, 1, 1.0f);
    64. } else {
    65. position.x = Math.min(vector.x, position.x);
    66. position.y = Math.min(vector.y, position.y);
    67. position.z = Math.max(vector.x, position.z);
    68. position.w = Math.max(vector.y, position.w);
    69. }
    70. }
    71. positions.put(entity, position);
    72. }
    73. RenderSystem.enableBlend();
    74. RenderSystem.disableTexture();
    75. RenderSystem.defaultBlendFunc();
    76. RenderSystem.shadeModel(7425);
    77. BufferBuilder builder = Tessellator.getInstance().getBuffer();
    78. builder.begin(7, DefaultVertexFormats.POSITION_COLOR);
    79. for (Map.Entry<Entity, Vector4f> entry : positions.entrySet()) {
    80. Vector4f position = entry.getValue();
    81. ItemEntity itemEntity = (ItemEntity) entry.getKey();
    82. //
    83. int color = 0;
    84. if (itemEntity instanceof ItemEntity) {
    85. if (itemEntity.getItem().getItem() == Items.DIAMOND) {
    86. color = ColorUtils.rgba(0, 0, 255, 255); //
    87. } else if (itemEntity.getItem().getItem() == Items.PLAYER_HEAD) {
    88. color = ColorUtils.rgba(255, 0, 0, 255); //
    89. } else if (itemEntity.getItem().getItem() == Items.TOTEM_OF_UNDYING) {
    90. color = ColorUtils.rgba(255, 128, 0, 255); //
    91. } else if (itemEntity.getItem().getItem() == Items.TRIPWIRE_HOOK) {
    92. color = ColorUtils.rgba(128, 0, 128, 255); //
    93. } else if (itemEntity.getItem().getItem() == Items.NETHERITE_INGOT) {
    94. color = ColorUtils.rgba(0, 255, 0, 255); //
    95. } else if (itemEntity.getItem().getItem() == Items.NETHERITE_PICKAXE) {
    96. color = ColorUtils.rgba(255, 0, 127, 255); //
    97. } else if (itemEntity.getItem().getItem() == Items.NETHERITE_SWORD) {
    98. color = ColorUtils.rgba(102, 255, 255, 255); //
    99. }
    100. DisplayUtils.drawBox(position.x, position.y, position.z, position.w, 1.5F, color);
    101. }
    102. }
    103. Tessellator.getInstance().draw();
    104. RenderSystem.shadeModel(7424);
    105. RenderSystem.enableTexture();
    106. RenderSystem.disableBlend();
    107. }
    108. private boolean isEntityVisible(boolean isDiamond, boolean isPlayerHead, boolean isTotem, boolean isОТМЫЧКА, boolean isNetheriteIngot, boolean isNetheritePickaxe, boolean isNetheriteSword) {
    109. switch (modeSetting.getName()) {
    110. case "Diamonds":
    111. return isDiamond;
    112. case "Player_Heads":
    113. return isPlayerHead;
    114. case "Totems":
    115. return isTotem;
    116. case "NetheriteIngot":
    117. return isNetheriteIngot;
    118. case "NetheritePickaxe":
    119. return isNetheriteIngot;
    120. case "NetheriteSword":
    121. return isNetheriteIngot;
    122. case "TRIPWIRE_HOOK":
    123. return isОТМЫЧКА; //
    124. case "All":
    125. default:
    126. return isDiamond || isPlayerHead || isTotem || isОТМЫЧКА || isNetheriteIngot || isNetheritePickaxe || isNetheriteSword;
    127. }
    128. }
    129. //
    130. }
    Пастите если такое название было не обесуйте поменяете название вроде на юге было такое же ток это другое код другой(:
ss?
 
видео лень записывать обыч подсветка предметов и название тип сфера и там когда бросаешь видешь название и уровень сферы думаю это все знают(:
что же ещё выложить
 
code:
Expand Collapse Copy
package im.expensive.functions.impl.render;
import com.google.common.eventbus.Subscribe;
import com.mojang.blaze3d.systems.RenderSystem;
import im.expensive.events.EventDisplay;
import im.expensive.functions.api.Category;
import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import im.expensive.functions.settings.impl.ModeSetting;
import im.expensive.utils.math.MathUtil;
import im.expensive.utils.projections.ProjectionUtil;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector4f;
import java.util.HashMap;
import java.util.Map;
@FunctionRegister(name = "RichEsp", type = Category.Render)
public class RichEsp extends Function {
private final HashMap<Entity, Vector4f> positions = new HashMap<>();
//
private final ModeSetting modeSetting = new ModeSetting("Mode", "All", "", "", "", "", "All");
public RichEsp() {
addSettings(modeSetting);
}
@Subscribe
public void onDisplay(EventDisplay e) {
if (mc.world == null || e.getType() != EventDisplay.Type.PRE) {
return;
}
positions.clear();
for (Entity entity : mc.world.getAllEntities()) {
if (!(entity instanceof ItemEntity itemEntity)) continue;
//
ItemStack itemStack = itemEntity.getItem();
boolean isDiamond = itemStack.getItem() == Items.DIAMOND;
boolean isPlayerHead = itemStack.getItem() == Items.PLAYER_HEAD;
boolean isTotem = itemStack.getItem() == Items.TOTEM_OF_UNDYING;
boolean isОТМЫЧКа = itemStack.getItem() == Items.TRIPWIRE_HOOK;
boolean isNetheriteIngot = itemStack.getItem() == Items.NETHERITE_INGOT;
boolean isNetheriteSword = itemStack.getItem() == Items.NETHERITE_SWORD;
boolean isNetheritePickaxe = itemStack.getItem() == Items.NETHERITE_PICKAXE;
//
if (!isEntityVisible(isDiamond, isPlayerHead, isTotem, isОТМЫЧКа, isNetheriteIngot, isNetheritePickaxe, isNetheriteSword)) continue;
//
double x = MathUtil.interpolate(entity.getPosX(), entity.lastTickPosX, e.getPartialTicks());
double y = MathUtil.interpolate(entity.getPosY(), entity.lastTickPosY, e.getPartialTicks());
double z = MathUtil.interpolate(entity.getPosZ(), entity.lastTickPosZ, e.getPartialTicks());
Vector3d size = new Vector3d(entity.getBoundingBox().maxX - entity.getBoundingBox().minX, entity.getBoundingBox().maxY - entity.getBoundingBox().minY, entity.getBoundingBox().maxZ - entity.getBoundingBox().minZ);
AxisAlignedBB aabb = new AxisAlignedBB(x - size.x / 1.5f, y, z - size.z / 1.5f, x + size.x / 1.5f, y + size.y + 0.1f, z + size.z / 1.5f);
Vector4f position = null;
for (int i = 0; i < 8; i++) {
Vector2f vector = ProjectionUtil.project(i % 2 == 0 ? aabb.minX : aabb.maxX, (i / 2) % 2 == 0 ? aabb.minY : aabb.maxY, (i / 4) % 2 == 0 ? aabb.minZ : aabb.maxZ);
if (position == null) {
position = new Vector4f(vector.x, vector.y, 1, 1.0f);
} else {
position.x = Math.min(vector.x, position.x);
position.y = Math.min(vector.y, position.y);
position.z = Math.max(vector.x, position.z);
position.w = Math.max(vector.y, position.w);
}
}
positions.put(entity, position);
}
RenderSystem.enableBlend();
RenderSystem.disableTexture();
RenderSystem.defaultBlendFunc();
RenderSystem.shadeModel(7425);
BufferBuilder builder = Tessellator.getInstance().getBuffer();
builder.begin(7, DefaultVertexFormats.POSITION_COLOR);
for (Map.Entry<Entity, Vector4f> entry : positions.entrySet()) {
Vector4f position = entry.getValue();
ItemEntity itemEntity = (ItemEntity) entry.getKey();
//
int color = 0;
if (itemEntity instanceof ItemEntity) {
if (itemEntity.getItem().getItem() == Items.DIAMOND) {
color = ColorUtils.rgba(0, 0, 255, 255); //
} else if (itemEntity.getItem().getItem() == Items.PLAYER_HEAD) {
color = ColorUtils.rgba(255, 0, 0, 255); //
} else if (itemEntity.getItem().getItem() == Items.TOTEM_OF_UNDYING) {
color = ColorUtils.rgba(255, 128, 0, 255); //
} else if (itemEntity.getItem().getItem() == Items.TRIPWIRE_HOOK) {
color = ColorUtils.rgba(128, 0, 128, 255); //
} else if (itemEntity.getItem().getItem() == Items.NETHERITE_INGOT) {
color = ColorUtils.rgba(0, 255, 0, 255); //
} else if (itemEntity.getItem().getItem() == Items.NETHERITE_PICKAXE) {
color = ColorUtils.rgba(255, 0, 127, 255); //
} else if (itemEntity.getItem().getItem() == Items.NETHERITE_SWORD) {
color = ColorUtils.rgba(102, 255, 255, 255); //
}
DisplayUtils.drawBox(position.x, position.y, position.z, position.w, 1.5F, color);
}
}
Tessellator.getInstance().draw();
RenderSystem.shadeModel(7424);
RenderSystem.enableTexture();
RenderSystem.disableBlend();
}
private boolean isEntityVisible(boolean isDiamond, boolean isPlayerHead, boolean isTotem, boolean isОТМЫЧКА, boolean isNetheriteIngot, boolean isNetheritePickaxe, boolean isNetheriteSword) {
switch (modeSetting.getName()) {
case "Diamonds":
return isDiamond;
case "Player_Heads":
return isPlayerHead;
case "Totems":
return isTotem;
case "NetheriteIngot":
return isNetheriteIngot;
case "NetheritePickaxe":
return isNetheriteIngot;
case "NetheriteSword":
return isNetheriteIngot;
case "TRIPWIRE_HOOK":
return isОТМЫЧКА; //
case "All":
default:
return isDiamond || isPlayerHead || isTotem || isОТМЫЧКА || isNetheriteIngot || isNetheritePickaxe || isNetheriteSword;
}
}
//
}
[/USERS]
 
Назад
Сверху Снизу