Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3835cda
Refactored easy containers
MikeTheShadow Feb 12, 2024
259956d
Updated BatteryBox container
MikeTheShadow Feb 12, 2024
e4e2745
Updated BatteryBox container
MikeTheShadow Feb 12, 2024
bc9fd8a
Merge remote-tracking branch 'origin/1.20.4-exp-tile-rewrite' into 1.…
MikeTheShadow Feb 12, 2024
d0622e6
Removed VEFluidTileEntity. Optimized Imports to speed this process up
MikeTheShadow Feb 14, 2024
d8abb4d
Completed refactor of VETileEntities
MikeTheShadow Feb 20, 2024
2ea2704
Work on refactoring recipes. Merged VEFluidRecipe into VERecipe
MikeTheShadow Feb 25, 2024
948be38
Recipe and tile rework parts
MikeTheShadow Mar 9, 2024
aada0a8
Removed non-essential tile classes. Fixed a few recipe parser issues
MikeTheShadow Apr 6, 2024
6def915
Fixed some recipe issues with count. Fixed the DimensionalLaser
MikeTheShadow Apr 7, 2024
4190de2
Finished the ElectricFurnace. Fixed an issue with machine upgrade cal…
MikeTheShadow Apr 8, 2024
c968dc5
Updated the Pump
MikeTheShadow Apr 8, 2024
30a7ed4
Updated the Pump
MikeTheShadow Apr 8, 2024
a869e0f
Merge remote-tracking branch 'origin/1.20.4-exp-tile-rewrite' into 1.…
MikeTheShadow Apr 8, 2024
2233c45
Updated the sawmill.
MikeTheShadow Apr 8, 2024
f614213
Fixed CombustionGenerator
MikeTheShadow Apr 9, 2024
303d6ca
Renamed some methods, updated the gas furnace
MikeTheShadow Apr 10, 2024
d86bec4
Renamed some methods, updated the gas furnace. Fixed the battery box
MikeTheShadow Apr 10, 2024
f08d390
Fixed CombustionGeneratorProcessor
MikeTheShadow Apr 10, 2024
6f91b3e
Renamed some methods. Fixed IndustrialBlastingRecipe
MikeTheShadow Apr 10, 2024
88d9781
Fixed solar panels
MikeTheShadow Apr 10, 2024
33ce24b
Added custom fluid validator for edge cases
MikeTheShadow Apr 11, 2024
1ac33fa
Added network logic for FluidData
MikeTheShadow Apr 11, 2024
9d255aa
Fixed issue with PrimitiveBlastFurnace missing upgrade slot in Tile
MikeTheShadow Apr 11, 2024
12ac01c
Reworked block,tile,container registry. Fixed Tanks.
MikeTheShadow Apr 11, 2024
7ae2775
Made blocks auto-register
MikeTheShadow Apr 11, 2024
4838fa0
Fixed PressureLadder. Added the laser pylon
MikeTheShadow Apr 12, 2024
e4652c8
Update Forge to 49.1.0
Eelt Jun 13, 2024
9b8a0df
Updated DimensionalLaserRecipeProcessor updated LaserBlockEntityRende…
MikeTheShadow Jun 18, 2024
22e3284
Merge remote-tracking branch 'origin/1.20.4-exp-tile-rewrite' into 1.…
MikeTheShadow Jun 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jei_version=17.3.0.47

minecraft_version_range=[1.20.4,1.21)
# The Forge version must agree with the Minecraft version to get a valid artifact
forge_version=49.0.27
forge_version=49.1.0
# The Forge version range can use any version of Forge as bounds or match the loader version range
forge_version_range=[49.0.27,)
# The loader version range can only use the major version of Forge/FML as bounds
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class VoluminousEnergy {
VoluminousEnergy voluminousEnergy = new VoluminousEnergy();
voluminousEnergy.init();
}

public void init() {
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.COMMON_CONFIG);

