Skip to content

Commit

Permalink
- removed the buggy reflector conversion
Browse files Browse the repository at this point in the history
- update ForgeGradle & Gradle version
  • Loading branch information
cech12 committed Jul 20, 2021
1 parent 5e7d625 commit 12e461d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 63 deletions.
13 changes: 7 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,35 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Forge Recommended Versioning](https://mcforge.readthedocs.io/en/latest/conventions/versioning/).

## [1.16.5-1.0.0.0] - 2021-07-15
## [1.16.5-1.0.0.1] - 2021-07-20
### Changed
- Multiple Reflectors can now be placed into one block to face in multiple directions.
- Multiple Reflectors can now be placed into one block to face in multiple directions.
- Attention: All Reflector blocks are facing to north after updating from an older mod version (sorry for that :/)
- Update mod to Forge 1.16.5-36.1.0
- changed versioning to fit [Forge Recommended Versioning](https://mcforge.readthedocs.io/en/latest/conventions/versioning/)
- add some automated tests

## [0.4.0] - 2021-02-01
## [0.4.0_1.16] - 2021-02-01
### Changed
- Add a Shining Block of Diamond.
- Can be placed above a Solar Cooker to use it independently of the sun.
- Add the tag "solarcooker:solar_cooker_shining" to add other blocks with this functionality.
- The Solar Cooker can now be configured to use vanilla campfire_cooking recipes.

## [0.3.0] - 2021-01-21
## [0.3.0_1.16] - 2021-01-21
### Changed
- Reflector block added which speed up the cooking time in an adjacent Solar Cooker
- Solar Cooker has now a opening & closing mechanism
- Solar Cooker recipe advancement triggers now for all wooden chests

## [0.2.0] - 2021-01-21
## [0.2.0_1.16] - 2021-01-18
### Changed
- Render item inside the Solar Cooker
- Solar Cooker drops after breaking it (effective tool: axe)
- Crafting recipe is now more compatible with other mods (uses also colored glass panes & trapped chests)
- Added Solar Cooker as JEI catalyst to better find the recipes
- Change logo

## [0.1.0] - 2021-01-16
## [0.1.0_1.16] - 2021-01-16
### Changed
* Adds a Solar Cooker which needs sunlight instead of fuel.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.+', changing: true
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
19 changes: 3 additions & 16 deletions src/main/java/cech12/solarcooker/block/ReflectorBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.LootContext;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.IntegerProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
Expand All @@ -22,7 +20,6 @@
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
import net.minecraftforge.common.ToolType;

import javax.annotation.Nonnull;
Expand All @@ -35,9 +32,7 @@
import java.util.stream.IntStream;

public class ReflectorBlock extends Block {
public static final IntegerProperty TYPE = IntegerProperty.create("type", 0, 15); //TODO remove 0 value in 1.17
@Deprecated //TODO will be removed in 1.17
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
public static final IntegerProperty TYPE = IntegerProperty.create("type", 1, 15);

protected static final List<Integer> TYPES_WITH_ONE_REFLECTOR = Arrays.asList(1, 2, 4, 8);
protected static final List<Integer> TYPES_WITH_TWO_REFLECTORS = Arrays.asList(3, 5, 6, 9, 10, 12);
Expand Down Expand Up @@ -121,7 +116,7 @@ private static int getCount(int type) {

public ReflectorBlock(Properties properties) {
super(properties);
this.registerDefaultState(this.defaultBlockState().setValue(TYPE, 0).setValue(FACING, Direction.NORTH));
this.registerDefaultState(this.defaultBlockState().setValue(TYPE, getType(Direction.NORTH)));
}

@Override
Expand Down Expand Up @@ -158,7 +153,7 @@ public VoxelShape getShape(@Nonnull BlockState state, @Nonnull IBlockReader worl

@Override
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
builder.add(TYPE, FACING);
builder.add(TYPE);
}

@Override
Expand Down Expand Up @@ -194,12 +189,4 @@ public BlockState rotate(BlockState state, IWorld world, BlockPos pos, Rotation
return state.setValue(TYPE, rotated);
}

@Override
public void onPlace(BlockState newState, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull BlockState oldState, boolean p_220082_5_) {
//conversion of old facing property to new type property
if (newState.getValue(TYPE) == 0) {
world.setBlock(pos, newState.setValue(TYPE, getType(newState.getValue(FACING))), 2); //2 - no block update for neighbors
}
}

}
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"variants": {
"type=0": {
"_comment": "type=0 will be removed in 1.17",
"model": "solarcooker:block/reflector"
},

"type=8": {
"model": "solarcooker:block/reflector"
},
Expand Down
34 changes: 0 additions & 34 deletions src/test/java/cech12/solarcooker/integration/CompatTests.java

This file was deleted.

0 comments on commit 12e461d

Please sign in to comment.