Skip to content

Commit

Permalink
reduced added datagen, models and texture for lumber storage block
Browse files Browse the repository at this point in the history
  • Loading branch information
JR1811 committed Sep 4, 2024
1 parent fc2b73e commit 54608e7
Show file tree
Hide file tree
Showing 36 changed files with 1,527 additions and 1,762 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// 1.21.1 2024-09-02T00:44:55.9156433 Mayor/Tags for minecraft:fluid
// 1.21.1 2024-09-04T16:05:41.9501071 Mayor/Tags for minecraft:fluid
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// 1.21.1 2024-09-02T00:44:55.9136493 Mayor/Tags for minecraft:entity_type
// 1.21.1 2024-09-04T16:05:41.9481131 Mayor/Tags for minecraft:entity_type
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 1.21.1 2024-09-02T00:44:55.9146463 Mayor/Model Definitions
d183856983f0f13802ec356006cc10d9dfc16650 assets\mayor\models\item\camera_debug.json
// 1.21.1 2024-09-04T16:05:41.9491104 Mayor/Model Definitions
231e5d499785932a985ae132a7e6f2e2626b74a5 assets\mayor\blockstates\camera_debug.json
d183856983f0f13802ec356006cc10d9dfc16650 assets\mayor\models\item\camera_debug.json
961ccc25c3e88551b9a09ef53cfc7a0c11fe2400 assets\mayor\models\item\lumber_storage_block.json
ef8d38319332403de4ce821c1057de0a412c0ff9 assets\mayor\blockstates\lumber_storage.json
8ac76aa83b1300bd875607674bbb5eb62ce0369f assets\mayor\blockstates\lumber_storage.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// 1.21.1 2024-09-02T00:44:55.9166414 Mayor/Tags for minecraft:block
// 1.21.1 2024-09-04T16:05:41.9511049 Mayor/Tags for minecraft:block
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// 1.21.1 2024-09-02T00:44:55.9116542 Mayor/Tags for minecraft:item
// 1.21.1 2024-09-04T16:05:41.9461182 Mayor/Tags for minecraft:item
24 changes: 12 additions & 12 deletions src/main/generated/assets/mayor/blockstates/lumber_storage.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"variants": {
"position=center": {
"model": "mayor:block/1x1/lumber_1x1_top"
"model": "mayor:block/lumber_center"
},
"position=east": {
"model": "mayor:block/1x1/lumber_1x1_top"
},
"position=no_wall": {
"model": "mayor:block/1x1/lumber_1x1_top"
"model": "mayor:block/lumber_east"
},
"position=north": {
"model": "mayor:block/1x1/lumber_1x1_top"
"model": "mayor:block/lumber_north"
},
"position=north_east": {
"model": "mayor:block/1x1/lumber_1x1_top"
"model": "mayor:block/lumber_north_east"
},
"position=north_west": {
"model": "mayor:block/1x1/lumber_1x1_top"
"model": "mayor:block/lumber_north_west"
},
"position=single": {
"model": "mayor:block/lumber_single"
},
"position=south": {
"model": "mayor:block/1x1/lumber_1x1_top"
"model": "mayor:block/lumber_south"
},
"position=south_east": {
"model": "mayor:block/1x1/lumber_1x1_top"
"model": "mayor:block/lumber_south_east"
},
"position=south_west": {
"model": "mayor:block/1x1/lumber_1x1_top"
"model": "mayor:block/lumber_south_west"
},
"position=west": {
"model": "mayor:block/1x1/lumber_1x1_top"
"model": "mayor:block/lumber_west"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.FluidState;
import net.minecraft.fluid.Fluids;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemStack;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.EnumProperty;
import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos;
Expand All @@ -28,7 +25,10 @@
import net.minecraft.world.WorldAccess;
import org.jetbrains.annotations.Nullable;

import java.util.*;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Optional;

public abstract class AbstractVillageContainerBlock extends BlockWithEntity {
public static final EnumProperty<MayorProperties.Position> POSITION = MayorProperties.POSITION;
Expand Down Expand Up @@ -71,7 +71,7 @@ public BlockState getStateForNeighborUpdate(BlockState state, Direction directio
world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world));
}
BlockPos originPos = getOrigin(world, pos).orElse(pos);
ConnectedBlockUtil.BoundingBox box = new ConnectedBlockUtil.BoundingBox(world, originPos, false);
var box = new ConnectedBlockUtil.BoundingBox(world, originPos, false);
if (!box.hasHoles() && box.isSquare()) {
state = getConnectedWallsState(world, state, pos);
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package io.fabricatedatelier.mayor.datagen;

import io.fabricatedatelier.mayor.Mayor;
import io.fabricatedatelier.mayor.block.MayorProperties;
import io.fabricatedatelier.mayor.init.Blocks;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider;
import net.minecraft.data.client.BlockStateModelGenerator;
import net.minecraft.data.client.ItemModelGenerator;
import net.minecraft.data.client.*;
import net.minecraft.util.Identifier;

public class ModelProvider extends FabricModelProvider {
Expand All @@ -19,17 +20,21 @@ public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGen
Identifier.ofVanilla("block/dirt"))
);

/*blockStateModelGenerator.blockStateCollector.accept(VariantsBlockStateSupplier.create(Blocks.LUMBER_STORAGE)
.coordinate(createMultiBlockStructureMap()));*/
blockStateModelGenerator.blockStateCollector.accept(VariantsBlockStateSupplier.create(Blocks.LUMBER_STORAGE)
.coordinate(createMultiBlockStructureMap()));
}

@Override
public void generateItemModels(ItemModelGenerator itemModelGenerator) {

}

/*private BlockStateVariantMap createMultiBlockStructureMap() {
return BlockStateVariantMap.create(MayorProperties.POSITION)
.register(position -> BlockStateVariant.create().put(VariantSettings.MODEL, Mayor.identifierOf("block/1x1/lumber_1x1_top")));
}*/
private BlockStateVariantMap createMultiBlockStructureMap() {
return BlockStateVariantMap.create(MayorProperties.POSITION).register(position ->
BlockStateVariant.create().put(
VariantSettings.MODEL,
Mayor.identifierOf("block/lumber_" + position.asString())
)
);
}
}
155 changes: 0 additions & 155 deletions src/main/resources/assets/mayor/models/block/1x1/lumber_1x1.json

This file was deleted.

Loading

0 comments on commit 54608e7

Please sign in to comment.