Merge remote-tracking branch 'origin/master' into fabric-1.16

# Conflicts:
#	build.gradle
#	core/src/main/java/appeng/block/AEBaseBlock.java
#	core/src/main/java/appeng/block/misc/TinyTNTBlock.java
#	core/src/main/java/appeng/entity/TinyTNTPrimedRenderer.java
#	core/src/main/java/appeng/fluids/util/AEFluidStack.java
#	src/main/java/appeng/core/AEConfig.java
#	src/main/java/appeng/core/api/definitions/ApiItems.java
#	src/main/java/appeng/debug/EnergyGeneratorBlockEntity.java
#	src/main/java/appeng/entity/TinyTNTPrimedEntity.java
#	src/main/java/appeng/tile/storage/DriveBlockEntity.java
This commit is contained in:
Sebastian Hartte
2020-06-29 21:33:44 +02:00
22 changed files with 314 additions and 125 deletions
@@ -124,11 +124,6 @@ public abstract class AEBaseBlock extends Block {
return false;
}
public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
final @Nullable ItemStack heldItem, final BlockHitResult hit) {
return ActionResult.PASS;
}
public final Direction mapRotation(final IOrientable ori, final Direction dir) {
// case DOWN: return bottomIcon;
// case UP: return blockIcon;
@@ -267,6 +267,11 @@ public abstract class AEBaseTileBlock<T extends AEBaseBlockEntity> extends AEBas
return this.onActivated(world, pos, player, hand, player.getStackInHand(hand), hit);
}
public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
final @Nullable ItemStack heldItem, final BlockHitResult hit) {
return ActionResult.PASS;
}
@Override
public IOrientable getOrientable(final BlockView w, final BlockPos pos) {
return this.getBlockEntity(w, pos);
@@ -65,9 +65,10 @@ public class TinyTNTBlock extends AEBaseBlock {
}
@Override
public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
final @Nullable ItemStack heldItem, final BlockHitResult hit) {
if (heldItem != null && heldItem.getItem() == Items.FLINT_AND_STEEL) {
public ActionResult onUse(BlockState state, World w, BlockPos pos, PlayerEntity player, Hand hand,
final BlockHitResult hit) {
ItemStack heldItem = player.getStackInHand(hand);
if (heldItem.getItem() == Items.FLINT_AND_STEEL) {
this.startFuse(w, pos, player);
w.removeBlock(pos, false);
heldItem.damage(1, player, p -> {
@@ -75,7 +76,7 @@ public class TinyTNTBlock extends AEBaseBlock {
}); // FIXME Check if onBroken is equivalent
return ActionResult.SUCCESS;
} else {
return super.onActivated(w, pos, player, hand, heldItem, hit);
return super.onUse(state, w, pos, player, hand, hit);
}
}
+1 -1
View File
@@ -187,7 +187,7 @@ public final class AEConfig {
}
public boolean isFeatureEnabled(final AEFeature f) {
return this.featureFlags.contains(f);
return (!f.isConfig() && f.isEnabled()) || this.featureFlags.contains(f);
}
public boolean areFeaturesEnabled(Collection<AEFeature> features) {
@@ -22,6 +22,9 @@ import appeng.api.definitions.IItemDefinition;
import appeng.api.definitions.IItems;
import appeng.api.util.AEColoredItemDefinition;
import appeng.bootstrap.FeatureFactory;
import appeng.bootstrap.IItemRendering;
import appeng.bootstrap.ItemRenderingCustomizer;
import appeng.fluids.items.FluidDummyItem;
/**
* Internal implementation for the API items
@@ -253,7 +256,14 @@ public final class ApiItems implements IItems {
// debugTools.item("debug_part_placer", DebugPartPlacerItem::new).build();
//
// this.dummyFluidItem = registry.item("dummy_fluid_item", FluidDummyItem::new)
// .rendering(new FluidDummyItemRendering()).build();
// .rendering(new ItemRenderingCustomizer() {
// @Override
// @Environment(Dist.CLIENT)
// public void customize(IItemRendering rendering) {
// rendering.color(new FluidDummyItemColor());
// }
// })
// .build();
}
// private static AEColoredItemDefinition createPaintBalls(FeatureFactory registry, String idSuffix, boolean lumen) {
@@ -27,6 +27,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.entity.*;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.network.Packet;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
@@ -35,20 +36,37 @@ import net.minecraft.util.math.Box;
import net.minecraft.world.World;
import net.minecraft.world.explosion.Explosion;
import javax.annotation.Nullable;
import java.util.List;
public final class TinyTNTPrimedEntity extends TntEntity {
public static EntityType<TinyTNTPrimedEntity> TYPE;
private LivingEntity causingEntity;
public TinyTNTPrimedEntity(EntityType<? extends TinyTNTPrimedEntity> type, World worldIn) {
super(type, worldIn);
this.inanimate = true;
}
public TinyTNTPrimedEntity(final World w, final double x, final double y, final double z,
public TinyTNTPrimedEntity(final World world, final double x, final double y, final double z,
final LivingEntity igniter) {
super(w, x, y, z, igniter);
this(TYPE, world);
this.updatePosition(x, y, z);
double d = world.random.nextDouble() * 6.2831854820251465D;
this.setVelocity(-Math.sin(d) * 0.02D, 0.20000000298023224D, -Math.cos(d) * 0.02D);
this.setFuse(80);
this.prevX = x;
this.prevY = y;
this.prevZ = z;
this.causingEntity = igniter;
}
@Nullable
@Override
public LivingEntity getCausingEntity() {
return causingEntity;
}
/**
@@ -159,4 +177,10 @@ public final class TinyTNTPrimedEntity extends TntEntity {
// new MockExplosionPacket(this.getX(), this.getY(), this.getZ()));
}
@Override
public Packet<?> createSpawnPacket() {
// FIXME FABRIC
throw new IllegalStateException();
}
}
@@ -38,7 +38,7 @@ public class TinyTNTPrimedRenderer extends EntityRenderer<TinyTNTPrimedEntity> {
public TinyTNTPrimedRenderer(final EntityRenderDispatcher manager) {
super(manager);
this.shadowRadius = 0.5F;
this.shadowRadius = 0.25F;
}
@Override
@@ -14,10 +14,23 @@
"from": [0, 1, 0],
"to": [1, 15, 16],
"faces": {
"north": { "uv": [15, 1, 16, 15], "texture": "#front" },
"east": { "uv": [0, 0, 16, 16], "rotation": 180, "texture": "#inside" },
"south": { "uv": [0, 1, 1, 15], "texture": "#side" },
"west": { "uv": [0, 1, 16, 15], "texture": "#side" }
"north": {
"uv": [15, 1, 16, 15],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [0, 0, 16, 16],
"rotation": 180,
"texture": "#inside",
"cullface": "north"
},
"south": {
"uv": [0, 1, 1, 15],
"texture": "#side",
"cullface": "south"
},
"west": { "uv": [0, 1, 16, 15], "texture": "#side", "cullface": "west" }
}
},
{
@@ -25,10 +38,26 @@
"from": [15, 1, 0],
"to": [16, 15, 16],
"faces": {
"north": { "uv": [0, 1, 1, 15], "texture": "#front" },
"east": { "uv": [0, 1, 16, 15], "texture": "#side" },
"south": { "uv": [15, 1, 16, 15], "texture": "#side" },
"west": { "uv": [0, 0, 16, 16], "texture": "#inside" }
"north": {
"uv": [0, 1, 1, 15],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [0, 1, 16, 15],
"texture": "#side",
"cullface": "east"
},
"south": {
"uv": [15, 1, 16, 15],
"texture": "#side",
"cullface": "south"
},
"west": {
"uv": [0, 0, 16, 16],
"texture": "#inside",
"cullface": "north"
}
}
},
{
@@ -38,7 +67,11 @@
"rotation": { "angle": 0, "axis": "y", "origin": [8, 8, 9] },
"faces": {
"north": { "uv": [15, 1, 16, 15], "texture": "#inside" },
"south": { "uv": [1, 1, 15, 15], "texture": "#side" }
"south": {
"uv": [1, 1, 15, 15],
"texture": "#side",
"cullface": "south"
}
}
},
{
@@ -46,12 +79,37 @@
"from": [0, 0, 0],
"to": [16, 1, 16],
"faces": {
"north": { "uv": [0, 15, 16, 16], "texture": "#front" },
"east": { "uv": [0, 15, 16, 16], "texture": "#side" },
"south": { "uv": [0, 15, 16, 16], "texture": "#side" },
"west": { "uv": [0, 15, 16, 16], "texture": "#side" },
"up": { "uv": [0, 0, 16, 16], "rotation": 90, "texture": "#inside" },
"down": { "uv": [0, 0, 16, 16], "texture": "#bottom" }
"north": {
"uv": [0, 15, 16, 16],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [0, 15, 16, 16],
"texture": "#side",
"cullface": "east"
},
"south": {
"uv": [0, 15, 16, 16],
"texture": "#side",
"cullface": "south"
},
"west": {
"uv": [0, 15, 16, 16],
"texture": "#side",
"cullface": "west"
},
"up": {
"uv": [0, 0, 16, 16],
"rotation": 90,
"texture": "#inside",
"cullface": "north"
},
"down": {
"uv": [0, 0, 16, 16],
"texture": "#bottom",
"cullface": "down"
}
}
},
{
@@ -59,12 +117,25 @@
"from": [0, 15, 0],
"to": [16, 16, 16],
"faces": {
"north": { "uv": [0, 0, 16, 1], "texture": "#front" },
"east": { "uv": [0, 0, 16, 1], "texture": "#side" },
"south": { "uv": [0, 0, 16, 1], "texture": "#side" },
"west": { "uv": [0, 0, 16, 1], "texture": "#side" },
"up": { "uv": [0, 0, 16, 16], "texture": "#top" },
"down": { "uv": [0, 0, 16, 16], "rotation": 270, "texture": "#inside" }
"north": {
"uv": [0, 0, 16, 1],
"texture": "#front",
"cullface": "north"
},
"east": { "uv": [0, 0, 16, 1], "texture": "#side", "cullface": "east" },
"south": {
"uv": [0, 0, 16, 1],
"texture": "#side",
"cullface": "south"
},
"west": { "uv": [0, 0, 16, 1], "texture": "#side", "cullface": "west" },
"up": { "uv": [0, 0, 16, 16], "texture": "#top", "cullface": "up" },
"down": {
"uv": [0, 0, 16, 16],
"rotation": 270,
"texture": "#inside",
"cullface": "north"
}
}
},
{
@@ -72,9 +143,22 @@
"from": [7, 1, 1],
"to": [9, 15, 7],
"faces": {
"north": { "uv": [7, 1, 9, 15], "texture": "#front" },
"east": { "uv": [1, 1, 7, 15], "rotation": 180, "texture": "#inside" },
"west": { "uv": [1, 1, 7, 15], "texture": "#inside" }
"north": {
"uv": [7, 1, 9, 15],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [1, 1, 7, 15],
"rotation": 180,
"texture": "#inside",
"cullface": "north"
},
"west": {
"uv": [1, 1, 7, 15],
"texture": "#inside",
"cullface": "north"
}
}
},
{
@@ -82,9 +166,23 @@
"from": [1, 3, 2],
"to": [15, 4, 7],
"faces": {
"north": { "uv": [1, 12, 15, 13], "texture": "#front" },
"up": { "uv": [2, 1, 7, 15], "rotation": 90, "texture": "#inside" },
"down": { "uv": [2, 1, 7, 15], "rotation": 270, "texture": "#inside" }
"north": {
"uv": [1, 12, 15, 13],
"texture": "#front",
"cullface": "north"
},
"up": {
"uv": [2, 1, 7, 15],
"rotation": 90,
"texture": "#inside",
"cullface": "north"
},
"down": {
"uv": [2, 1, 7, 15],
"rotation": 270,
"texture": "#inside",
"cullface": "north"
}
}
},
{
@@ -92,9 +190,23 @@
"from": [1, 6, 2],
"to": [15, 7, 7],
"faces": {
"north": { "uv": [1, 9, 15, 10], "texture": "#front" },
"up": { "uv": [2, 1, 7, 15], "rotation": 90, "texture": "#inside" },
"down": { "uv": [2, 1, 7, 15], "rotation": 270, "texture": "#inside" }
"north": {
"uv": [1, 9, 15, 10],
"texture": "#front",
"cullface": "north"
},
"up": {
"uv": [2, 1, 7, 15],
"rotation": 90,
"texture": "#inside",
"cullface": "north"
},
"down": {
"uv": [2, 1, 7, 15],
"rotation": 270,
"texture": "#inside",
"cullface": "north"
}
}
},
{
@@ -102,9 +214,23 @@
"from": [1, 9, 2],
"to": [15, 10, 7],
"faces": {
"north": { "uv": [1, 6, 15, 7], "texture": "#front" },
"up": { "uv": [2, 1, 7, 15], "rotation": 90, "texture": "#inside" },
"down": { "uv": [2, 1, 7, 15], "rotation": 270, "texture": "#inside" }
"north": {
"uv": [1, 6, 15, 7],
"texture": "#front",
"cullface": "north"
},
"up": {
"uv": [2, 1, 7, 15],
"rotation": 90,
"texture": "#inside",
"cullface": "north"
},
"down": {
"uv": [2, 1, 7, 15],
"rotation": 270,
"texture": "#inside",
"cullface": "north"
}
}
},
{
@@ -112,9 +238,23 @@
"from": [1, 12, 2],
"to": [15, 13, 7],
"faces": {
"north": { "uv": [1, 3, 15, 4], "texture": "#front" },
"up": { "uv": [2, 1, 7, 15], "rotation": 90, "texture": "#inside" },
"down": { "uv": [2, 1, 7, 15], "rotation": 270, "texture": "#inside" }
"north": {
"uv": [1, 3, 15, 4],
"texture": "#front",
"cullface": "north"
},
"up": {
"uv": [2, 1, 7, 15],
"rotation": 90,
"texture": "#inside",
"cullface": "north"
},
"down": {
"uv": [2, 1, 7, 15],
"rotation": 270,
"texture": "#inside",
"cullface": "north"
}
}
}
]