Optimize and updated Dependencies and fully added Tiny torch (#1343)

* Dependency updates

* Tiny torch implementation

Co-authored-by: canitzp <canitzp@gmail.com>
This commit is contained in:
canitzp 2020-09-07 04:32:10 +02:00 committed by GitHub
parent 3a7118be0f
commit 335e121ff2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 222 additions and 49 deletions

12
.gitignore vendored
View file

@ -11,7 +11,6 @@
/lib /lib
/classes /classes
/bin/ /bin/
/run/
*.classpath *.classpath
*.project *.project
@ -19,12 +18,5 @@
*.launch *.launch
.settings/org.eclipse.jdt.core.prefs .settings/org.eclipse.jdt.core.prefs
*.prefs *.prefs
/run/ /run/*
.DS_Store *.DS_Store
src/.DS_Store
src/main/.DS_Store
src/main/java/.DS_Store
src/main/java/de/.DS_Store
src/main/java/de/ellpeck/.DS_Store
src/main/java/de/ellpeck/actuallyadditions/.DS_Store
src/main/java/de/ellpeck/actuallyadditions/mod/.DS_Store

View file

@ -22,18 +22,18 @@ archivesBaseName = "ActuallyAdditions-1.14.4"
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
minecraft { minecraft {
mappings channel: "snapshot", version: "20191107-1.14.3" mappings channel: "stable", version: "58-1.14.4"
runs { runs {
client = { client = {
properties 'forge.logging.markers': '' properties 'forge.logging.markers': ''
properties 'forge.logging.console.level': 'debug' properties 'forge.logging.console.level': 'debug'
workingDirectory project.file('run').canonicalPath workingDirectory project.file('run/client')
source sourceSets.main source sourceSets.main
} }
server = { server = {
properties 'forge.logging.markers': '' properties 'forge.logging.markers': ''
properties 'forge.logging.console.level': 'debug' properties 'forge.logging.console.level': 'debug'
workingDirectory project.file('run/server').canonicalPath workingDirectory project.file('run/server')
source sourceSets.main source sourceSets.main
} }
data = { data = {
@ -52,27 +52,26 @@ repositories {
maven { maven {
url "https://dvs1.progwml6.com/files/maven" url "https://dvs1.progwml6.com/files/maven"
} }
maven { //maven {
url "https://tehnut.info/maven" // url "https://tehnut.info/maven"
} //}
} }
dependencies { dependencies {
minecraft 'net.minecraftforge:forge:1.14.4-28.1.86' minecraft 'net.minecraftforge:forge:1.14.4-28.2.0'
compile fg.deobf('mezz.jei:jei-1.14.4:6.0.0.24') compile fg.deobf('mezz.jei:jei-1.14.4:6.0.1.30')
compile fg.deobf('mcp.mobius.waila:Hwyla:1.10.6-B67_1.14.4') //compile fg.deobf('mcp.mobius.waila:Hwyla:1.10.6-B67_1.14.4')
compile fileTree(dir: 'libs', include: '*.jar') //compile fileTree(dir: 'libs', include: '*.jar')
} }
jar { jar {
manifest { manifest {
attributes(["Specification-Title": "actuallyadditions", attributes(["Specification-Title" : "actuallyadditions",
"Specification-Vendor": "Ellpeck", "Specification-Vendor" : "Ellpeck",
"Specification-Version": "24.0", "Specification-Version" : "24.0",
"Implementation-Title": project.name, "Implementation-Title" : project.name,
"Implementation-Version": "${version}", "Implementation-Version" : "${version}",
"Implementation-Vendor" :"Ellpeck", "Implementation-Vendor" : "Ellpeck",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],) "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
} }
} }

View file

@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip

View file

@ -40,6 +40,7 @@ public class AABlocks {
public static final ColoredLampBlock GREEN_LAMP = null; public static final ColoredLampBlock GREEN_LAMP = null;
public static final ColoredLampBlock RED_LAMP = null; public static final ColoredLampBlock RED_LAMP = null;
public static final ColoredLampBlock BLACK_LAMP = null; public static final ColoredLampBlock BLACK_LAMP = null;
public static final TinyTorchBlock TINY_TORCH = null;
@SubscribeEvent @SubscribeEvent
public static void register(Register<Block> e) { public static void register(Register<Block> e) {
@ -65,7 +66,8 @@ public class AABlocks {
new ColoredLampBlock(LampColor.BROWN).setRegistryName("brown_lamp"), new ColoredLampBlock(LampColor.BROWN).setRegistryName("brown_lamp"),
new ColoredLampBlock(LampColor.GREEN).setRegistryName("green_lamp"), new ColoredLampBlock(LampColor.GREEN).setRegistryName("green_lamp"),
new ColoredLampBlock(LampColor.RED).setRegistryName("red_lamp"), new ColoredLampBlock(LampColor.RED).setRegistryName("red_lamp"),
new ColoredLampBlock(LampColor.BLACK).setRegistryName("black_lamp") new ColoredLampBlock(LampColor.BLACK).setRegistryName("black_lamp"),
new TinyTorchBlock()
); );
//Formatter::on //Formatter::on
} }
@ -78,7 +80,8 @@ public class AABlocks {
new BlockItem(BLACK_QUARTZ_BLOCK, new Item.Properties().group(ActuallyAdditions.GROUP)).setRegistryName(BLACK_QUARTZ_BLOCK.getRegistryName()), new BlockItem(BLACK_QUARTZ_BLOCK, new Item.Properties().group(ActuallyAdditions.GROUP)).setRegistryName(BLACK_QUARTZ_BLOCK.getRegistryName()),
new BlockItem(CHISELED_BLACK_QUARTZ_BLOCK, new Item.Properties().group(ActuallyAdditions.GROUP)).setRegistryName(CHISELED_BLACK_QUARTZ_BLOCK.getRegistryName()), new BlockItem(CHISELED_BLACK_QUARTZ_BLOCK, new Item.Properties().group(ActuallyAdditions.GROUP)).setRegistryName(CHISELED_BLACK_QUARTZ_BLOCK.getRegistryName()),
new BlockItem(BLACK_QUARTZ_PILLAR, new Item.Properties().group(ActuallyAdditions.GROUP)).setRegistryName(BLACK_QUARTZ_PILLAR.getRegistryName()), new BlockItem(BLACK_QUARTZ_PILLAR, new Item.Properties().group(ActuallyAdditions.GROUP)).setRegistryName(BLACK_QUARTZ_PILLAR.getRegistryName()),
new BlockItem(BLACK_QUARTZ_SLAB, new Item.Properties().group(ActuallyAdditions.GROUP)).setRegistryName(BLACK_QUARTZ_SLAB.getRegistryName()) new BlockItem(BLACK_QUARTZ_SLAB, new Item.Properties().group(ActuallyAdditions.GROUP)).setRegistryName(BLACK_QUARTZ_SLAB.getRegistryName()),
new BlockItem(TINY_TORCH, new Item.Properties().group(ActuallyAdditions.GROUP)).setRegistryName(TINY_TORCH.getRegistryName())
); );
//Formatter::on //Formatter::on
for (Block b : ColoredLampBlock.LAMPS.values()) { for (Block b : ColoredLampBlock.LAMPS.values()) {

View file

@ -0,0 +1,159 @@
package de.ellpeck.actuallyadditions.mod.block;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Direction;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Random;
public class TinyTorchBlock extends Block {
public static final DirectionProperty FACING_EXCEPT_DOWN = DirectionProperty.create("facing", direction -> direction != Direction.DOWN);
private static final Properties PROPERTIES = Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0).lightValue(11).sound(SoundType.WOOD).tickRandomly();
private static final VoxelShape STANDING_SHAPE = VoxelShapes.create(0.4375D, 0.0D, 0.4375D, 0.5625D, 0.3125D, 0.5625D);
private static final VoxelShape TORCH_NORTH_SHAPE = VoxelShapes.create(0.4375D, 0.25D, 0.8125D, 0.5625D, 0.5625D, 1.0D);
private static final VoxelShape TORCH_SOUTH_SHAPE = VoxelShapes.create(0.4375D, 0.25D, 0.0D, 0.5625D, 0.5625D, 0.1875D);
private static final VoxelShape TORCH_WEST_SHAPE = VoxelShapes.create(0.8125D, 0.25D, 0.4375D, 1.0D, 0.5625D, 0.5625D);
private static final VoxelShape TORCH_EAST_SHAPE = VoxelShapes.create(0.0D, 0.25D, 0.4375D, 0.1875D, 0.5625D, 0.5625D);
public TinyTorchBlock(){
super(PROPERTIES);
this.setRegistryName(ActuallyAdditions.MODID, "tiny_torch");
this.setDefaultState(this.getStateContainer().getBaseState().with(FACING_EXCEPT_DOWN, Direction.UP));
}
@Nonnull
@Override
public VoxelShape getShape(@Nonnull BlockState state, @Nonnull IBlockReader world, @Nonnull BlockPos pos, @Nonnull ISelectionContext context){
switch(state.get(FACING_EXCEPT_DOWN)){
case EAST:
return TORCH_EAST_SHAPE;
case WEST:
return TORCH_WEST_SHAPE;
case SOUTH:
return TORCH_SOUTH_SHAPE;
case NORTH:
return TORCH_NORTH_SHAPE;
default:
return STANDING_SHAPE;
}
}
@Nonnull
@Override
public VoxelShape getCollisionShape(@Nonnull BlockState state, @Nonnull IBlockReader worldIn, @Nonnull BlockPos pos, @Nonnull ISelectionContext context){
return VoxelShapes.empty();
}
@Nonnull
@Override
public BlockRenderLayer getRenderLayer(){
return BlockRenderLayer.CUTOUT;
}
private boolean canPlaceAt(@Nonnull IWorldReader world, @Nonnull BlockPos pos, @Nonnull Direction direction){
BlockPos blockpos = pos.offset(direction.getOpposite());
return (direction.getAxis().isHorizontal() && hasSolidSide(world.getBlockState(blockpos), world, blockpos, direction)) || (direction.equals(Direction.UP) && hasSolidSideOnTop(world, blockpos));
}
@Override
public boolean isValidPosition(@Nonnull BlockState state, @Nonnull IWorldReader world, @Nonnull BlockPos pos){
for(Direction direction : FACING_EXCEPT_DOWN.getAllowedValues()){
if(this.canPlaceAt(world, pos, direction)){
return true;
}
}
return false;
}
@Nullable
@Override
public BlockState getStateForPlacement(@Nonnull BlockItemUseContext context){
World world = context.getWorld();
BlockPos pos = context.getPos();
Direction placementDirection = context.getFace();
if(this.canPlaceAt(world, pos, placementDirection)){
return this.getDefaultState().with(FACING_EXCEPT_DOWN, placementDirection);
} else{
for(Direction direction : Direction.Plane.HORIZONTAL){
if(hasSolidSide(world.getBlockState(pos), world, pos.offset(direction.getOpposite()), direction)){
return this.getDefaultState().with(FACING_EXCEPT_DOWN, direction);
}
}
}
return super.getStateForPlacement(context);
}
@Override
public void neighborChanged(@Nonnull BlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull Block block, @Nonnull BlockPos fromPos, boolean isMoving){
Direction direction = state.get(FACING_EXCEPT_DOWN);
if(!this.canPlaceAt(world, pos, direction)){
world.addEntity(new ItemEntity(world, pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, new ItemStack(this)));
world.setBlockState(pos, Blocks.AIR.getDefaultState());
}
}
@Override
@OnlyIn(Dist.CLIENT)
public void animateTick(@Nonnull BlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull Random rand){
if(rand.nextBoolean()){
Direction direction = state.get(FACING_EXCEPT_DOWN);
double d0 = pos.getX() + 0.5D;
double d1 = pos.getY() + 0.4D;
double d2 = pos.getZ() + 0.5D;
if(direction.getAxis().isHorizontal()){
Direction direction1 = direction.getOpposite();
world.addParticle(ParticleTypes.SMOKE, d0 + 0.35D * direction1.getXOffset(), d1 + 0.22D, d2 + 0.35D * direction1.getZOffset(), 0.0D, 0.0D, 0.0D);
world.addParticle(ParticleTypes.FLAME, d0 + 0.35D * direction1.getXOffset(), d1 + 0.22D, d2 + 0.35D * direction1.getZOffset(), 0.0D, 0.0D, 0.0D);
} else{
world.addParticle(ParticleTypes.SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D);
world.addParticle(ParticleTypes.FLAME, d0, d1, d2, 0.0D, 0.0D, 0.0D);
}
}
}
@Nonnull
@Override
public BlockState rotate(@Nonnull BlockState state, @Nonnull Rotation rot){
return state.with(FACING_EXCEPT_DOWN, rot.rotate(state.get(FACING_EXCEPT_DOWN)));
}
@Nonnull
@Override
public BlockState mirror(@Nonnull BlockState state, @Nonnull Mirror mirrorIn){
return state.rotate(mirrorIn.toRotation(state.get(FACING_EXCEPT_DOWN)));
}
@Override
protected void fillStateContainer(@Nonnull StateContainer.Builder<Block, BlockState> builder){
builder.add(FACING_EXCEPT_DOWN);
}
}

View file

@ -15,7 +15,7 @@ authors="Ellpeck, Shadows_of_Fire"
[[dependencies.actuallyadditions]] [[dependencies.actuallyadditions]]
modId="forge" modId="forge"
mandatory=true mandatory=true
versionRange="[28.1.86,)" versionRange="[28.2,)"
ordering="NONE" ordering="NONE"
side="BOTH" side="BOTH"

View file

@ -0,0 +1,9 @@
{
"variants": {
"facing=up": { "model": "actuallyadditions:block/tiny_torch_block" },
"facing=east": { "model": "actuallyadditions:block/tiny_torch_wall_block" },
"facing=south": { "model": "actuallyadditions:block/tiny_torch_wall_block", "y": 90 },
"facing=west": { "model": "actuallyadditions:block/tiny_torch_wall_block", "y": 180 },
"facing=north": { "model": "actuallyadditions:block/tiny_torch_wall_block", "y": 270 }
}
}

View file

@ -21,6 +21,7 @@
"block.actuallyadditions.brown_lamp": "Brown Lamp", "block.actuallyadditions.brown_lamp": "Brown Lamp",
"block.actuallyadditions.green_lamp": "Green Lamp", "block.actuallyadditions.green_lamp": "Green Lamp",
"block.actuallyadditions.red_lamp": "Red Lamp", "block.actuallyadditions.red_lamp": "Red Lamp",
"block.actuallyadditions.black_lamp": "Black Lamp" "block.actuallyadditions.black_lamp": "Black Lamp",
"block.actuallyadditions.tiny_torch": "Tiny Torch"
} }

View file

@ -1,8 +1,8 @@
{ {
"ambientocclusion": false, "ambientocclusion": false,
"textures": { "textures": {
"particle": "actuallyadditions:blocks/block_tiny_torch", "particle": "actuallyadditions:block/tiny_torch_block",
"torch": "actuallyadditions:blocks/block_tiny_torch" "torch": "actuallyadditions:block/tiny_torch_block"
}, },
"elements": [ "elements": [
{ "from": [ 7, 0, 7 ], { "from": [ 7, 0, 7 ],

View file

@ -1,8 +1,8 @@
{ {
"ambientocclusion": false, "ambientocclusion": false,
"textures": { "textures": {
"particle": "actuallyadditions:blocks/block_tiny_torch", "particle": "actuallyadditions:block/tiny_torch_block",
"torch": "actuallyadditions:blocks/block_tiny_torch" "torch": "actuallyadditions:block/tiny_torch_block"
}, },
"elements": [ "elements": [
{ "from": [ -1, 3.5, 7 ], { "from": [ -1, 3.5, 7 ],

View file

@ -1,6 +1,6 @@
{ {
"parent": "actuallyadditions:item/standard_item", "parent": "actuallyadditions:item/standard_item",
"textures": { "textures": {
"layer0": "actuallyadditions:blocks/block_tiny_torch" "layer0": "actuallyadditions:block/tiny_torch_block"
} }
} }

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "actuallyadditions:tiny_torch"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View file

@ -1,9 +0,0 @@
{
"variants": {
"facing=up": { "model": "actuallyadditions:block_tiny_torch" },
"facing=east": { "model": "actuallyadditions:block_tiny_torch_wall" },
"facing=south": { "model": "actuallyadditions:block_tiny_torch_wall", "y": 90 },
"facing=west": { "model": "actuallyadditions:block_tiny_torch_wall", "y": 180 },
"facing=north": { "model": "actuallyadditions:block_tiny_torch_wall", "y": 270 }
}
}