Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/dev/galacticraft/mod/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ interface Item {
String TITANIUM_HOE = "titanium_hoe";

String STANDARD_WRENCH = "standard_wrench";
// String GRAPPLING_HOOK = "grappling_hook";
String TITANTIUM_UPGRADE_SMITHING_TEMPLATE = "titanium_upgrade_smithing_template";
String BATTERY = "battery";
String INFINITE_BATTERY = "infinite_battery";
Expand Down
1 change: 1 addition & 0 deletions src/main/java/dev/galacticraft/mod/GalacticraftClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public void onInitializeClient() {
EntityRendererRegistry.register(GCEntityTypes.PARACHEST, ParachestRenderer::new);
EntityRendererRegistry.register(GCEntityTypes.THROWABLE_METEOR_CHUNK, ThrownItemRenderer::new);
EntityRendererRegistry.register(GCEntityTypes.SKELETON_BOSS, EvolvedSkeletonBossRenderer::new);
// EntityRendererRegistry.register(GCEntityTypes.GRAPPLE_HOOK, GrappleHookRenderer::new);

GCBlockEntityRenderer.register();
GCClientPacketReceiver.register();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public static ShaderInstance getRendertypeBubbleShader() {
.setShaderState(BUBBLE_SHADER)
.setTextureState(new RenderStateShard.TextureStateShard(texture, false, false))
.setTransparencyState(RenderType.TRANSLUCENT_TRANSPARENCY)
.setDepthTestState(new RenderStateShard.DepthTestStateShard("less", 513))
.setCullState(RenderType.NO_CULL)
.setWriteMaskState(RenderType.COLOR_WRITE)
.setOverlayState(RenderType.OVERLAY)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright (c) 2019-2025 Team Galacticraft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package dev.galacticraft.mod.client.render.entity;



/*
public class GrappleHookRenderer extends EntityRenderer<GrappleHookEntity> {
public GrappleHookRenderer(EntityRendererProvider.Context context) {
super(context);
}

@Override
public void render(GrappleHookEntity entity, float yaw, float tickDelta, PoseStack matrices, MultiBufferSource vertexConsumers, int light) {
Player player = (Player) entity.getOwner();
if (player == null) {
return;
}

matrices.pushPose();
VertexConsumer consumer = vertexConsumers.getBuffer(RenderType.lines());
Matrix4f pose = matrices.last().pose();

// consumer.vertex(pose, 0, 0, 0).color(0, 0, 0, 255).normal(1, 0, 0).endVertex();
// consumer.vertex(pose, (float) (player.getX() - entity.getX()), (float) (player.getEyeY() - entity.getY()), (float) (player.getZ() - entity.getZ())).color(0, 0, 0, 255).normal(1, 0, 0).endVertex();

matrices.popPose();

super.render(entity, yaw, tickDelta, matrices, vertexConsumers, light);
}

@Override
public ResourceLocation getTextureLocation(GrappleHookEntity entity) {
return null;
}
}
*/
3 changes: 3 additions & 0 deletions src/main/java/dev/galacticraft/mod/content/GCEntityTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ public class GCEntityTypes {
public static final EntityType<ThrowableMeteorChunkEntity> THROWABLE_METEOR_CHUNK = ENTITIES.register(Constant.Item.THROWABLE_METEOR_CHUNK, EntityType.Builder.<ThrowableMeteorChunkEntity>of(ThrowableMeteorChunkEntity::new, MobCategory.MISC)
.sized(0.25F, 0.25F)
.build());
// public static final EntityType<GrappleHookEntity> GRAPPLE_HOOK = ENTITIES.register(Entity.GRAPPLE_HOOK, EntityType.Builder.<GrappleHookEntity>of(GrappleHookEntity::new, MobCategory.MISC)
// .sized(0.25F, 0.25F)
// .build());
// Bosses
public static final EntityType<SkeletonBoss> SKELETON_BOSS = ENTITIES.register(Entity.EVOLVED_SKELETON_BOSS, EntityType.Builder.of(SkeletonBoss::new, MobCategory.MONSTER)
.sized(1.5F, 4.0F)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* Copyright (c) 2019-2025 Team Galacticraft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package dev.galacticraft.mod.content.entity;



/*
public class GrappleHookEntity extends Projectile {
private Player player;
private boolean attached = false;

public GrappleHookEntity(EntityType<? extends Projectile> entityType, Level level) {
super(entityType, level);
}

public GrappleHookEntity(Level level, Player player) {
super(GCEntityTypes.GRAPPLE_HOOK, level);
this.setOwner(player);
this.player = player;
}

@Override
protected void initDataTracker() {
}

@Override
public void tick() {
if (!this.attached) {
super.tick();
HitResult hitResult = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity);
if (hitResult.getType() != HitResult.Type.MISS) {
this.onHit(hitResult);
}

Vec3 vec3 = this.getDeltaMovement();
double d = this.getX() + vec3.x;
double e = this.getY() + vec3.y;
double f = this.getZ() + vec3.z;
this.updateRotation();
if (this.level().noCollision(this, this.getBoundingBox().move(vec3).inflate(1.0))) {
this.setPos(d, e, f);
} else {
this.discard();
}
} else {
if (this.player == null || this.player.isRemoved() || this.player.distanceToSqr(this) > 400) {
this.discard();
return;
}
Vec3 pullVector = this.position().subtract(this.player.position()).normalize().scale(0.8);
this.player.setDeltaMovement(pullVector);
}
}

@Override
protected void onHit(HitResult hitResult) {
if (hitResult.getType() == HitResult.Type.BLOCK) {
this.attached = true;
this.setDeltaMovement(Vec3.ZERO);
} else {
this.discard();
}
}
}
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2019-2025 Team Galacticraft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package dev.galacticraft.mod.content.entity;

/**
* @author <a href="https://github.com/TeamGalacticraft">TeamGalacticraft</a>
*/
public interface PlayerGrapple {
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public class GCItems {
public static final Item TITANIUM_HOE = ITEMS.register(Constant.Item.TITANIUM_HOE, new HoeItem(GCTiers.TITANIUM, new Item.Properties().attributes(HoeItem.createAttributes(GCTiers.TITANIUM, -3.0F, -1.0F))));

public static final Item STANDARD_WRENCH = ITEMS.register(Constant.Item.STANDARD_WRENCH, new StandardWrenchItem(new Item.Properties().durability(256)));
// public static final Item GRAPPLING_HOOK = ITEMS.register(Constant.Item.GRAPPLING_HOOK, new GrapplingHookItem(new Item.Properties().stacksTo(1)));

// ARMOR
public static final Item HEAVY_DUTY_HELMET = ITEMS.register(Constant.Item.HEAVY_DUTY_HELMET, new ArmorItem(GCArmorMaterials.HEAVY_DUTY, ArmorItem.Type.HELMET, new Item.Properties().stacksTo(1)));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2019-2025 Team Galacticraft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package dev.galacticraft.mod.content.item;




/*
public class GrapplingHookItem extends Item {
public GrapplingHookItem(Properties properties) {
super(properties);
}

@Override
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) {
ItemStack itemStack = player.getItemInHand(hand);
PlayerGrapple playerGrapple = (PlayerGrapple) player;

if (playerGrapple.getGrapple() != null) {
playerGrapple.getGrapple().discard();
playerGrapple.setGrapple(null);
return InteractionResultHolder.success(itemStack);
}

if (!level.isClientSide) {
GrappleHookEntity grappleHookEntity = new GrappleHookEntity(level, player);
grappleHookEntity.shootFromRotation(player, player.getXRot(), player.getYRot(), 0.0F, 1.5F, 1.0F);
level.addFreshEntity(grappleHookEntity);
// player.getItemCooldownManager().set(this, 20);
playerGrapple.setGrapple(grappleHookEntity);
}
return InteractionResultHolder.sidedSuccess(itemStack, level.isClientSide());
}
}
*/
2 changes: 1 addition & 1 deletion src/main/java/dev/galacticraft/mod/mixin/PlayerMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import dev.galacticraft.mod.Constant;
import dev.galacticraft.mod.accessor.CryogenicAccessor;
import dev.galacticraft.mod.accessor.PetInventoryOpener;

import dev.galacticraft.mod.content.entity.orbital.AdvancedVehicle;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
Expand All @@ -36,7 +37,6 @@

@Mixin(Player.class)
public abstract class PlayerMixin extends LivingEntity implements CryogenicAccessor, PetInventoryOpener {

PlayerMixin() {
super(null, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#moj_import <fog.glsl>

uniform sampler2D Sampler0;
uniform sampler2D Sampler2;

uniform vec2 ScreenSize;
uniform vec4 ColorModulator;
Expand All @@ -19,6 +20,12 @@ in vec3 viewDir;
out vec4 fragColor;

void main() {
// Depth test
float depth = texelFetch(Sampler2, ivec2(gl_FragCoord.xy), 0).r;
if (gl_FragCoord.z >= depth) {
discard;
}

// - Rim lighting -
vec3 viewAngle = normalize(-viewDir);

Expand Down