Skip to content

Commit

Permalink
Merge pull request #85 from AnonymousHacker1279/1.19.3-dev
Browse files Browse the repository at this point in the history
Update master branch with 1.19.3-dev changes
  • Loading branch information
AnonymousHacker1279 authored Mar 12, 2023
2 parents 0092ee3 + 2dddbda commit e029b66
Show file tree
Hide file tree
Showing 44 changed files with 690 additions and 328 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ community describe an interest in it (This excludes versions listed as **N/A - B
| MC Version | Immersive Weapons Latest Version |
|------------|--------------------------------------------------------------------------------------------------------------|
| 1.19.3 | [Latest](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases) |
| 1.19.2 | [N/A - Build From Source](https://github.com/AnonymousHacker1279/ImmersiveWeapons/tree/1.19.2-dev) |
| 1.19 | [1.18.4](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/1.18.4) |
| 1.18.2 | [1.17.4](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.17.4) |
| 1.18.1 | [(ALPHA) 1.14.0-alpha1](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.14.0-alpha1) |
Expand Down
12 changes: 5 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ minecraft {

property 'forge.logging.console.level', 'debug'

// For Patchouli to work in-dev
// For some dependencies to work in-dev
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"

Expand All @@ -69,7 +69,7 @@ minecraft {

property 'forge.logging.console.level', 'debug'

// For Patchouli to work in-dev
// For some dependencies to work in-dev
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"

Expand All @@ -89,7 +89,7 @@ minecraft {

property 'forge.logging.console.level', 'debug'

// For Patchouli to work in-dev
// For some dependencies to work in-dev
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"

Expand All @@ -110,22 +110,20 @@ minecraft {
sourceSets.main.resources { srcDir 'src/generated/resources' }

dependencies {
implementation 'org.jetbrains:annotations:23.0.0'
implementation 'org.jetbrains:annotations:24.0.1'

minecraft "net.minecraftforge:forge:${forge_version}"

// Include TerraBlender
implementation fg.deobf("com.github.glitchfiend:TerraBlender-forge:${terrablender_version}")

// Include Immersive Weapons Compatibility Bridge (IWCB)
// runtimeOnly fg.deobf("tech.anonymoushacker1279.iwcompatbridge:IWCompatBridge:${iwcb_version}")
runtimeOnly fg.deobf("tech.anonymoushacker1279.iwcompatbridge:IWCompatBridge:${iwcb_version}")
// Include JEI
runtimeOnly fg.deobf("mezz.jei:jei-1.19.3-forge:${jei_version}")
// Include WTHIT and badpackets
runtimeOnly fg.deobf("mcp.mobius.waila:wthit:forge-${wthit_version}")
implementation fg.deobf("lol.bai:badpackets:forge-${badpackets_version}")
// Include MmmMmmMmmMmm (Target Dummy)
// runtimeOnly fg.deobf("curse.maven:mmmmmmmmmmmm-225738:${target_dummy_version}") // TODO: Uncomment when ported to 1.19.3
}

java {
Expand Down
11 changes: 5 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ org.gradle.jvmargs=-Xmx6G
org.gradle.daemon=true
org.gradle.caching=true
org.gradle.parallel=true
version=1.19.3-1.20.0
version=1.19.3-1.20.1
group=tech.anonymoushacker1279.immersiveweapons
mappings_channel=parchment
mappings_version=2023.02.26-1.19.3
forge_version=1.19.3-44.1.21
mappings_version=2023.03.12-1.19.3
forge_version=1.19.3-44.1.23
terrablender_version=1.19.3-2.1.0.139
iwcb_version=1.19.3-1.2.0
jei_version=12.2.0.16
wthit_version=6.1.4
badpackets_version=0.3.4
target_dummy_version=4132216
wthit_version=6.2.0
badpackets_version=0.3.4
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@
"config.immersiveweapons.celestial_tower_minions_wave_size_modifier": "Multiplier to change the wave size from Celestial Tower summons.\nSet less than 1 to reduce, greater than 1 to increase.\nIncreasing the wave size will negatively affect the server ticks in Tiltros. - Default 1.0",
"config.immersiveweapons.celestial_tower_spawn_check_radius": "Set the spawn checking radius for the Celestial Tower.\nSetting this higher may slightly negatively impact server ticks in Tiltros, but make Celestial Lanterns more effective - Default 128",
"config.immersiveweapons.cursed_sight_staff_max_use_range": "Set the maximum range in blocks of the Cursed Sight Staff - Default 50",
"config.immersiveweapons.discovery_advancement_range": "Set the range for checking criteria of the discovery advancement (value is squared) - Default 50\nLowering this value may improve server performance,\n",
"config.immersiveweapons.fancy_smoke_grenade_particles": "Render smoke grenade particles at 66% of the regular size, spawn 3x more, and add translucency.\nThis will negatively impact performance, but make smoke grenades appear more realistic. - Default false",
"config.immersiveweapons.flintlock_pistol_fire_inaccuracy": "Set the inaccuracy of bullets fired by the Flintlock Pistol - Default 1.75",
"config.immersiveweapons.flintlock_pistol_fire_velocity": "Set the velocity of bullets fired by the Flintlock Pistol - Default 2.5",
Expand All @@ -421,6 +422,7 @@
"death.attack.immersiveweapons.bleeding": "%s bled to death",
"death.attack.immersiveweapons.bleeding.player": "%s bled to death at the hands of %s",
"death.attack.immersiveweapons.deadmans_desert": "%s was poisoned by the atmosphere",
"death.attack.immersiveweapons.deadmans_desert.player": "%s was poisoned by the atmosphere at the hands of %s",
"death.attack.immersiveweapons.deathweed": "%s was poisoned by deathweed",
"death.attack.immersiveweapons.deathweed.player": "%s was poisoned by deathweed at the hands of %s",
"death.attack.immersiveweapons.explosive_chocolate_bar": "%s learned to not accept candy from strangers",
Expand Down Expand Up @@ -500,6 +502,12 @@
"immersiveweapons.block.wall_shelf.locked": "This shelf has been locked",
"immersiveweapons.block.wall_shelf.unlocked": "This shelf has been unlocked",
"immersiveweapons.boss.celestial_tower.waves": "Wave %s of %s",
"immersiveweapons.debugTracing.celestialProtectionChanceForNoDamage": "Celestial Protection Chance: %s",
"immersiveweapons.debugTracing.damageBonus": "Damage Bonus: %s",
"immersiveweapons.debugTracing.gunBaseVelocity": "Gun Base Velocity: %s",
"immersiveweapons.debugTracing.liveBulletDamage": "Live Bullet Damage: %s (is crit: %s)",
"immersiveweapons.debugTracing.meleeItemDamage": "Melee Item Damage: %s",
"immersiveweapons.debugTracing.selectedAmmo": "Selected Ammo: %s (base damage: %s)",
"immersiveweapons.item.azul_locator.no_spawn": "Unable to teleport: No spawn point set.",
"immersiveweapons.item.azul_locator.teleported": "Teleported to spawn point!",
"immersiveweapons.item.azul_locator.teleporting": "Teleporting to spawn point in %s seconds...",
Expand Down Expand Up @@ -726,6 +734,7 @@
"itemGroup.immersiveweapons.creative_tab": "Immersive Weapons",
"key.categories.immersiveweapons": "Immersive Weapons",
"key.immersiveweapons.astralArmorDashEffect": "Astral Armor Dash",
"key.immersiveweapons.debugTracing": "Debug Tracing",
"key.immersiveweapons.toggleArmorEffect": "Toggle Armor Effect",
"loot.immersiveweapons.chest.village.battlefield.medic_station.iron_axe": "The Amputator",
"subtitles.immersiveweapons.armor.astral.equip": "Astral armor resonates",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"type": "minecraft:crafting_shaped",
"category": "building",
"group": "wooden_slab",
"key": {
"a": {
"item": "immersiveweapons:burned_oak_planks"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"type": "minecraft:crafting_shaped",
"category": "building",
"group": "wooden_stairs",
"key": {
"a": {
"item": "immersiveweapons:burned_oak_planks"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"type": "minecraft:stonecutting",
"count": 2,
"group": "mud",
"ingredient": {
"item": "immersiveweapons:hardened_mud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"type": "minecraft:stonecutting",
"count": 1,
"group": "mud",
"ingredient": {
"item": "immersiveweapons:hardened_mud"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"type": "minecraft:crafting_shaped",
"category": "building",
"group": "wooden_slab",
"key": {
"a": {
"item": "immersiveweapons:stardust_planks"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"type": "minecraft:crafting_shaped",
"category": "building",
"group": "wooden_stairs",
"key": {
"a": {
"item": "immersiveweapons:stardust_planks"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"group": "tesla",
"key": {
"a": {
"item": "minecraft:netherite_block"
"item": "minecraft:netherite_ingot"
},
"b": {
"item": "immersiveweapons:molten_block"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "minecraft:ore",
"config": {
"discard_chance_on_air_exposure": 1.0,
"size": 2,
"size": 4,
"targets": [
{
"state": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"height": {
"type": "minecraft:trapezoid",
"max_inclusive": {
"absolute": 72
"absolute": 48
},
"min_inclusive": {
"absolute": -64
"absolute": 0
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ public void entityInside(BlockPos pos, Entity entity) {
entity.portalEntrancePos = pos.immutable();
}

Level entityWorld = entity.level;
MinecraftServer server = entityWorld.getServer();
ResourceKey<Level> destination = entityWorld.dimension() == IWDimensions.TILTROS ? Level.OVERWORLD
Level entityLevel = entity.level;
MinecraftServer server = entityLevel.getServer();
ResourceKey<Level> destination = entityLevel.dimension() == IWDimensions.TILTROS ? Level.OVERWORLD
: IWDimensions.TILTROS;

if (server != null) {
ServerLevel destinationLevel = server.getLevel(destination);
if (destinationLevel != null && !entity.isPassenger()) {
entityWorld.getProfiler().push("tiltros_portal");
entityLevel.getProfiler().push("tiltros_portal");
entity.setPortalCooldown();

// Get a valid target position if it is unset
Expand All @@ -55,7 +55,7 @@ public void entityInside(BlockPos pos, Entity entity) {

entity.changeDimension(destinationLevel, new TiltrosTeleporter(targetPos, pos));

entityWorld.getProfiler().pop();
entityLevel.getProfiler().pop();
}
}
} else if (teleportDelay > 0) {
Expand Down Expand Up @@ -84,7 +84,22 @@ private BlockPos findValidTeleportPosition(ServerLevel destinationLevel, BlockPo
BlockPos pos = new BlockPos(x + i, y, z + j);
if (!destinationLevel.getBiome(pos).is(IWBiomes.DEADMANS_DESERT)) {
// Move the target position at least 10 blocks away from the edge of the chunk
targetPos = new BlockPos(pos.getX() + 10, pos.getY(), pos.getZ() + 10);
// Determine if 10 should be added or subtracted to either the X or Z coordinate
int xDiff = Math.abs(pos.getX() - x);
int zDiff = Math.abs(pos.getZ() - z);
if (xDiff > zDiff) {
if (pos.getX() > x) {
targetPos = pos.offset(10, 0, 0);
} else {
targetPos = pos.offset(-10, 0, 0);
}
} else {
if (pos.getZ() > z) {
targetPos = pos.offset(0, 0, 10);
} else {
targetPos = pos.offset(0, 0, -10);
}
}
found = true;
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public class IWKeyBinds {
public static final KeyMapping ASTRAL_ARMOR_DASH_EFFECT = new KeyMapping("key." + ImmersiveWeapons.MOD_ID + ".astralArmorDashEffect",
KeyConflictContext.IN_GAME,
Type.MOUSE,
5, // Mouse button 5
4, // Mouse button 5
CATEGORY);
public static final KeyMapping DEBUG_TRACING = new KeyMapping("key." + ImmersiveWeapons.MOD_ID + ".debugTracing",
KeyConflictContext.IN_GAME,
Type.KEYSYM,
InputConstants.KEY_F9,
CATEGORY);
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package tech.anonymoushacker1279.immersiveweapons.client.gui;

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.gui.Font;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.client.gui.overlay.IGuiOverlay;
import org.jetbrains.annotations.Nullable;
import tech.anonymoushacker1279.immersiveweapons.ImmersiveWeapons;
import tech.anonymoushacker1279.immersiveweapons.client.gui.overlays.DebugTracingOverlay;
import tech.anonymoushacker1279.immersiveweapons.client.gui.overlays.ScopeOverlay;
import tech.anonymoushacker1279.immersiveweapons.item.projectile.gun.data.GunData;

public class IWOverlays {
Expand All @@ -16,65 +16,26 @@ public class IWOverlays {

@Nullable
public static IGuiOverlay SCOPE_ELEMENT;
@Nullable
public static IGuiOverlay DEBUG_TRACING_ELEMENT;

public static void init() {
ImmersiveWeapons.LOGGER.info("Initializing overlays");

Minecraft minecraft = Minecraft.getInstance();
Font fontRenderer = minecraft.font;

SCOPE_ELEMENT = (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
gui.setupOverlayRenderState(true, false);

Minecraft minecraft = Minecraft.getInstance();
if (GunData.changingPlayerFOV != -1 && minecraft.options.getCameraType().isFirstPerson()) {
renderScope(screenWidth, screenHeight, GunData.scopeScale);
ScopeOverlay.renderOverlay(screenWidth, screenHeight, GunData.scopeScale);
}
};
}

private static void renderScope(int screenWidth, int screenHeight, float scopeScale) {
RenderSystem.depthMask(false);
RenderSystem.setShaderColor(0.0f, 0.0f, 0.0f, 0.1f);
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderTexture(0, SCOPE_LOCATION);
Tesselator tesselator = Tesselator.getInstance();
BufferBuilder bufferbuilder = tesselator.getBuilder();
float minScreenWidthAndHeight = (float) Math.min(screenWidth, screenHeight);
float scaled = Math.min((float) screenWidth / minScreenWidthAndHeight, (float) screenHeight / minScreenWidthAndHeight) * scopeScale;
float scaledMinScreeWidthAndHeight = minScreenWidthAndHeight * scaled;
float x = ((float) screenWidth - scaledMinScreeWidthAndHeight) / 2.0F;
float y = ((float) screenHeight - scaledMinScreeWidthAndHeight) / 2.0F;
float x1 = x + scaledMinScreeWidthAndHeight;
float y1 = y + scaledMinScreeWidthAndHeight;
bufferbuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX);
bufferbuilder.vertex(x, y1, -90.0D).uv(0.0F, 1.0F).endVertex();
bufferbuilder.vertex(x1, y1, -90.0D).uv(1.0F, 1.0F).endVertex();
bufferbuilder.vertex(x1, y, -90.0D).uv(1.0F, 0.0F).endVertex();
bufferbuilder.vertex(x, y, -90.0D).uv(0.0F, 0.0F).endVertex();
tesselator.end();
RenderSystem.setShader(GameRenderer::getPositionColorShader);
RenderSystem.disableTexture();
bufferbuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR);
bufferbuilder.vertex(0.0D, screenHeight, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(screenWidth, screenHeight, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(screenWidth, y1, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(0.0D, y1, -90.0D).color(0, 0, 0, 255).endVertex();

bufferbuilder.vertex(0.0D, y, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(screenWidth, y, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(screenWidth, 0.0D, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(0.0D, 0.0D, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(0.0D, y1, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(x, y1, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(x, y, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(0.0D, y, -90.0D).color(0, 0, 0, 255).endVertex();

bufferbuilder.vertex(x1, y1, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(screenWidth, y1, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(screenWidth, y, -90.0D).color(0, 0, 0, 255).endVertex();
bufferbuilder.vertex(x1, y, -90.0D).color(0, 0, 0, 255).endVertex();
tesselator.end();
RenderSystem.enableTexture();
RenderSystem.depthMask(true);
RenderSystem.enableDepthTest();
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
DEBUG_TRACING_ELEMENT = (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
gui.setupOverlayRenderState(true, false);
DebugTracingOverlay.renderOverlay(poseStack, fontRenderer, screenHeight);
};
}
}
Loading

0 comments on commit e029b66

Please sign in to comment.