Expand Down Expand Up @@ -124,7 +125,7 @@ public void init() {
getOrCreateDirectory(FMLPaths.CONFIGDIR.get().resolve(VoluminousEnergy.MODID), VoluminousEnergy.MODID); // TODO: Get Or Create Directory
Config.loadConfig(Config.COMMON_CONFIG, FMLPaths.CONFIGDIR.get().resolve(VoluminousEnergy.MODID + "-common.toml"));
//Config.loadConfig(Config.CLIENT_CONFIG, FMLPaths.CONFIGDIR.get().resolve("voluminousenergy-client.toml"));
ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT,Config.CLIENT_BUILDER.build(), VoluminousEnergy.MODID + "/" + VoluminousEnergy.MODID + "-client.toml");
ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, Config.CLIENT_BUILDER.build(), VoluminousEnergy.MODID + "/" + VoluminousEnergy.MODID + "-client.toml");

modEventBus.addListener(this::registerRenderers); // Register renderer for Dimensional Laser

Expand All @@ -133,10 +134,9 @@ public void init() {

private static Path getOrCreateDirectory(Path dirPath, String dirLabel) { // Extracted from Forge 45
if (!Files.isDirectory(dirPath.getParent())) {
getOrCreateDirectory(dirPath.getParent(), "parent of "+dirLabel);
getOrCreateDirectory(dirPath.getParent(), "parent of " + dirLabel);
}
if (!Files.isDirectory(dirPath))
{
if (!Files.isDirectory(dirPath)) {
LOGGER.debug("Making {} directory : {}", dirLabel, dirPath);
try {
Files.createDirectory(dirPath);
Expand Down Expand Up @@ -174,10 +174,10 @@ private void setup(final FMLCommonSetupEvent event) {
}

private void registerRenderers(EntityRenderersEvent.RegisterRenderers event) {
event.registerBlockEntityRenderer(VEBlocks.DIMENSIONAL_LASER_TILE.get(), LaserBlockEntityRenderer::new);
event.registerBlockEntityRenderer(VEBlocks.DIMENSIONAL_LASER.tile().get(), LaserBlockEntityRenderer::new);
}

private void setupWhenLoadingComplete(final FMLLoadCompleteEvent event){
private void setupWhenLoadingComplete(final FMLLoadCompleteEvent event) {
}

public static MinecraftServer server;
Expand All @@ -194,9 +194,9 @@ public static void onRegistry(final RegisterEvent blockRegistryEvent) {
public static class ClientRegister {

@SubscribeEvent
public static void RegisterClientOnSetupEvent(FMLClientSetupEvent event){
public static void RegisterClientOnSetupEvent(FMLClientSetupEvent event) {
event.enqueueWork(() -> ItemBlockRenderTypes.setRenderLayer(VEBlocks.RICE_CROP.get(), RenderType.cutout()));
event.enqueueWork(() -> ItemBlockRenderTypes.setRenderLayer(VEBlocks.SAWMILL_BLOCK.get(), RenderType.cutout()));
event.enqueueWork(() -> ItemBlockRenderTypes.setRenderLayer(VEBlocks.SAWMILL.block().get(), RenderType.cutout()));
event.enqueueWork(() -> ItemBlockRenderTypes.setRenderLayer(VEBlocks.PRESSURE_LADDER.get(), RenderType.cutout()));
}

Expand All @@ -206,12 +206,12 @@ public static void RegisterClientOnSetupEvent(FMLClientSetupEvent event){
public static class OnDatagenEvent {

@SubscribeEvent
public static void onGatherData(GatherDataEvent event){
public static void onGatherData(GatherDataEvent event) {
DataGenerator dataGenerator = event.getGenerator();
PackOutput packOutput = dataGenerator.getPackOutput();
CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider();

if(event.includeServer()) {
if (event.includeServer()) {
dataGenerator.addProvider(true, new VETagDataGenerator(dataGenerator.getPackOutput(), lookupProvider, event.getExistingFileHelper()));
dataGenerator.addProvider(true, new VEGlobalLootModifierData(dataGenerator.getPackOutput()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
public class VEMachineAdvancements {



}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.advancements.CriterionTrigger;
import net.minecraft.advancements.critereon.ConstructBeaconTrigger;

public class VECriteriaTriggers {

public static final ConstructDimensionalLaserTrigger CONSTRUCT_DIMENSIONAL_LASER_TRIGGER = register(new ConstructDimensionalLaserTrigger());

public static <T extends CriterionTrigger<?>> T register(T p_10596_) {
return CriteriaTriggers.register(ConstructDimensionalLaserTrigger.ID.toString(),p_10596_);
return CriteriaTriggers.register(ConstructDimensionalLaserTrigger.ID.toString(), p_10596_);
}

public static void init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
package com.veteam.voluminousenergy.blocks.blocks;

import com.veteam.voluminousenergy.blocks.tiles.DimensionalLaserTile;
import com.veteam.voluminousenergy.blocks.blocks.machines.VEFaceableMachineBlock;
import com.veteam.voluminousenergy.blocks.tiles.VETileEntities;
import com.veteam.voluminousenergy.datagen.VETagDataGenerator;
import com.veteam.voluminousenergy.sounds.VESounds;
import net.minecraft.client.Minecraft;
import net.minecraft.client.sounds.SoundManager;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.MenuProvider;
import net.minecraft.world.entity.player.Player;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public class DimensionalLaserBlock extends Block implements EntityBlock {
public class DimensionalLaserBlock extends VEFaceableMachineBlock {

public DimensionalLaserBlock() {
super(BlockBehaviour.Properties.of()
Expand All @@ -36,38 +35,25 @@ public DimensionalLaserBlock() {
VETagDataGenerator.setRequiresPickaxe(this);
}

// NEW TICK SYSTEM
@Nullable
protected static <T extends BlockEntity> BlockEntityTicker<T> createTicker(Level level, BlockEntityType<T> passedBlockEntity, BlockEntityType<? extends DimensionalLaserTile> tile) {
return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, DimensionalLaserTile::serverTick);
}

public static <T extends BlockEntity, E extends BlockEntity> BlockEntityTicker<T> createTickerHelper(BlockEntityType<T> blockEntityType, BlockEntityType<? extends DimensionalLaserTile> tile, BlockEntityTicker<E> serverTick) {
return blockEntityType == tile ? (BlockEntityTicker<T>)serverTick : null;
}

@Nullable
@Override
public BlockEntity newBlockEntity(@Nonnull BlockPos blockPos,@Nonnull BlockState blockState) {
return new DimensionalLaserTile(blockPos,blockState);
public BlockEntity newBlockEntity(@Nonnull BlockPos blockPos, @Nonnull BlockState blockState) {
return VETileEntities.DIMENSIONAL_LASER_FACTORY.create(blockPos, blockState);
}

@Nullable
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(@Nonnull Level level,@Nonnull BlockState state,@Nonnull BlockEntityType<T> blockEntityType) {
return createTicker(level, blockEntityType, VEBlocks.DIMENSIONAL_LASER_TILE.get());
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(@Nonnull Level level, @Nonnull BlockState state, @Nonnull BlockEntityType<T> blockEntityType) {
return createTicker(level, blockEntityType, VEBlocks.DIMENSIONAL_LASER.tile().get());
}

@Override
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit){
if(!world.isClientSide) {
BlockEntity tileEntity = world.getBlockEntity(pos);
if(tileEntity instanceof MenuProvider menuProvider && player instanceof ServerPlayer serverPlayer) {
serverPlayer.openMenu(menuProvider,tileEntity.getBlockPos());
} else {
throw new IllegalStateException( this.getClass().getName() + " named container provider is missing!");
}
return InteractionResult.SUCCESS;
public void destroy(@NotNull LevelAccessor levelAccessor, @NotNull BlockPos blockPos, @NotNull BlockState blockState) {
if (levelAccessor.isClientSide()) {
SoundManager manager = Minecraft.getInstance().getSoundManager();
manager.stop(VESounds.ENERGY_BEAM_ACTIVATE.getLocation(), SoundSource.BLOCKS);
manager.stop(VESounds.ENERGY_BEAM_FIRED.getLocation(), SoundSource.BLOCKS);
return;
}
return InteractionResult.SUCCESS;
super.destroy(levelAccessor, blockPos, blockState);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;

public abstract class VEBlock extends Block {
public class VEBlock extends Block {
private String rName;

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

public VEBlock(BlockBehaviour.Properties properties, String rName) {
super(properties);
this.rName = rName;
}

public void setRName(String rName) {
this.rName = rName;
}
Expand Down
Loading