- 
                Notifications
    
You must be signed in to change notification settings  - Fork 101
 
Web Torch and Web String Blocks #515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            ScottRox
  wants to merge
  75
  commits into
  TeamGalacticraft:main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
ScottRox:torchWeb
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    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 e7f0071
              
                Tin Ladders now break when not supported.
              
              
                ScottRox cda49a0
              
                Can't place on wooden ladders.
              
              
                ScottRox de14810
              
                Added myself as contributor
              
              
                ScottRox 25a7356
              
                Updated comment
              
              
                ScottRox 575b6fc
              
                Removed from contributors. This will be done by someone else at a lat…
              
              
                ScottRox e21694a
              
                Resolving review comments. Applying coding standards and correcting s…
              
              
                ScottRox bc679b4
              
                Extended placing of ladders now checks they are facing the same way.
              
              
                ScottRox c994808
              
                Removed unused import.
              
              
                ScottRox ee15dfd
              
                Removed code to check boundary conditions as unnecessary.
              
              
                ScottRox 37ac640
              
                removed unused import
              
              
                ScottRox fd37be8
              
                removed unused import
              
              
                ScottRox 536ce71
              
                Can no longer place ladders on faces that are not sturdy, ie: stairs …
              
              
                ScottRox 1e3831a
              
                Make sure tin ladders that are back to back do not support themselves…
              
              
                ScottRox b4e8642
              
                Removed /src/main/generated/ from .gitignore
              
              
                ScottRox 1f059ad
              
                Removed /src/main/generated/ from .gitignore
              
              
                ScottRox 4c6f958
              
                Resolved further review comments.
              
              
                ScottRox fc9d9fc
              
                TorchWeb Changes.
              
              
                ScottRox e592291
              
                torchweb generated files
              
              
                ScottRox a501f8d
              
                Checks waterlogging when placing.
              
              
                ScottRox 9e90b05
              
                Initial Torch_Web block.
              
              
                ScottRox 7d827ec
              
                Removed unused import statement
              
              
                ScottRox be89380
              
                Adding generated json files.
              
              
                ScottRox 2919132
              
                Fixed model generation.
              
              
                ScottRox 64d969b
              
                Narrowed TorchWeb voxel
              
              
                ScottRox 3642323
              
                Updated textures.
              
              
                ScottRox 279f93d
              
                Corrected glowstone torch texture.
              
              
                ScottRox dc58c5a
              
                Revert "Updated textures."
              
              
                ScottRox 11836b7
              
                Split TorchWeb into two types of blocks, so Web String is new.
              
              
                ScottRox e3a61d9
              
                Web String and Torch Webs slow the player down.
              
              
                ScottRox dbfe726
              
                Refactor Torch Web to Web Torch
              
              
                ScottRox 66ad196
              
                Update all references to torch web to be web torch
              
              
                ScottRox 302b33e
              
                Update all references to torch web to be web torch
              
              
                ScottRox e745417
              
                Merge branch 'master' into torchWeb
              
              
                ScottRox a0309cf
              
                Handles water logged fluids consistently.
              
              
                ScottRox b7c2fea
              
                Handles water logged fluids consistently.
              
              
                ScottRox 79c1eb4
              
                Removed /src/main/generated/ from .gitignore
              
              
                ScottRox c5ad815
              
                TorchWeb Changes.
              
              
                ScottRox 58889b5
              
                torchweb generated files
              
              
                ScottRox 06d8985
              
                Initial Torch_Web block.
              
              
                ScottRox 2daaeb6
              
                Removed unused import statement
              
              
                ScottRox 1115664
              
                Adding generated json files.
              
              
                ScottRox c2c980a
              
                Fixed model generation.
              
              
                ScottRox 5ee8e13
              
                Narrowed TorchWeb voxel
              
              
                ScottRox e9f597b
              
                Updated textures.
              
              
                ScottRox 5ac3061
              
                Corrected glowstone torch texture.
              
              
                ScottRox 428b195
              
                Revert "Updated textures."
              
              
                ScottRox 56de09c
              
                Split TorchWeb into two types of blocks, so Web String is new.
              
              
                ScottRox bf0547f
              
                Web String and Torch Webs slow the player down.
              
              
                ScottRox d539188
              
                Refactor Torch Web to Web Torch
              
              
                ScottRox 24784e4
              
                Update all references to torch web to be web torch
              
              
                ScottRox eba3923
              
                Update all references to torch web to be web torch
              
              
                ScottRox aaf1e4e
              
                Merge remote-tracking branch 'origin/torchWeb' into torchWeb
              
              
                ScottRox 525b6cf
              
                Merge branch 'main' into torchWeb
              
              
                ScottRox e784e26
              
                Changed to shapeless recipe
              
              
                ScottRox d6a83a0
              
                Coding std changes.
              
              
                ScottRox 356e029
              
                Moved WebString and WebTorch below lanterns in creative mode tab.
              
              
                ScottRox 2ed65a8
              
                Moved WebString and WebTorch below lanterns.
              
              
                ScottRox 06b8e77
              
                Moved WebString and WebTorch below lanterns.
              
              
                ScottRox 24065b2
              
                Using datagen to create model files for web string and web torch
              
              
                ScottRox cf2d676
              
                Code standards
              
              
                ScottRox fcd3ab5
              
                generated model and blockstate files
              
              
                ScottRox f21a67f
              
                Merge branch 'TeamGalacticraft:main' into torchWeb
              
              
                ScottRox b153af7
              
                unused commit
              
              
                ScottRox 6514425
              
                Removed unnececssary space from enum.
              
              
                ScottRox e07ac86
              
                comments for and before "else if" statements are now at the end of th…
              
              
                ScottRox e2e6fd5
              
                Changed import to static for WEB_STRING
              
              
                ScottRox cf27b90
              
                Changed import to static for WEB_STRING, WEB_TORCH and GLOWSTONE_TORCH
              
              
                ScottRox 37bb1ed
              
                Back to custom models.
              
              
                ScottRox fa6b8cb
              
                WebString and WebTorch have a common base class that overrides the We…
              
              
                ScottRox cb80c53
              
                Merge branch 'TeamGalacticraft:main' into torchWeb
              
              
                ScottRox fdfa569
              
                Review changes. Just style.
              
              
                ScottRox 2868335
              
                Merge branch 'TeamGalacticraft:main' into torchWeb
              
              
                ScottRox 422ed5b
              
                Merge branch 'main' into torchWeb
              
              
                ScottRox 16ab879
              
                Fixed bad merge resolutions.
              
              
                ScottRox File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
        
          
          
            36 changes: 36 additions & 0 deletions
          
          36 
        
  src/main/generated/assets/galacticraft/blockstates/web_string.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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
          
          20 
        
  src/main/generated/assets/galacticraft/blockstates/web_torch.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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" | ||
