Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
fccfa85
Tin Ladders now break when not supported.
ScottRox Aug 11, 2025
e7f0071
Tin Ladders now break when not supported.
ScottRox Aug 11, 2025
cda49a0
Can't place on wooden ladders.
ScottRox Aug 11, 2025
de14810
Added myself as contributor
ScottRox Aug 11, 2025
25a7356
Updated comment
ScottRox Aug 11, 2025
575b6fc
Removed from contributors. This will be done by someone else at a lat…
ScottRox Aug 12, 2025
e21694a
Resolving review comments. Applying coding standards and correcting s…
ScottRox Aug 12, 2025
bc679b4
Extended placing of ladders now checks they are facing the same way.
ScottRox Aug 12, 2025
c994808
Removed unused import.
ScottRox Aug 12, 2025
ee15dfd
Removed code to check boundary conditions as unnecessary.
ScottRox Aug 12, 2025
37ac640
removed unused import
ScottRox Aug 12, 2025
fd37be8
removed unused import
ScottRox Aug 12, 2025
536ce71
Can no longer place ladders on faces that are not sturdy, ie: stairs …
ScottRox Aug 17, 2025
1e3831a
Make sure tin ladders that are back to back do not support themselves…
ScottRox Aug 17, 2025
b4e8642
Removed /src/main/generated/ from .gitignore
ScottRox Aug 17, 2025
1f059ad
Removed /src/main/generated/ from .gitignore
ScottRox Aug 18, 2025
4c6f958
Resolved further review comments.
ScottRox Aug 18, 2025
fc9d9fc
TorchWeb Changes.
ScottRox Aug 18, 2025
e592291
torchweb generated files
ScottRox Aug 18, 2025
a501f8d
Checks waterlogging when placing.
ScottRox Aug 18, 2025
9e90b05
Initial Torch_Web block.
ScottRox Aug 19, 2025
7d827ec
Removed unused import statement
ScottRox Aug 19, 2025
be89380
Adding generated json files.
ScottRox Aug 19, 2025
2919132
Fixed model generation.
ScottRox Aug 19, 2025
64d969b
Narrowed TorchWeb voxel
ScottRox Aug 19, 2025
3642323
Updated textures.
ScottRox Aug 19, 2025
279f93d
Corrected glowstone torch texture.
ScottRox Aug 19, 2025
dc58c5a
Revert "Updated textures."
ScottRox Aug 20, 2025
11836b7
Split TorchWeb into two types of blocks, so Web String is new.
ScottRox Aug 20, 2025
e3a61d9
Web String and Torch Webs slow the player down.
ScottRox Aug 20, 2025
dbfe726
Refactor Torch Web to Web Torch
ScottRox Aug 20, 2025
66ad196
Update all references to torch web to be web torch
ScottRox Aug 20, 2025
302b33e
Update all references to torch web to be web torch
ScottRox Aug 20, 2025
e745417
Merge branch 'master' into torchWeb
ScottRox Aug 20, 2025
a0309cf
Handles water logged fluids consistently.
ScottRox Aug 20, 2025
b7c2fea
Handles water logged fluids consistently.
ScottRox Aug 20, 2025
79c1eb4
Removed /src/main/generated/ from .gitignore
ScottRox Aug 18, 2025
c5ad815
TorchWeb Changes.
ScottRox Aug 18, 2025
58889b5
torchweb generated files
ScottRox Aug 18, 2025
06d8985
Initial Torch_Web block.
ScottRox Aug 19, 2025
2daaeb6
Removed unused import statement
ScottRox Aug 19, 2025
1115664
Adding generated json files.
ScottRox Aug 19, 2025
c2c980a
Fixed model generation.
ScottRox Aug 19, 2025
5ee8e13
Narrowed TorchWeb voxel
ScottRox Aug 19, 2025
e9f597b
Updated textures.
ScottRox Aug 19, 2025
5ac3061
Corrected glowstone torch texture.
ScottRox Aug 19, 2025
428b195
Revert "Updated textures."
ScottRox Aug 20, 2025
56de09c
Split TorchWeb into two types of blocks, so Web String is new.
ScottRox Aug 20, 2025
bf0547f
Web String and Torch Webs slow the player down.
ScottRox Aug 20, 2025
d539188
Refactor Torch Web to Web Torch
ScottRox Aug 20, 2025
24784e4
Update all references to torch web to be web torch
ScottRox Aug 20, 2025
eba3923
Update all references to torch web to be web torch
ScottRox Aug 20, 2025
aaf1e4e
Merge remote-tracking branch 'origin/torchWeb' into torchWeb
ScottRox Aug 20, 2025
525b6cf
Merge branch 'main' into torchWeb
ScottRox Aug 20, 2025
e784e26
Changed to shapeless recipe
ScottRox Aug 21, 2025
d6a83a0
Coding std changes.
ScottRox Aug 21, 2025
356e029
Moved WebString and WebTorch below lanterns in creative mode tab.
ScottRox Aug 21, 2025
2ed65a8
Moved WebString and WebTorch below lanterns.
ScottRox Aug 21, 2025
06b8e77
Moved WebString and WebTorch below lanterns.
ScottRox Aug 21, 2025
24065b2
Using datagen to create model files for web string and web torch
ScottRox Aug 21, 2025
cf2d676
Code standards
ScottRox Aug 21, 2025
fcd3ab5
generated model and blockstate files
ScottRox Aug 21, 2025
f21a67f
Merge branch 'TeamGalacticraft:main' into torchWeb
ScottRox Aug 21, 2025
b153af7
unused commit
ScottRox Aug 21, 2025
6514425
Removed unnececssary space from enum.
ScottRox Aug 23, 2025
e07ac86
comments for and before "else if" statements are now at the end of th…
ScottRox Aug 23, 2025
e2e6fd5
Changed import to static for WEB_STRING
ScottRox Aug 23, 2025
cf27b90
Changed import to static for WEB_STRING, WEB_TORCH and GLOWSTONE_TORCH
ScottRox Aug 23, 2025
37bb1ed
Back to custom models.
ScottRox Aug 23, 2025
fa6b8cb
WebString and WebTorch have a common base class that overrides the We…
ScottRox Aug 23, 2025
cb80c53
Merge branch 'TeamGalacticraft:main' into torchWeb
ScottRox Oct 3, 2025
fdfa569
Review changes. Just style.
ScottRox Oct 4, 2025
2868335
Merge branch 'TeamGalacticraft:main' into torchWeb
ScottRox Oct 4, 2025
422ed5b
Merge branch 'main' into torchWeb
ScottRox Oct 16, 2025
16ab879
Fixed bad merge resolutions.
ScottRox Oct 16, 2025
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
36 changes: 36 additions & 0 deletions src/main/generated/assets/galacticraft/blockstates/web_string.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"multipart": [
{
"apply": {
"model": "galacticraft:block/web_string_top"
},
"when": {
"web_string_part": "top"
}
},
{
"apply": {
"model": "galacticraft:block/web_string_middle"
},
"when": {
"web_string_part": "middle"
}
},
{
"apply": {
"model": "galacticraft:block/web_string_bottom"
},
"when": {
"web_string_part": "bottom"
}
},
{
"apply": {
"model": "galacticraft:block/web_string_top_bottom"
},
"when": {
"web_string_part": "top_bottom"
}
}
]
}
20 changes: 20 additions & 0 deletions src/main/generated/assets/galacticraft/blockstates/web_torch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"multipart": [
{
"apply": {
"model": "galacticraft:block/web_torch"
},
"when": {
"top": "false"
}
},
{
"apply": {
"model": "galacticraft:block/web_torch_top"
},
"when": {
"top": "true"
}
}
]
}
2 changes: 2 additions & 0 deletions src/main/generated/assets/galacticraft/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@
"block.galacticraft.venus_tin_ore": "Venus Tin Ore",
"block.galacticraft.volcanic_rock": "Volcanic Rock",
"block.galacticraft.walkway": "Walkway",
"block.galacticraft.web_string": "Web String",
"block.galacticraft.web_torch": "Web Torch",
"block.galacticraft.white_candle_moon_cheese_wheel": "Moon Cheese Wheel with White Candle",
"block.galacticraft.white_glass_fluid_pipe": "White Stained Glass Fluid Pipe",
"block.galacticraft.wire_walkway": "Wire Walkway",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "galacticraft:block/web_string_middle"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "galacticraft:block/web_torch"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_the_recipe": {
"conditions": {
"recipe": "galacticraft:web_torch"
},
"trigger": "minecraft:recipe_unlocked"
},
"has_web_string": {
"conditions": {
"items": [
{
"items": "galacticraft:web_string"
}
]
},
"trigger": "minecraft:inventory_changed"
}
},
"requirements": [
[
"has_the_recipe",
"has_web_string"
]
],
"rewards": {
"recipes": [
"galacticraft:web_torch"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "galacticraft:web_string"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "galacticraft:web_torch"
}
],
"rolls": 1.0
}
]
}
16 changes: 16 additions & 0 deletions src/main/generated/data/galacticraft/recipe/web_torch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"item": "galacticraft:web_string"
},
{
"item": "galacticraft:glowstone_torch"
}
],
"result": {
"count": 1,
"id": "galacticraft:web_torch"
}
}
3 changes: 2 additions & 1 deletion src/main/java/dev/galacticraft/mod/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ interface Block {
String WALKWAY = "walkway";
String WIRE_WALKWAY = "wire_walkway";
String FLUID_PIPE_WALKWAY = "fluid_pipe_walkway";
String WEB_TORCH = "web_torch";
String WEB_STRING = "web_string";

// Environment
String GLOWSTONE_TORCH = "glowstone_torch";
Expand All @@ -247,7 +249,6 @@ interface Block {
String UNLIT_SOUL_LANTERN = "unlit_soul_lantern";
String CAVERNOUS_VINES = "cavernous_vines";
String CAVERNOUS_VINES_PLANT = "cavernous_vines_plant";
String WEB_TORCH = "web_torch";
String FALLEN_METEOR = "fallen_meteor";
String SLIMELING_EGG = "slimeling_egg";
String CREEPER_EGG = "creeper_egg";
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/dev/galacticraft/mod/GalacticraftClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ public void onInitializeClient() {
BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.GLOWSTONE_LANTERN, RenderType.cutout());
BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.UNLIT_LANTERN, RenderType.cutout());
BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.UNLIT_SOUL_LANTERN, RenderType.cutout());
BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.WEB_TORCH, RenderType.cutout());
BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.WEB_STRING, RenderType.cutout());
BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.CAVERNOUS_VINES, RenderType.cutout());
BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.CAVERNOUS_VINES_PLANT, RenderType.cutout());
BlockRenderLayerMap.INSTANCE.putBlock(GCBlocks.OLIVINE_CLUSTER, RenderType.cutout());
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/dev/galacticraft/mod/content/GCBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ public class GCBlocks {
public static final Block UNLIT_WALL_TORCH = BLOCKS.register(Constant.Block.UNLIT_WALL_TORCH, new UnlitWallTorchBlock(Blocks.WALL_TORCH, BlockBehaviour.Properties.ofFullCopy(UNLIT_TORCH).dropsLike(UNLIT_TORCH)));
public static final Block UNLIT_SOUL_WALL_TORCH = BLOCKS.register(Constant.Block.UNLIT_SOUL_WALL_TORCH, new UnlitWallTorchBlock(Blocks.SOUL_WALL_TORCH, BlockBehaviour.Properties.ofFullCopy(UNLIT_SOUL_TORCH).dropsLike(UNLIT_SOUL_TORCH)));

// WEB TORCH & WEB STRING
public static final Block WEB_TORCH = BLOCKS.registerWithItem(Constant.Block.WEB_TORCH, new WebTorchBlock(BlockBehaviour.Properties.of().mapColor(MapColor.WOOL).sound(SoundType.COBWEB).noCollission().strength(3.0F).pushReaction(PushReaction.DESTROY).lightLevel(state -> 10)));
public static final Block WEB_STRING = BLOCKS.registerWithItem(Constant.Block.WEB_STRING, new WebStringBlock(BlockBehaviour.Properties.of().mapColor(MapColor.WOOL).sound(SoundType.COBWEB).noCollission().strength(3.0F).pushReaction(PushReaction.DESTROY)));

// LANTERNS - Don't use registerWithItem in order for the torches to be before the lanterns
public static final Block GLOWSTONE_LANTERN = BLOCKS.register(Constant.Block.GLOWSTONE_LANTERN, new GlowstoneLanternBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.LANTERN)));
public static final Block UNLIT_LANTERN = BLOCKS.register(Constant.Block.UNLIT_LANTERN, new UnlitLanternBlock(Blocks.LANTERN, BlockBehaviour.Properties.ofFullCopy(Blocks.LANTERN).lightLevel(state -> 0)));
Expand All @@ -392,7 +396,7 @@ private static boolean never(BlockState blockState, BlockGetter blockGetter, Blo
return false;
}

