-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Good job no one uses this yet :) Builder now has a generic to create any blocktype using the builder parameters. Very useful for building BlockEntities. All Metro blocks are now abstract as a side effect of this. Anything extending a decorative block must remain abstract and be created using the builder instead - this is for the helper system to work. Also added BlockEntities in (first pass, will probably change)
- Loading branch information
Showing
19 changed files
with
205 additions
and
225 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
src/generated/resources/assets/metropolis/blockstates/test_block_entity_decorative.json
This file contains 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,48 @@ | ||
{ | ||
"multipart": [ | ||
{ | ||
"apply": { | ||
"model": "metropolis:block/test_block_entity_decorative_standard" | ||
} | ||
}, | ||
{ | ||
"apply": { | ||
"model": "metropolis:block/test_block_entity_decorative_connection", | ||
"uvlock": true | ||
}, | ||
"when": { | ||
"north": "true" | ||
} | ||
}, | ||
{ | ||
"apply": { | ||
"model": "metropolis:block/test_block_entity_decorative_connection", | ||
"uvlock": true, | ||
"y": 180 | ||
}, | ||
"when": { | ||
"south": "true" | ||
} | ||
}, | ||
{ | ||
"apply": { | ||
"model": "metropolis:block/test_block_entity_decorative_connection", | ||
"uvlock": true, | ||
"y": 270 | ||
}, | ||
"when": { | ||
"west": "true" | ||
} | ||
}, | ||
{ | ||
"apply": { | ||
"model": "metropolis:block/test_block_entity_decorative_connection", | ||
"uvlock": true, | ||
"y": 90 | ||
}, | ||
"when": { | ||
"east": "true" | ||
} | ||
} | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
src/generated/resources/assets/metropolis/models/block/test_block_entity_decorative.json
This file contains 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": "metropolis:blocks/decorative/barrier_concrete_middle", | ||
"textures": { | ||
"texture": "metropolis:block/test_texture_1" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...ted/resources/assets/metropolis/models/block/test_block_entity_decorative_connection.json
This file contains 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": "metropolis:blocks/decorative/barrier_concrete_middle_connection", | ||
"textures": { | ||
"texture": "metropolis:block/test_texture_1" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...rated/resources/assets/metropolis/models/block/test_block_entity_decorative_standard.json
This file contains 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": "metropolis:blocks/decorative/barrier_concrete_middle", | ||
"textures": { | ||
"texture": "metropolis:block/test_texture_1" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/generated/resources/assets/metropolis/models/item/test_block_entity_decorative.json
This file contains 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,3 @@ | ||
{ | ||
"parent": "metropolis:block/test_block_entity_decorative_standard" | ||
} |
This file contains 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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/fureniku/metropolis/blockentity/MetroBlockEntity.java
This file contains 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 |
---|---|---|
@@ -1,13 +1,25 @@ | ||
package com.fureniku.metropolis.blockentity; | ||
|
||
import com.fureniku.metropolis.Metropolis; | ||
import com.fureniku.metropolis.test.RegistrationTest; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
|
||
public class MetroBlockEntity extends BlockEntity { | ||
|
||
private BlockEntityType _type; | ||
|
||
public MetroBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) { | ||
super(type, pos, state); | ||
} | ||
|
||
public MetroBlockEntity(BlockPos pos, BlockState state) { | ||
super(Metropolis.registrationTest.TEST_BLOCK_ENTITY_DECORATIVE_ENTITY.get(), pos, state); | ||
} | ||
|
||
public BlockEntityType getBlockEntityType() { | ||
return null; | ||
} | ||
} |
30 changes: 0 additions & 30 deletions
30
src/main/java/com/fureniku/metropolis/blockentity/MetroEntityBlockBase.java
This file was deleted.
Oops, something went wrong.
64 changes: 0 additions & 64 deletions
64
src/main/java/com/fureniku/metropolis/blockentity/MetroEntityBlockDecorative.java
This file was deleted.
Oops, something went wrong.
This file contains 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
17 changes: 0 additions & 17 deletions
17
src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeContainer.java
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
src/main/java/com/fureniku/metropolis/blocks/decorative/MetroEntityBlockDecorative.java
This file contains 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,35 @@ | ||
package com.fureniku.metropolis.blocks.decorative; | ||
|
||
import com.fureniku.metropolis.blockentity.MetroBlockEntity; | ||
import com.fureniku.metropolis.blocks.IToggleable; | ||
import com.fureniku.metropolis.blocks.decorative.helpers.HelperBase; | ||
import com.fureniku.metropolis.blocks.decorative.helpers.OffsetHelper; | ||
import com.fureniku.metropolis.datagen.TextureSet; | ||
import com.fureniku.metropolis.utils.SimpleUtils; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.block.EntityBlock; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.phys.shapes.VoxelShape; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
|
||
public abstract class MetroEntityBlockDecorative extends MetroBlockDecorativeBase implements IToggleable, EntityBlock { | ||
|
||
public MetroEntityBlockDecorative(Properties props, VoxelShape shape, String modelDir, String modelName, String tag, boolean dynamicShape, TextureSet... textures) { | ||
super(props, shape, modelDir, modelName, tag, dynamicShape, textures); | ||
} | ||
|
||
@Nullable | ||
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { | ||
return new MetroBlockEntity(pos, state); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { | ||
return createBlockEntity(pos, state); | ||
} | ||
} |
Oops, something went wrong.