| } | ||
| } | ||
| ] | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            6 changes: 6 additions & 0 deletions
          
          6 
        
  src/main/generated/assets/galacticraft/models/item/web_string.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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" | ||
| } | ||
| } | 
        
          
          
            6 changes: 6 additions & 0 deletions
          
          6 
        
  src/main/generated/assets/galacticraft/models/item/web_torch.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "parent": "minecraft:item/generated", | ||
| "textures": { | ||
| "layer0": "galacticraft:block/web_torch" | ||
| } | ||
| } | 
        
          
          
            32 changes: 32 additions & 0 deletions
          
          32 
        
  src/main/generated/data/galacticraft/advancement/recipes/decorations/web_torch.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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" | ||
| ] | ||
| } | ||
| } | 
        
          
          
            20 changes: 20 additions & 0 deletions
          
          20 
        
  src/main/generated/data/galacticraft/loot_table/blocks/web_string.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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 | ||
| } | ||
| ] | ||
| } | 
        
          
          
            20 changes: 20 additions & 0 deletions
          
          20 
        
  src/main/generated/data/galacticraft/loot_table/blocks/web_torch.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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
          
          16 
        
  src/main/generated/data/galacticraft/recipe/web_torch.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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" | ||
| } | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            77 changes: 77 additions & 0 deletions
          
          77 
        
  src/main/java/dev/galacticraft/mod/content/block/special/GCWebBlock.java
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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); | ||
| } | ||
| } | ||
| } | 
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.