private static ToIntFunction<BlockState> litBlockEmission(int i) {
return blockState -> blockState.getValue(BlockStateProperties.LIT) ? i : 0;
private static ToIntFunction<BlockState> litBlockEmission(int intensity) {
return blockState -> blockState.getValue(BlockStateProperties.LIT) ? intensity : 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* 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.block.special;

import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.WebBlock;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

/// This class acts as a superclass for the WebTorch and WebString classes, providing common code for handling of
/// the intersection between the player and the web string and web torches. This is so the player slows down, similar
/// to the way that a player slows down in a normal web block. It differs to the MC WebBlock in that the collision
/// box is based on the voxel shape as opposed to a full bounding box for a block. It still inherits the behaviour
/// from the MC WebBlock though.

public class GCWebBlock extends WebBlock {
public static final MapCodec<WebBlock> CODEC = simpleCodec(GCWebBlock::new);

@Override
public MapCodec<WebBlock> codec() {
return CODEC;
}

public GCWebBlock(BlockBehaviour.Properties properties) {
super(properties);
}

@Override
protected VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
return getShape(state);
}

// Must override this method or an exception will be generated!
protected VoxelShape getShape(BlockState state) {
return null;
}

protected AABB getShapeInWorldCoordinates(BlockState state, BlockPos pos) {
return getShape(state).bounds().move(pos);
}

@Override
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entityGoalInfo) {
AABB entityBB = entityGoalInfo.getBoundingBox();
AABB shapeBB = getShapeInWorldCoordinates(state, pos);
if (shapeBB.intersects(entityBB)) {
super.entityInside(state, level, pos, entityGoalInfo);
}
}
}
Loading