inital 19w46a port
This commit is contained in:
parent
3fe62e2c77
commit
a984263b04
48 changed files with 356 additions and 339 deletions
10
build.gradle
10
build.gradle
|
@ -10,7 +10,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "net.fabricmc:fabric-loom:0.2.5-SNAPSHOT"
|
classpath "net.fabricmc:fabric-loom:0.2.6-SNAPSHOT"
|
||||||
classpath "gradle.plugin.net.minecrell:licenser:0.2.1"
|
classpath "gradle.plugin.net.minecrell:licenser:0.2.1"
|
||||||
classpath 'de.undercouch:gradle-download-task:3.4.3'
|
classpath 'de.undercouch:gradle-download-task:3.4.3'
|
||||||
//classpath 'net.covers1624:GradleStuff:1.0-SNAPSHOT'
|
//classpath 'net.covers1624:GradleStuff:1.0-SNAPSHOT'
|
||||||
|
@ -68,12 +68,12 @@ license {
|
||||||
group = 'TechReborn'
|
group = 'TechReborn'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
minecraft "com.mojang:minecraft:19w38b"
|
minecraft "com.mojang:minecraft:19w46a"
|
||||||
mappings "net.fabricmc:yarn:19w38b+build.4"
|
mappings "net.fabricmc:yarn:19w46a+build.2:v2"
|
||||||
modCompile "net.fabricmc:fabric-loader:0.6.2+build.166"
|
modCompile "net.fabricmc:fabric-loader:0.6.4+build.169"
|
||||||
|
|
||||||
//Fabric api
|
//Fabric api
|
||||||
modCompile "net.fabricmc.fabric-api:fabric-api:0.3.2+build.232-1.15"
|
modCompile "net.fabricmc.fabric-api:fabric-api:0.4.12+build.261-1.15"
|
||||||
|
|
||||||
modCompileOnly "io.github.prospector:modmenu:1.7.9-unstable.19w34a+build.1"
|
modCompileOnly "io.github.prospector:modmenu:1.7.9-unstable.19w34a+build.1"
|
||||||
modCompileOnly ("me.shedaniel:RoughlyEnoughItems:3.1-pre+build.4") {
|
modCompileOnly ("me.shedaniel:RoughlyEnoughItems:3.1-pre+build.4") {
|
||||||
|
|
|
@ -27,7 +27,8 @@ package techreborn;
|
||||||
import net.fabricmc.api.ClientModInitializer;
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
||||||
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
|
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
|
||||||
import net.minecraft.block.BlockRenderLayer;
|
import net.minecraft.client.render.RenderLayer;
|
||||||
|
import net.minecraft.client.render.RenderLayers;
|
||||||
import net.minecraft.client.render.model.BakedModel;
|
import net.minecraft.client.render.model.BakedModel;
|
||||||
import net.minecraft.client.render.model.ModelBakeSettings;
|
import net.minecraft.client.render.model.ModelBakeSettings;
|
||||||
import net.minecraft.client.render.model.ModelLoader;
|
import net.minecraft.client.render.model.ModelLoader;
|
||||||
|
@ -49,6 +50,7 @@ import techreborn.items.ItemDynamicCell;
|
||||||
import techreborn.items.ItemFrequencyTransmitter;
|
import techreborn.items.ItemFrequencyTransmitter;
|
||||||
import techreborn.utils.StackWIPHandler;
|
import techreborn.utils.StackWIPHandler;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -85,10 +87,12 @@ public class TechRebornClient implements ClientModInitializer {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public BakedModel bake(ModelLoader modelLoader, Function<Identifier, Sprite> function, ModelBakeSettings modelBakeSettings) {
|
public BakedModel bake(ModelLoader loader, Function<Identifier, Sprite> textureGetter, ModelBakeSettings rotationContainer, Identifier identifier) {
|
||||||
return new DynamicCellBakedModel();
|
return new DynamicCellBakedModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Fluid fluid = Registry.FLUID.get(new Identifier(TechReborn.MOD_ID, modelIdentifier.getPath().split("_bucket")[0]));
|
Fluid fluid = Registry.FLUID.get(new Identifier(TechReborn.MOD_ID, modelIdentifier.getPath().split("_bucket")[0]));
|
||||||
|
@ -104,8 +108,9 @@ public class TechRebornClient implements ClientModInitializer {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public BakedModel bake(ModelLoader modelLoader, Function<Identifier, Sprite> function, ModelBakeSettings modelBakeSettings) {
|
public BakedModel bake(ModelLoader loader, Function<Identifier, Sprite> textureGetter, ModelBakeSettings rotationContainer, Identifier identifier) {
|
||||||
return new DynamicBucketBakedModel();
|
return new DynamicBucketBakedModel();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -122,11 +127,11 @@ public class TechRebornClient implements ClientModInitializer {
|
||||||
|
|
||||||
StackInfoHUD.registerElement(new ItemFrequencyTransmitter.StackInfoFreqTransmitter());
|
StackInfoHUD.registerElement(new ItemFrequencyTransmitter.StackInfoFreqTransmitter());
|
||||||
|
|
||||||
Arrays.stream(TRContent.Cables.values()).forEach(cable -> BlockRenderLayerMap.INSTANCE.putBlock(cable.block, BlockRenderLayer.field_9174));
|
Arrays.stream(TRContent.Cables.values()).forEach(cable -> BlockRenderLayerMap.INSTANCE.putBlock(cable.block, RenderLayer.getCutout()));
|
||||||
|
|
||||||
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.Machine.LAMP_INCANDESCENT.block, BlockRenderLayer.field_9174);
|
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.Machine.LAMP_INCANDESCENT.block, RenderLayer.getCutout());
|
||||||
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.Machine.LAMP_LED.block, BlockRenderLayer.field_9174);
|
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.Machine.LAMP_LED.block, RenderLayer.getCutout());
|
||||||
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.Machine.ALARM.block, BlockRenderLayer.field_9174);
|
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.Machine.ALARM.block, RenderLayer.getCutout());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class FluidReplicatorRecipe extends RebornFluidRecipe {
|
||||||
if (!blockEntity.getMultiBlock()) {
|
if (!blockEntity.getMultiBlock()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final BlockPos hole = blockEntity.getPos().offset(blockEntity.getFacing().getOpposite(), 2);
|
final BlockPos hole = blockEntity.getPos().method_10079(blockEntity.getFacing().getOpposite(), 2);
|
||||||
final Fluid fluid = techreborn.utils.FluidUtils.fluidFromBlock(blockEntity.getWorld().getBlockState(hole).getBlock());
|
final Fluid fluid = techreborn.utils.FluidUtils.fluidFromBlock(blockEntity.getWorld().getBlockState(hole).getBlock());
|
||||||
if (fluid == Fluids.EMPTY) {
|
if (fluid == Fluids.EMPTY) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class AlarmBlockEntity extends BlockEntity
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fromTag(CompoundTag compound) {
|
public void fromTag(CompoundTag compound) {
|
||||||
if (compound != null && compound.containsKey("selectedSound")) {
|
if (compound != null && compound.contains("selectedSound")) {
|
||||||
selectedSound = compound.getInt("selectedSound");
|
selectedSound = compound.getInt("selectedSound");
|
||||||
}
|
}
|
||||||
super.fromTag(compound);
|
super.fromTag(compound);
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class TechStorageBaseBlockEntity extends MachineBaseBlockEntity
|
||||||
|
|
||||||
storedItem = ItemStack.EMPTY;
|
storedItem = ItemStack.EMPTY;
|
||||||
|
|
||||||
if (tagCompound.containsKey("storedStack")) {
|
if (tagCompound.contains("storedStack")) {
|
||||||
storedItem = ItemStack.fromTag(tagCompound.getCompound("storedStack"));
|
storedItem = ItemStack.fromTag(tagCompound.getCompound("storedStack"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class CableBlockEntity extends BlockEntity
|
||||||
@Override
|
@Override
|
||||||
public void fromTag(CompoundTag compound) {
|
public void fromTag(CompoundTag compound) {
|
||||||
super.fromTag(compound);
|
super.fromTag(compound);
|
||||||
if (compound.containsKey("CableBlockEntity")) {
|
if (compound.contains("CableBlockEntity")) {
|
||||||
energy = compound.getCompound("CableBlockEntity").getInt("power");
|
energy = compound.getCompound("CableBlockEntity").getInt("power");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -340,14 +340,14 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity
|
||||||
this.finalTickTime = tagCompound.getInt("finalTickTime");
|
this.finalTickTime = tagCompound.getInt("finalTickTime");
|
||||||
this.neededPower = tagCompound.getInt("neededPower");
|
this.neededPower = tagCompound.getInt("neededPower");
|
||||||
this.hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting");
|
this.hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting");
|
||||||
if(tagCompound.containsKey("hasActiveRecipe") && tagCompound.getBoolean("hasActiveRecipe") && this.currentRecipe == null){
|
if(tagCompound.contains("hasActiveRecipe") && tagCompound.getBoolean("hasActiveRecipe") && this.currentRecipe == null){
|
||||||
for (final RebornRecipe reactorRecipe : ModRecipes.FUSION_REACTOR.getRecipes(getWorld())) {
|
for (final RebornRecipe reactorRecipe : ModRecipes.FUSION_REACTOR.getRecipes(getWorld())) {
|
||||||
if (validateRecipe((FusionReactorRecipe) reactorRecipe)) {
|
if (validateRecipe((FusionReactorRecipe) reactorRecipe)) {
|
||||||
this.currentRecipe = (FusionReactorRecipe) reactorRecipe;
|
this.currentRecipe = (FusionReactorRecipe) reactorRecipe;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(tagCompound.containsKey("size")){
|
if(tagCompound.contains("size")){
|
||||||
this.size = tagCompound.getInt("size");
|
this.size = tagCompound.getInt("size");
|
||||||
}
|
}
|
||||||
this.size = Math.min(size, TechRebornConfig.fusionControlComputerMaxCoilSize);//Done here to force the samller size, will be useful if people lag out on a large one.
|
this.size = Math.min(size, TechRebornConfig.fusionControlComputerMaxCoilSize);//Done here to force the samller size, will be useful if people lag out on a large one.
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class IronFurnaceBlockEntity extends AbstractIronMachineBlockEntity imple
|
||||||
while (totalExperience > 0) {
|
while (totalExperience > 0) {
|
||||||
int expToDrop = ExperienceOrbEntity.roundToOrbSize(totalExperience);
|
int expToDrop = ExperienceOrbEntity.roundToOrbSize(totalExperience);
|
||||||
totalExperience -= expToDrop;
|
totalExperience -= expToDrop;
|
||||||
player.world.spawnEntity(new ExperienceOrbEntity(player.world, player.x, player.y + 0.5D, player.z + 0.5D, expToDrop));
|
player.world.spawnEntity(new ExperienceOrbEntity(player.world, player.getX(), player.getY() + 0.5D, player.getZ() + 0.5D, expToDrop));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
experience = 0;
|
experience = 0;
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class DistillationTowerBlockEntity extends GenericMachineBlockEntity impl
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (multiblockChecker == null) {
|
if (multiblockChecker == null) {
|
||||||
final BlockPos downCenter = pos.offset(getFacing().getOpposite(), 2);
|
final BlockPos downCenter = pos.method_10079(getFacing().getOpposite(), 2);
|
||||||
multiblockChecker = new MultiblockChecker(world, downCenter);
|
multiblockChecker = new MultiblockChecker(world, downCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implem
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (multiblockChecker == null) {
|
if (multiblockChecker == null) {
|
||||||
final BlockPos downCenter = pos.offset(getFacing().getOpposite(), 2);
|
final BlockPos downCenter = pos.method_10079(getFacing().getOpposite(), 2);
|
||||||
multiblockChecker = new MultiblockChecker(world, downCenter);
|
multiblockChecker = new MultiblockChecker(world, downCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bottom center of multiblock
|
// Bottom center of multiblock
|
||||||
final BlockPos location = pos.offset(getFacing().getOpposite(), 2);
|
final BlockPos location = pos.method_10079(getFacing().getOpposite(), 2);
|
||||||
final BlockEntity blockEntity = world.getBlockEntity(location);
|
final BlockEntity blockEntity = world.getBlockEntity(location);
|
||||||
|
|
||||||
if (blockEntity instanceof MachineCasingBlockEntity) {
|
if (blockEntity instanceof MachineCasingBlockEntity) {
|
||||||
|
@ -83,8 +83,8 @@ public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity
|
||||||
heat += BlockMachineCasing.getHeatFromState(part.getCachedState());
|
heat += BlockMachineCasing.getHeatFromState(part.getCachedState());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world.getBlockState(location.offset(Direction.UP, 1)).getMaterial().equals(Material.LAVA)
|
if (world.getBlockState(location.method_10079(Direction.UP, 1)).getMaterial().equals(Material.LAVA)
|
||||||
&& world.getBlockState(location.offset(Direction.UP, 2)).getMaterial().equals(Material.LAVA)) {
|
&& world.getBlockState(location.method_10079(Direction.UP, 2)).getMaterial().equals(Material.LAVA)) {
|
||||||
heat += 500;
|
heat += 500;
|
||||||
}
|
}
|
||||||
return heat;
|
return heat;
|
||||||
|
@ -121,7 +121,7 @@ public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (multiblockChecker == null) {
|
if (multiblockChecker == null) {
|
||||||
final BlockPos downCenter = pos.offset(getFacing().getOpposite(), 2);
|
final BlockPos downCenter = pos.method_10079(getFacing().getOpposite(), 2);
|
||||||
multiblockChecker = new MultiblockChecker(world, downCenter);
|
multiblockChecker = new MultiblockChecker(world, downCenter);
|
||||||
}
|
}
|
||||||
super.tick();
|
super.tick();
|
||||||
|
|
|
@ -30,6 +30,7 @@ import net.minecraft.block.Material;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
import reborncore.client.containerBuilder.IContainerProvider;
|
import reborncore.client.containerBuilder.IContainerProvider;
|
||||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||||
|
@ -80,7 +81,7 @@ public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity impl
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (multiblockChecker == null) {
|
if (multiblockChecker == null) {
|
||||||
final BlockPos downCenter = pos.offset(getFacing().getOpposite(), 2).down();
|
final BlockPos downCenter = pos.method_10079(getFacing().getOpposite(), 2).method_10079(Direction.DOWN, 1);
|
||||||
multiblockChecker = new MultiblockChecker(world, downCenter);
|
multiblockChecker = new MultiblockChecker(world, downCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ import net.minecraft.block.Material;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
import reborncore.client.containerBuilder.IContainerProvider;
|
import reborncore.client.containerBuilder.IContainerProvider;
|
||||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||||
|
@ -80,7 +81,7 @@ public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity impl
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (multiblockChecker == null) {
|
if (multiblockChecker == null) {
|
||||||
final BlockPos downCenter = pos.offset(getFacing().getOpposite(), 2).down();
|
final BlockPos downCenter = pos.method_10079(getFacing().getOpposite(), 2).method_10079(Direction.DOWN, 1);
|
||||||
multiblockChecker = new MultiblockChecker(world, downCenter);
|
multiblockChecker = new MultiblockChecker(world, downCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ package techreborn.blockentity.machine.multiblock;
|
||||||
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
import reborncore.client.containerBuilder.IContainerProvider;
|
import reborncore.client.containerBuilder.IContainerProvider;
|
||||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||||
|
@ -71,7 +72,7 @@ public class VacuumFreezerBlockEntity extends GenericMachineBlockEntity implemen
|
||||||
@Override
|
@Override
|
||||||
public void cancelRemoval() {
|
public void cancelRemoval() {
|
||||||
super.cancelRemoval();
|
super.cancelRemoval();
|
||||||
multiblockChecker = new MultiblockChecker(world, pos.down());
|
multiblockChecker = new MultiblockChecker(world, pos.method_10079(Direction.DOWN, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
// IContainerProvider
|
// IContainerProvider
|
||||||
|
|
|
@ -378,7 +378,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fromTag(CompoundTag tag) {
|
public void fromTag(CompoundTag tag) {
|
||||||
if (tag.containsKey("locked")) {
|
if (tag.contains("locked")) {
|
||||||
locked = tag.getBoolean("locked");
|
locked = tag.getBoolean("locked");
|
||||||
}
|
}
|
||||||
super.fromTag(tag);
|
super.fromTag(tag);
|
||||||
|
|
|
@ -28,13 +28,14 @@ import net.minecraft.block.*;
|
||||||
import net.minecraft.entity.EntityContext;
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.text.TranslatableText;
|
import net.minecraft.text.TranslatableText;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Formatting;
|
import net.minecraft.util.Formatting;
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
import net.minecraft.block.entity.BlockEntity;
|
||||||
import net.minecraft.client.item.TooltipContext;
|
import net.minecraft.client.item.TooltipContext;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.state.StateFactory;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.state.property.BooleanProperty;
|
import net.minecraft.state.property.BooleanProperty;
|
||||||
import net.minecraft.state.property.DirectionProperty;
|
import net.minecraft.state.property.DirectionProperty;
|
||||||
import net.minecraft.state.property.Properties;
|
import net.minecraft.state.property.Properties;
|
||||||
|
@ -106,7 +107,7 @@ public class BlockAlarm extends BaseBlockEntityProvider {
|
||||||
|
|
||||||
// Block
|
// Block
|
||||||
@Override
|
@Override
|
||||||
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
|
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||||
ACTIVE = BooleanProperty.of("active");
|
ACTIVE = BooleanProperty.of("active");
|
||||||
builder.add(FACING, ACTIVE);
|
builder.add(FACING, ACTIVE);
|
||||||
}
|
}
|
||||||
|
@ -124,28 +125,28 @@ public class BlockAlarm extends BaseBlockEntityProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
public ActionResult onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||||
|
|
||||||
// We extended BaseTileBlock. Thus we should always have blockEntity entity. I hope.
|
// We extended BaseTileBlock. Thus we should always have blockEntity entity. I hope.
|
||||||
if (blockEntity == null) {
|
if (blockEntity == null) {
|
||||||
return false;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
||||||
if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) {
|
if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) {
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!worldIn.isClient && playerIn.isSneaking()) {
|
if (!worldIn.isClient && playerIn.isSneaking()) {
|
||||||
((AlarmBlockEntity) blockEntity).rightClick();
|
((AlarmBlockEntity) blockEntity).rightClick();
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.activate(state, worldIn, pos, playerIn, hand, hitResult);
|
return super.onUse(state, worldIn, pos, playerIn, hand, hitResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -34,9 +34,10 @@ import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.particle.ParticleTypes;
|
import net.minecraft.particle.ParticleTypes;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.state.StateFactory;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.state.property.AbstractProperty;
|
import net.minecraft.state.property.AbstractProperty;
|
||||||
import net.minecraft.state.property.BooleanProperty;
|
import net.minecraft.state.property.BooleanProperty;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -99,7 +100,7 @@ public class BlockCable extends BlockWithEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private BlockState makeConnections(World world, BlockPos pos) {
|
private BlockState makeConnections(World world, BlockPos pos) {
|
||||||
Boolean down = canConnectTo(world, pos.down(), Direction.UP);
|
Boolean down = canConnectTo(world, pos.method_10079(Direction.DOWN, 1), Direction.UP);
|
||||||
Boolean up = canConnectTo(world, pos.up(), Direction.DOWN);
|
Boolean up = canConnectTo(world, pos.up(), Direction.DOWN);
|
||||||
Boolean north = canConnectTo(world, pos.north(), Direction.SOUTH);
|
Boolean north = canConnectTo(world, pos.north(), Direction.SOUTH);
|
||||||
Boolean east = canConnectTo(world, pos.east(), Direction.WEST);
|
Boolean east = canConnectTo(world, pos.east(), Direction.WEST);
|
||||||
|
@ -132,25 +133,25 @@ public class BlockCable extends BlockWithEntity {
|
||||||
|
|
||||||
// Block
|
// Block
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
public ActionResult onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||||
|
|
||||||
// We should always have blockEntity entity. I hope.
|
// We should always have blockEntity entity. I hope.
|
||||||
if (blockEntity == null) {
|
if (blockEntity == null) {
|
||||||
return false;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
||||||
if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) {
|
if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) {
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.activate(state, worldIn, pos, playerIn, hand, hitResult);
|
return super.onUse(state, worldIn, pos, playerIn, hand, hitResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
|
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||||
builder.add(EAST, WEST, NORTH, SOUTH, UP, DOWN);
|
builder.add(EAST, WEST, NORTH, SOUTH, UP, DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,11 +208,11 @@ public class BlockCable extends BlockWithEntity {
|
||||||
entityIn.damage(new ElectrialShockSource(), 1F);
|
entityIn.damage(new ElectrialShockSource(), 1F);
|
||||||
}
|
}
|
||||||
if (TechRebornConfig.uninsulatedElectrocutionSound) {
|
if (TechRebornConfig.uninsulatedElectrocutionSound) {
|
||||||
worldIn.playSound(null, entityIn.x, entityIn.y, entityIn.z, ModSounds.CABLE_SHOCK, SoundCategory.BLOCKS,
|
worldIn.playSound(null, entityIn.getX(), entityIn.getY(), entityIn.getZ(), ModSounds.CABLE_SHOCK, SoundCategory.BLOCKS,
|
||||||
0.6F, 1F);
|
0.6F, 1F);
|
||||||
}
|
}
|
||||||
if (TechRebornConfig.uninsulatedElectrocutionParticles) {
|
if (TechRebornConfig.uninsulatedElectrocutionParticles) {
|
||||||
worldIn.addParticle(ParticleTypes.CRIT, entityIn.x, entityIn.y, entityIn.z, 0, 0, 0);
|
worldIn.addParticle(ParticleTypes.CRIT, entityIn.getX(), entityIn.getY(), entityIn.getZ(), 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ import net.minecraft.sound.BlockSoundGroup;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.text.LiteralText;
|
import net.minecraft.text.LiteralText;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -56,8 +57,8 @@ public class BlockFusionCoil extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn,
|
public ActionResult onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn,
|
||||||
Hand hand, BlockHitResult hitResult) {
|
Hand hand, BlockHitResult hitResult) {
|
||||||
|
|
||||||
ItemStack tool = playerIn.getStackInHand(Hand.MAIN_HAND);
|
ItemStack tool = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||||
if (!tool.isEmpty() && ToolManager.INSTANCE.canHandleTool(tool)) {
|
if (!tool.isEmpty() && ToolManager.INSTANCE.canHandleTool(tool)) {
|
||||||
|
@ -65,16 +66,16 @@ public class BlockFusionCoil extends Block {
|
||||||
if (playerIn.isSneaking()) {
|
if (playerIn.isSneaking()) {
|
||||||
ItemStack drop = new ItemStack(this);
|
ItemStack drop = new ItemStack(this);
|
||||||
dropStack(worldIn, pos, drop);
|
dropStack(worldIn, pos, drop);
|
||||||
worldIn.playSound(null, playerIn.x, playerIn.y, playerIn.z, ModSounds.BLOCK_DISMANTLE,
|
worldIn.playSound(null, playerIn.getX(), playerIn.getY(), playerIn.getZ(), ModSounds.BLOCK_DISMANTLE,
|
||||||
SoundCategory.BLOCKS, 0.6F, 1F);
|
SoundCategory.BLOCKS, 0.6F, 1F);
|
||||||
if (!worldIn.isClient) {
|
if (!worldIn.isClient) {
|
||||||
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
|
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
|
||||||
}
|
}
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return ActionResult.PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
|
|
|
@ -28,6 +28,7 @@ import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
import net.minecraft.block.entity.BlockEntity;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -46,15 +47,15 @@ import java.util.List;
|
||||||
public class BlockFusionControlComputer extends BlockMachineBase {
|
public class BlockFusionControlComputer extends BlockMachineBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn,
|
public ActionResult onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn,
|
||||||
Hand hand, BlockHitResult hitResult) {
|
Hand hand, BlockHitResult hitResult) {
|
||||||
final FusionControlComputerBlockEntity blockEntityFusionControlComputer = (FusionControlComputerBlockEntity) worldIn.getBlockEntity(pos);
|
final FusionControlComputerBlockEntity blockEntityFusionControlComputer = (FusionControlComputerBlockEntity) worldIn.getBlockEntity(pos);
|
||||||
if(!playerIn.getStackInHand(hand).isEmpty() && (playerIn.getStackInHand(hand).getItem() == TRContent.Machine.FUSION_COIL.asItem())){
|
if(!playerIn.getStackInHand(hand).isEmpty() && (playerIn.getStackInHand(hand).getItem() == TRContent.Machine.FUSION_COIL.asItem())){
|
||||||
List<BlockPos> coils = Torus.generate(blockEntityFusionControlComputer.getPos(), blockEntityFusionControlComputer.size);
|
List<BlockPos> coils = Torus.generate(blockEntityFusionControlComputer.getPos(), blockEntityFusionControlComputer.size);
|
||||||
boolean placed = false;
|
boolean placed = false;
|
||||||
for(BlockPos coil : coils){
|
for(BlockPos coil : coils){
|
||||||
if(playerIn.getStackInHand(hand).isEmpty()){
|
if(playerIn.getStackInHand(hand).isEmpty()){
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
if(worldIn.isAir(coil) && !blockEntityFusionControlComputer.isCoil(coil)){
|
if(worldIn.isAir(coil) && !blockEntityFusionControlComputer.isCoil(coil)){
|
||||||
worldIn.setBlockState(coil, TRContent.Machine.FUSION_COIL.block.getDefaultState());
|
worldIn.setBlockState(coil, TRContent.Machine.FUSION_COIL.block.getDefaultState());
|
||||||
|
@ -65,12 +66,12 @@ public class BlockFusionControlComputer extends BlockMachineBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(placed){
|
if(placed){
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
blockEntityFusionControlComputer.checkCoils();
|
blockEntityFusionControlComputer.checkCoils();
|
||||||
return super.activate(state, worldIn, pos, playerIn, hand, hitResult);
|
return super.onUse(state, worldIn, pos, playerIn, hand, hitResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -30,10 +30,11 @@ import net.minecraft.block.entity.BlockEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.state.StateFactory;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.state.property.BooleanProperty;
|
import net.minecraft.state.property.BooleanProperty;
|
||||||
import net.minecraft.state.property.DirectionProperty;
|
import net.minecraft.state.property.DirectionProperty;
|
||||||
import net.minecraft.state.property.Properties;
|
import net.minecraft.state.property.Properties;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -109,7 +110,7 @@ public class BlockLamp extends BaseBlockEntityProvider {
|
||||||
|
|
||||||
// Block
|
// Block
|
||||||
@Override
|
@Override
|
||||||
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
|
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||||
ACTIVE = BooleanProperty.of("active");
|
ACTIVE = BooleanProperty.of("active");
|
||||||
builder.add(FACING, ACTIVE);
|
builder.add(FACING, ACTIVE);
|
||||||
}
|
}
|
||||||
|
@ -137,21 +138,21 @@ public class BlockLamp extends BaseBlockEntityProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
public ActionResult onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||||
|
|
||||||
// We extended BaseTileBlock. Thus we should always have blockEntity entity. I hope.
|
// We extended BaseTileBlock. Thus we should always have blockEntity entity. I hope.
|
||||||
if (blockEntity == null) {
|
if (blockEntity == null) {
|
||||||
return false;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
||||||
if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) {
|
if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) {
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.activate(state, worldIn, pos, playerIn, hand, hitResult);
|
return super.onUse(state, worldIn, pos, playerIn, hand, hitResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.BlockRotation;
|
import net.minecraft.util.BlockRotation;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
|
@ -48,7 +49,7 @@ public class BlockComputerCube extends BlockMachineBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
public ActionResult onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||||
|
|
||||||
ItemStack tool = playerIn.getStackInHand(Hand.MAIN_HAND);
|
ItemStack tool = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||||
if (!tool.isEmpty() && ToolManager.INSTANCE.canHandleTool(tool)) {
|
if (!tool.isEmpty() && ToolManager.INSTANCE.canHandleTool(tool)) {
|
||||||
|
@ -56,19 +57,19 @@ public class BlockComputerCube extends BlockMachineBase {
|
||||||
if (playerIn.isSneaking()) {
|
if (playerIn.isSneaking()) {
|
||||||
ItemStack drop = new ItemStack(TRContent.COMPUTER_CUBE, 1);
|
ItemStack drop = new ItemStack(TRContent.COMPUTER_CUBE, 1);
|
||||||
dropStack(worldIn, pos, drop);
|
dropStack(worldIn, pos, drop);
|
||||||
worldIn.playSound(null, playerIn.x, playerIn.y, playerIn.z, ModSounds.BLOCK_DISMANTLE,
|
worldIn.playSound(null, playerIn.getX(), playerIn.getY(), playerIn.getZ(), ModSounds.BLOCK_DISMANTLE,
|
||||||
SoundCategory.BLOCKS, 0.6F, 1F);
|
SoundCategory.BLOCKS, 0.6F, 1F);
|
||||||
if (!worldIn.isClient) {
|
if (!worldIn.isClient) {
|
||||||
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
|
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
|
||||||
}
|
}
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rotate(worldIn.getBlockState(pos), BlockRotation.CLOCKWISE_90);
|
rotate(worldIn.getBlockState(pos), BlockRotation.CLOCKWISE_90);
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return ActionResult.PASS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.entity.projectile.ProjectileEntity;
|
import net.minecraft.entity.projectile.ProjectileEntity;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.sound.SoundEvents;
|
import net.minecraft.sound.SoundEvents;
|
||||||
import net.minecraft.state.StateFactory;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.state.property.BooleanProperty;
|
import net.minecraft.state.property.BooleanProperty;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -59,7 +59,7 @@ public class BlockNuke extends BaseBlock {
|
||||||
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F),
|
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F),
|
||||||
(double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), igniter);
|
(double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), igniter);
|
||||||
worldIn.spawnEntity(entitynukeprimed);
|
worldIn.spawnEntity(entitynukeprimed);
|
||||||
worldIn.playSound((PlayerEntity) null, entitynukeprimed.x, entitynukeprimed.y, entitynukeprimed.z,
|
worldIn.playSound((PlayerEntity) null, entitynukeprimed.getX(), entitynukeprimed.getY(), entitynukeprimed.getZ(),
|
||||||
SoundEvents.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
SoundEvents.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ public class BlockNuke extends BaseBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
|
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||||
builder.add(OVERLAY);
|
builder.add(OVERLAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,12 +32,13 @@ import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
import net.minecraft.server.world.ServerWorld;
|
import net.minecraft.server.world.ServerWorld;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.state.StateFactory;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.state.property.BooleanProperty;
|
import net.minecraft.state.property.BooleanProperty;
|
||||||
import net.minecraft.state.property.DirectionProperty;
|
import net.minecraft.state.property.DirectionProperty;
|
||||||
import net.minecraft.state.property.Properties;
|
import net.minecraft.state.property.Properties;
|
||||||
import net.minecraft.tag.BlockTags;
|
import net.minecraft.tag.BlockTags;
|
||||||
import net.minecraft.tag.Tag;
|
import net.minecraft.tag.Tag;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -67,7 +68,7 @@ public class BlockRubberLog extends LogBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
|
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||||
super.appendProperties(builder);
|
super.appendProperties(builder);
|
||||||
builder.add(SAP_SIDE, HAS_SAP);
|
builder.add(SAP_SIDE, HAS_SAP);
|
||||||
}
|
}
|
||||||
|
@ -86,7 +87,7 @@ public class BlockRubberLog extends LogBlock {
|
||||||
BlockState state1 = worldIn.getBlockState(blockpos);
|
BlockState state1 = worldIn.getBlockState(blockpos);
|
||||||
if (state1.matches(BlockTags.LEAVES)) {
|
if (state1.matches(BlockTags.LEAVES)) {
|
||||||
state1.scheduledTick((ServerWorld) worldIn, blockpos, worldIn.getRandom());
|
state1.scheduledTick((ServerWorld) worldIn, blockpos, worldIn.getRandom());
|
||||||
state1.onRandomTick((ServerWorld) worldIn, blockpos, worldIn.getRandom());
|
state1.randomTick((ServerWorld) worldIn, blockpos, worldIn.getRandom());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,8 +95,8 @@ public class BlockRubberLog extends LogBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onScheduledTick(BlockState state, ServerWorld worldIn, BlockPos pos, Random random) {
|
public void scheduledTick(BlockState state, ServerWorld worldIn, BlockPos pos, Random random) {
|
||||||
super.onScheduledTick(state, worldIn, pos, random);
|
super.scheduledTick(state, worldIn, pos, random);
|
||||||
if (state.get(AXIS) != Direction.Axis.Y) {
|
if (state.get(AXIS) != Direction.Axis.Y) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -104,7 +105,7 @@ public class BlockRubberLog extends LogBlock {
|
||||||
}
|
}
|
||||||
if (random.nextInt(50) == 0) {
|
if (random.nextInt(50) == 0) {
|
||||||
Direction facing = Direction.fromHorizontal(random.nextInt(4));
|
Direction facing = Direction.fromHorizontal(random.nextInt(4));
|
||||||
if (worldIn.getBlockState(pos.down()).getBlock() == this
|
if (worldIn.getBlockState(pos.method_10079(Direction.DOWN, 1)).getBlock() == this
|
||||||
&& worldIn.getBlockState(pos.up()).getBlock() == this) {
|
&& worldIn.getBlockState(pos.up()).getBlock() == this) {
|
||||||
worldIn.setBlockState(pos, state.with(HAS_SAP, true).with(SAP_SIDE, facing));
|
worldIn.setBlockState(pos, state.with(HAS_SAP, true).with(SAP_SIDE, facing));
|
||||||
}
|
}
|
||||||
|
@ -112,12 +113,11 @@ public class BlockRubberLog extends LogBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn,
|
public ActionResult onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn,
|
||||||
Hand hand, BlockHitResult hitResult) {
|
Hand hand, BlockHitResult hitResult) {
|
||||||
super.activate(state, worldIn, pos, playerIn, hand, hitResult);
|
|
||||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||||
if (stack.isEmpty()) {
|
if (stack.isEmpty()) {
|
||||||
return false;
|
return ActionResult.PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Energy.valid(stack) && Energy.of(stack).getEnergy() > 20) || stack.getItem() instanceof ItemTreeTap) {
|
if ((Energy.valid(stack) && Energy.of(stack).getEnergy() > 20) || stack.getItem() instanceof ItemTreeTap) {
|
||||||
|
@ -139,9 +139,9 @@ public class BlockRubberLog extends LogBlock {
|
||||||
TRRecipeHandler.unlockTRRecipes((ServerPlayerEntity) playerIn);
|
TRRecipeHandler.unlockTRRecipes((ServerPlayerEntity) playerIn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return ActionResult.PASS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,9 +32,10 @@ import net.minecraft.block.entity.BlockEntity;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.state.StateFactory;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.state.property.DirectionProperty;
|
import net.minecraft.state.property.DirectionProperty;
|
||||||
import net.minecraft.state.property.Properties;
|
import net.minecraft.state.property.Properties;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -96,32 +97,32 @@ public abstract class BlockEnergyStorage extends BaseBlockEntityProvider {
|
||||||
|
|
||||||
// Block
|
// Block
|
||||||
@Override
|
@Override
|
||||||
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
|
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||||
builder.add(FACING);
|
builder.add(FACING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
public ActionResult onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||||
|
|
||||||
// We extended BlockTileBase. Thus we should always have blockEntity entity. I hope.
|
// We extended BlockTileBase. Thus we should always have blockEntity entity. I hope.
|
||||||
if (blockEntity == null) {
|
if (blockEntity == null) {
|
||||||
return false;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
||||||
if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) {
|
if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) {
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!playerIn.isSneaking() && gui != null) {
|
if (!playerIn.isSneaking() && gui != null) {
|
||||||
gui.open(playerIn, pos, worldIn);
|
gui.open(playerIn, pos, worldIn);
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.activate(state, worldIn, pos, playerIn, hand, hitResult);
|
return super.onUse(state, worldIn, pos, playerIn, hand, hitResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -31,6 +31,7 @@ import net.minecraft.block.entity.BlockEntity;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -85,22 +86,22 @@ public class BlockLSUStorage extends BaseBlockEntityProvider {
|
||||||
|
|
||||||
// Block
|
// Block
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
public ActionResult onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||||
|
|
||||||
// We extended BaseTileBlock. Thus we should always have blockEntity entity. I hope.
|
// We extended BaseTileBlock. Thus we should always have blockEntity entity. I hope.
|
||||||
if (blockEntity == null) {
|
if (blockEntity == null) {
|
||||||
return false;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
||||||
if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) {
|
if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) {
|
||||||
return true;
|
return ActionResult.PASS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.activate(state, worldIn, pos, playerIn, hand, hitResult);
|
return super.onUse(state, worldIn, pos, playerIn, hand, hitResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
package techreborn.blocks.tier1;
|
package techreborn.blocks.tier1;
|
||||||
|
|
||||||
import net.minecraft.text.LiteralText;
|
import net.minecraft.text.LiteralText;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Formatting;
|
import net.minecraft.util.Formatting;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
@ -35,7 +36,7 @@ import reborncore.common.util.StringUtils;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.state.StateFactory;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.state.property.EnumProperty;
|
import net.minecraft.state.property.EnumProperty;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.StringIdentifiable;
|
import net.minecraft.util.StringIdentifiable;
|
||||||
|
@ -78,12 +79,12 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
public ActionResult onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||||
|
|
||||||
if (blockEntity == null) {
|
if (blockEntity == null) {
|
||||||
return super.activate(state, worldIn, pos, playerIn, hand, hitResult);
|
return super.onUse(state, worldIn, pos, playerIn, hand, hitResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerDetectorType type = state.get(TYPE);
|
PlayerDetectorType type = state.get(TYPE);
|
||||||
|
@ -96,7 +97,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
||||||
if (blockEntity instanceof IToolDrop) {
|
if (blockEntity instanceof IToolDrop) {
|
||||||
ItemStack drop = ((IToolDrop) blockEntity).getToolDrop(playerIn);
|
ItemStack drop = ((IToolDrop) blockEntity).getToolDrop(playerIn);
|
||||||
if (drop == null) {
|
if (drop == null) {
|
||||||
return false;
|
return ActionResult.PASS;
|
||||||
}
|
}
|
||||||
if (!drop.isEmpty()) {
|
if (!drop.isEmpty()) {
|
||||||
dropStack(worldIn, pos, drop);
|
dropStack(worldIn, pos, drop);
|
||||||
|
@ -104,7 +105,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
||||||
if (!worldIn.isClient) {
|
if (!worldIn.isClient) {
|
||||||
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
|
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
|
||||||
}
|
}
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (type == PlayerDetectorType.ALL) {
|
if (type == PlayerDetectorType.ALL) {
|
||||||
|
@ -126,7 +127,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
||||||
Formatting.GRAY + StringUtils.t("techreborn.message.detects") + " " + color
|
Formatting.GRAY + StringUtils.t("techreborn.message.detects") + " " + color
|
||||||
+ StringUtils.toFirstCapital(newType.asString())));
|
+ StringUtils.toFirstCapital(newType.asString())));
|
||||||
}
|
}
|
||||||
return true;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -136,7 +137,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
||||||
|
|
||||||
// Block
|
// Block
|
||||||
@Override
|
@Override
|
||||||
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
|
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||||
TYPE = EnumProperty.of("type", PlayerDetectorType.class);
|
TYPE = EnumProperty.of("type", PlayerDetectorType.class);
|
||||||
builder.add(TYPE);
|
builder.add(TYPE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,9 +32,10 @@ import net.minecraft.block.entity.BlockEntity;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.state.StateFactory;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.state.property.DirectionProperty;
|
import net.minecraft.state.property.DirectionProperty;
|
||||||
import net.minecraft.state.property.Properties;
|
import net.minecraft.state.property.Properties;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -84,26 +85,26 @@ public abstract class BlockTransformer extends BaseBlockEntityProvider {
|
||||||
|
|
||||||
// Block
|
// Block
|
||||||
@Override
|
@Override
|
||||||
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
|
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||||
builder.add(FACING);
|
builder.add(FACING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
public ActionResult onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||||
|
|
||||||
// We extended BlockTileBase. Thus we should always have blockEntity entity. I hope.
|
// We extended BlockTileBase. Thus we should always have blockEntity entity. I hope.
|
||||||
if (blockEntity == null) {
|
if (blockEntity == null) {
|
||||||
return false;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
||||||
if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) {
|
if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) {
|
||||||
return true;
|
return ActionResult.PASS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.activate(state, worldIn, pos, playerIn, hand, hitResult);
|
return super.onUse(state, worldIn, pos, playerIn, hand, hitResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,7 @@ public class GuiIndustrialSawmill extends GuiBase<BuiltContainer> {
|
||||||
this.blockEntity.getPos().getX()
|
this.blockEntity.getPos().getX()
|
||||||
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetY() * 2,
|
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetY() * 2,
|
||||||
this.blockEntity.getPos().getY() - 1, this.blockEntity.getPos().getZ()
|
this.blockEntity.getPos().getY() - 1, this.blockEntity.getPos().getZ()
|
||||||
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetY() * 2).offset(blockEntity.getFacing().getOpposite(), 2);
|
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetY() * 2).method_10079(blockEntity.getFacing().getOpposite(), 2);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
RebornCoreClient.multiblockRenderEvent.setMultiblock(null);
|
RebornCoreClient.multiblockRenderEvent.setMultiblock(null);
|
||||||
|
|
|
@ -30,7 +30,7 @@ import reborncore.common.util.StringUtils;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.text.LiteralText;
|
import net.minecraft.text.LiteralText;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.SystemUtil;
|
import net.minecraft.util.Util;
|
||||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||||
import reborncore.common.network.NetworkManager;
|
import reborncore.common.network.NetworkManager;
|
||||||
import techreborn.config.TechRebornConfig;
|
import techreborn.config.TechRebornConfig;
|
||||||
|
@ -60,7 +60,7 @@ public class GuiManual extends Screen {
|
||||||
y+= 40;
|
y+= 40;
|
||||||
addButton(new GuiButtonExtended((width / 2 - 30), y + 10, 60, 20, StringUtils.t("techreborn.manual.wikibtn"), var1 -> minecraft.openScreen(new ConfirmChatLinkScreen(t -> {
|
addButton(new GuiButtonExtended((width / 2 - 30), y + 10, 60, 20, StringUtils.t("techreborn.manual.wikibtn"), var1 -> minecraft.openScreen(new ConfirmChatLinkScreen(t -> {
|
||||||
if(t){
|
if(t){
|
||||||
SystemUtil.getOperatingSystem().open("http://wiki.techreborn.ovh");
|
Util.getOperatingSystem().open("http://wiki.techreborn.ovh");
|
||||||
this.minecraft.openScreen(this);
|
this.minecraft.openScreen(this);
|
||||||
} else {
|
} else {
|
||||||
this.minecraft.openScreen(this);
|
this.minecraft.openScreen(this);
|
||||||
|
@ -68,7 +68,7 @@ public class GuiManual extends Screen {
|
||||||
}, "http://wiki.techreborn.ovh", false))));
|
}, "http://wiki.techreborn.ovh", false))));
|
||||||
addButton(new GuiButtonExtended((width / 2 - 30), y + 60, 60, 20, StringUtils.t("techreborn.manual.discordbtn"), var1 -> minecraft.openScreen(new ConfirmChatLinkScreen(t -> {
|
addButton(new GuiButtonExtended((width / 2 - 30), y + 60, 60, 20, StringUtils.t("techreborn.manual.discordbtn"), var1 -> minecraft.openScreen(new ConfirmChatLinkScreen(t -> {
|
||||||
if(t){
|
if(t){
|
||||||
SystemUtil.getOperatingSystem().open("https://discord.gg/teamreborn");
|
Util.getOperatingSystem().open("https://discord.gg/teamreborn");
|
||||||
this.minecraft.openScreen(this);
|
this.minecraft.openScreen(this);
|
||||||
}else {
|
}else {
|
||||||
this.minecraft.openScreen(this);
|
this.minecraft.openScreen(this);
|
||||||
|
@ -85,7 +85,7 @@ public class GuiManual extends Screen {
|
||||||
@Override
|
@Override
|
||||||
public void render(int mouseX, int mouseY, float partialTicks) {
|
public void render(int mouseX, int mouseY, float partialTicks) {
|
||||||
renderBackground();
|
renderBackground();
|
||||||
minecraft.getTextureManager().method_22813(GuiManual.texture);
|
minecraft.getTextureManager().bindTexture(GuiManual.texture);
|
||||||
int centerX = (width / 2) - guiWidth / 2;
|
int centerX = (width / 2) - guiWidth / 2;
|
||||||
int centerY = (height / 2) - guiHeight / 2;
|
int centerY = (height / 2) - guiHeight / 2;
|
||||||
blit(centerX, centerY, 0, 0, guiWidth, guiHeight);
|
blit(centerX, centerY, 0, 0, guiWidth, guiHeight);
|
||||||
|
|
|
@ -27,6 +27,7 @@ package techreborn.client.gui;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
import reborncore.RebornCoreClient;
|
import reborncore.RebornCoreClient;
|
||||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||||
import reborncore.client.gui.builder.GuiBase;
|
import reborncore.client.gui.builder.GuiBase;
|
||||||
|
@ -129,7 +130,7 @@ public class GuiVacuumFreezer extends GuiBase<BuiltContainer> {
|
||||||
final MultiblockSet set = new MultiblockSet(multiblock);
|
final MultiblockSet set = new MultiblockSet(multiblock);
|
||||||
RebornCoreClient.multiblockRenderEvent.setMultiblock(set);
|
RebornCoreClient.multiblockRenderEvent.setMultiblock(set);
|
||||||
RebornCoreClient.multiblockRenderEvent.parent = blockEntity.getPos();
|
RebornCoreClient.multiblockRenderEvent.parent = blockEntity.getPos();
|
||||||
MultiblockRenderEvent.anchor = blockEntity.getPos().down();
|
MultiblockRenderEvent.anchor = blockEntity.getPos().method_10079(Direction.DOWN, 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
RebornCoreClient.multiblockRenderEvent.setMultiblock(null);
|
RebornCoreClient.multiblockRenderEvent.setMultiblock(null);
|
||||||
|
|
|
@ -6,7 +6,7 @@ import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView;
|
||||||
import net.fabricmc.fabric.api.renderer.v1.mesh.QuadEmitter;
|
import net.fabricmc.fabric.api.renderer.v1.mesh.QuadEmitter;
|
||||||
import net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel;
|
import net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel;
|
||||||
import net.fabricmc.fabric.api.renderer.v1.render.RenderContext;
|
import net.fabricmc.fabric.api.renderer.v1.render.RenderContext;
|
||||||
import net.fabricmc.indigo.renderer.helper.GeometryHelper;
|
import net.fabricmc.fabric.impl.client.indigo.renderer.helper.GeometryHelper;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.render.model.BakedModel;
|
import net.minecraft.client.render.model.BakedModel;
|
||||||
|
|
|
@ -24,15 +24,15 @@
|
||||||
|
|
||||||
package techreborn.client.render.entitys;
|
package techreborn.client.render.entitys;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import net.minecraft.client.render.VertexConsumerProvider;
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.render.block.BlockRenderManager;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
||||||
import net.minecraft.client.render.entity.EntityRenderer;
|
import net.minecraft.client.render.entity.EntityRenderer;
|
||||||
|
import net.minecraft.client.render.entity.TntMinecartEntityRenderer;
|
||||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||||
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
|
import net.minecraft.client.util.math.Vector3f;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import techreborn.blocks.misc.BlockNuke;
|
|
||||||
import techreborn.entities.EntityNukePrimed;
|
import techreborn.entities.EntityNukePrimed;
|
||||||
import techreborn.init.TRContent;
|
import techreborn.init.TRContent;
|
||||||
|
|
||||||
|
@ -50,45 +50,27 @@ public class RenderNukePrimed extends EntityRenderer<EntityNukePrimed> {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
protected Identifier getTexture(EntityNukePrimed entityNukePrimed) {
|
public Identifier getTexture(EntityNukePrimed entityNukePrimed) {
|
||||||
return SpriteAtlasTexture.BLOCK_ATLAS_TEX;
|
return SpriteAtlasTexture.BLOCK_ATLAS_TEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(EntityNukePrimed entity, double x, double y, double z, float entityYaw, float partialTicks) {
|
public void render(EntityNukePrimed entity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
|
||||||
BlockRenderManager blockrendererdispatcher = MinecraftClient.getInstance().getBlockRenderManager();
|
matrixStack.push();
|
||||||
RenderSystem.pushMatrix();
|
matrixStack.translate(0.0D, 0.5D, 0.0D);
|
||||||
RenderSystem.translatef((float) x, (float) y + 0.5F, (float) z);
|
if ((float)entity.getFuseTimer() - g + 1.0F < 10.0F) {
|
||||||
if ((float) entity.getFuseTimer() - partialTicks + 1.0F < 10.0F) {
|
float h = 1.0F - ((float)entity.getFuseTimer() - g + 1.0F) / 10.0F;
|
||||||
float f = 1.0F - ((float) entity.getFuseTimer() - partialTicks + 1.0F) / 10.0F;
|
h = MathHelper.clamp(h, 0.0F, 1.0F);
|
||||||
f = MathHelper.clamp(f, 0.0F, 1.0F);
|
h *= h;
|
||||||
f = f * f;
|
h *= h;
|
||||||
f = f * f;
|
float j = 1.0F + h * 0.3F;
|
||||||
float f1 = 1.0F + f * 0.3F;
|
matrixStack.scale(j, j, j);
|
||||||
RenderSystem.scalef(f1, f1, f1);
|
|
||||||
}
|
}
|
||||||
this.bindEntityTexture(entity);
|
|
||||||
RenderSystem.translatef(-0.5F, -0.5F, 0.5F);
|
|
||||||
blockrendererdispatcher.renderDynamic(TRContent.NUKE.getDefaultState(),
|
|
||||||
entity.getBrightnessAtEyes());
|
|
||||||
RenderSystem.translatef(0.0F, 0.0F, 1.0F);
|
|
||||||
if (entity.getFuseTimer() / 5 % 2 == 0) {
|
|
||||||
RenderSystem.disableLighting();
|
|
||||||
RenderSystem.enableBlend();
|
|
||||||
RenderSystem.blendFunc(770, 772);
|
|
||||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1F);
|
|
||||||
RenderSystem.polygonOffset(-3.0F, -3.0F);
|
|
||||||
RenderSystem.enablePolygonOffset();
|
|
||||||
blockrendererdispatcher.renderDynamic(
|
|
||||||
TRContent.NUKE.getDefaultState().with(BlockNuke.OVERLAY, true), 1.0F);
|
|
||||||
RenderSystem.polygonOffset(0.0F, 0.0F);
|
|
||||||
RenderSystem.disablePolygonOffset();
|
|
||||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
RenderSystem.disableBlend();
|
|
||||||
RenderSystem.enableLighting();
|
|
||||||
}
|
|
||||||
RenderSystem.popMatrix();
|
|
||||||
super.render(entity, x, y, z, entityYaw, partialTicks);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
matrixStack.multiply(Vector3f.POSITIVE_Y.getRotationQuaternion(-90.0F));
|
||||||
|
matrixStack.translate(-0.5D, -0.5D, 0.5D);
|
||||||
|
TntMinecartEntityRenderer.method_23190(TRContent.NUKE.getDefaultState(), matrixStack, vertexConsumerProvider, i, entity.getFuseTimer() / 5 % 2 == 0);
|
||||||
|
matrixStack.pop();
|
||||||
|
super.render(entity, f, g, matrixStack, vertexConsumerProvider, i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,9 +52,9 @@ public class EntityNukePrimed extends TntEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
this.prevX = this.x;
|
this.prevX = this.getX();
|
||||||
this.prevY = this.y;
|
this.prevY = this.getY();
|
||||||
this.prevZ = this.z;
|
this.prevZ = this.getZ();
|
||||||
|
|
||||||
Vec3d velocity = getVelocity();
|
Vec3d velocity = getVelocity();
|
||||||
double motionX = velocity.x;
|
double motionX = velocity.x;
|
||||||
|
@ -82,7 +82,7 @@ public class EntityNukePrimed extends TntEntity {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.checkWaterState();
|
this.checkWaterState();
|
||||||
this.world.addParticle(ParticleTypes.SMOKE, this.x, this.y + 0.5D, this.z, 0.0D, 0.0D, 0.0D);
|
this.world.addParticle(ParticleTypes.SMOKE, this.getX(), this.getY() + 0.5D, this.getZ(), 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ public class EntityNukePrimed extends TntEntity {
|
||||||
if (!TechRebornConfig.nukeEnabled) {
|
if (!TechRebornConfig.nukeEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RebornExplosion nukeExplosion = new RebornExplosion(new BlockPos(x, y, z), world, TechRebornConfig.nukeRadius);
|
RebornExplosion nukeExplosion = new RebornExplosion(getBlockPos(), world, TechRebornConfig.nukeRadius);
|
||||||
nukeExplosion.setLivingBase(getCausingEntity());
|
nukeExplosion.setLivingBase(getCausingEntity());
|
||||||
nukeExplosion.explode();
|
nukeExplosion.explode();
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class StackToolTipHandler implements ItemTooltipCallback {
|
||||||
if (block != null && (block instanceof BlockWithEntity || block instanceof BlockEntityProvider) && Registry.BLOCK.getId(block).getNamespace().contains("techreborn")) {
|
if (block != null && (block instanceof BlockWithEntity || block instanceof BlockEntityProvider) && Registry.BLOCK.getId(block).getNamespace().contains("techreborn")) {
|
||||||
BlockEntity blockEntity = ((BlockEntityProvider) block).createBlockEntity(MinecraftClient.getInstance().world);
|
BlockEntity blockEntity = ((BlockEntityProvider) block).createBlockEntity(MinecraftClient.getInstance().world);
|
||||||
boolean hasData = false;
|
boolean hasData = false;
|
||||||
if (stack.hasTag() && stack.getTag().containsKey("blockEntity_data")) {
|
if (stack.hasTag() && stack.getTag().contains("blockEntity_data")) {
|
||||||
CompoundTag blockEntityData = stack.getTag().getCompound("blockEntity_data");
|
CompoundTag blockEntityData = stack.getTag().getCompound("blockEntity_data");
|
||||||
blockEntity.fromTag(blockEntityData);
|
blockEntity.fromTag(blockEntityData);
|
||||||
hasData = true;
|
hasData = true;
|
||||||
|
|
|
@ -27,11 +27,11 @@ package techreborn.init;
|
||||||
import net.fabricmc.fabric.api.loot.v1.FabricLootPoolBuilder;
|
import net.fabricmc.fabric.api.loot.v1.FabricLootPoolBuilder;
|
||||||
import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback;
|
import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback;
|
||||||
import net.minecraft.item.ItemConvertible;
|
import net.minecraft.item.ItemConvertible;
|
||||||
import net.minecraft.world.loot.LootPool;
|
import net.minecraft.loot.LootPool;
|
||||||
import net.minecraft.world.loot.UniformLootTableRange;
|
import net.minecraft.loot.UniformLootTableRange;
|
||||||
import net.minecraft.world.loot.entry.ItemEntry;
|
import net.minecraft.loot.entry.ItemEntry;
|
||||||
import net.minecraft.world.loot.entry.LootEntry;
|
import net.minecraft.loot.entry.LootEntry;
|
||||||
import net.minecraft.world.loot.function.SetCountLootFunction;
|
import net.minecraft.loot.function.SetCountLootFunction;
|
||||||
import techreborn.config.TechRebornConfig;
|
import techreborn.config.TechRebornConfig;
|
||||||
import techreborn.init.TRContent.Ingots;
|
import techreborn.init.TRContent.Ingots;
|
||||||
import techreborn.init.TRContent.Parts;
|
import techreborn.init.TRContent.Parts;
|
||||||
|
|
|
@ -116,7 +116,7 @@ public class ItemDynamicCell extends Item implements ItemFluidInfo {
|
||||||
@Override
|
@Override
|
||||||
public Fluid getFluid(ItemStack itemStack) {
|
public Fluid getFluid(ItemStack itemStack) {
|
||||||
CompoundTag tag = itemStack.getTag();
|
CompoundTag tag = itemStack.getTag();
|
||||||
if(tag != null && tag.containsKey("fluid")){
|
if(tag != null && tag.contains("fluid")){
|
||||||
return Registry.FLUID.get(new Identifier(tag.getString("fluid")));
|
return Registry.FLUID.get(new Identifier(tag.getString("fluid")));
|
||||||
}
|
}
|
||||||
return Fluids.EMPTY;
|
return Fluids.EMPTY;
|
||||||
|
|
|
@ -60,8 +60,8 @@ public class ItemFrequencyTransmitter extends Item {
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public float call(ItemStack stack, @Nullable World worldIn, @Nullable LivingEntity entityIn) {
|
public float call(ItemStack stack, @Nullable World worldIn, @Nullable LivingEntity entityIn) {
|
||||||
if (!stack.isEmpty() && stack.hasTag() && stack.getTag() != null && stack.getTag().containsKey("x")
|
if (!stack.isEmpty() && stack.hasTag() && stack.getTag() != null && stack.getTag().contains("x")
|
||||||
&& stack.getTag().containsKey("y") && stack.getTag().containsKey("z") && stack.getTag().containsKey("dim")) {
|
&& stack.getTag().contains("y") && stack.getTag().contains("z") && stack.getTag().contains("dim")) {
|
||||||
return 1.0F;
|
return 1.0F;
|
||||||
}
|
}
|
||||||
return 0.0F;
|
return 0.0F;
|
||||||
|
@ -109,13 +109,13 @@ public class ItemFrequencyTransmitter extends Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TypedActionResult<>(ActionResult.SUCCESS, stack, true);
|
return new TypedActionResult<>(ActionResult.SUCCESS, stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void appendTooltip(ItemStack stack, @Nullable World worldIn, List<Text> tooltip, TooltipContext flagIn) {
|
public void appendTooltip(ItemStack stack, @Nullable World worldIn, List<Text> tooltip, TooltipContext flagIn) {
|
||||||
if (stack.hasTag() && stack.getTag() != null && stack.getTag().containsKey("x") && stack.getTag().containsKey("y") && stack.getTag().containsKey("z") && stack.getTag().containsKey("dim")) {
|
if (stack.hasTag() && stack.getTag() != null && stack.getTag().contains("x") && stack.getTag().contains("y") && stack.getTag().contains("z") && stack.getTag().contains("dim")) {
|
||||||
int x = stack.getTag().getInt("x");
|
int x = stack.getTag().getInt("x");
|
||||||
int y = stack.getTag().getInt("y");
|
int y = stack.getTag().getInt("y");
|
||||||
int z = stack.getTag().getInt("z");
|
int z = stack.getTag().getInt("z");
|
||||||
|
@ -146,7 +146,7 @@ public class ItemFrequencyTransmitter extends Item {
|
||||||
Formatting gold = Formatting.GOLD;
|
Formatting gold = Formatting.GOLD;
|
||||||
Formatting grey = Formatting.GRAY;
|
Formatting grey = Formatting.GRAY;
|
||||||
if (stack.getItem() instanceof ItemFrequencyTransmitter) {
|
if (stack.getItem() instanceof ItemFrequencyTransmitter) {
|
||||||
if (stack.hasTag() && stack.getTag() != null && stack.getTag().containsKey("x") && stack.getTag().containsKey("y") && stack.getTag().containsKey("z") && stack.getTag().containsKey("dim")) {
|
if (stack.hasTag() && stack.getTag() != null && stack.getTag().contains("x") && stack.getTag().contains("y") && stack.getTag().contains("z") && stack.getTag().contains("dim")) {
|
||||||
int coordX = stack.getTag().getInt("x");
|
int coordX = stack.getTag().getInt("x");
|
||||||
int coordY = stack.getTag().getInt("y");
|
int coordY = stack.getTag().getInt("y");
|
||||||
int coordZ = stack.getTag().getInt("z");
|
int coordZ = stack.getTag().getInt("z");
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class ItemManual extends Item {
|
||||||
if(world.isClient){
|
if(world.isClient){
|
||||||
openGui(player);
|
openGui(player);
|
||||||
}
|
}
|
||||||
return new TypedActionResult<>(ActionResult.SUCCESS, player.getStackInHand(hand), true);
|
return new TypedActionResult<>(ActionResult.SUCCESS, player.getStackInHand(hand));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
|
|
|
@ -54,6 +54,6 @@ public class ItemScrapBox extends Item {
|
||||||
WorldUtils.dropItem(out, world, player.getBlockPos());
|
WorldUtils.dropItem(out, world, player.getBlockPos());
|
||||||
stack.decrement(1);
|
stack.decrement(1);
|
||||||
}
|
}
|
||||||
return new TypedActionResult<>(ActionResult.SUCCESS, stack, true);
|
return new TypedActionResult<>(ActionResult.SUCCESS, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.text.LiteralText;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Formatting;
|
import net.minecraft.util.Formatting;
|
||||||
import net.minecraft.util.SystemUtil;
|
import net.minecraft.util.Util;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
import reborncore.common.powerSystem.PowerSystem;
|
import reborncore.common.powerSystem.PowerSystem;
|
||||||
import team.reborn.energy.Energy;
|
import team.reborn.energy.Energy;
|
||||||
|
@ -81,7 +81,7 @@ public class ItemDebugTool extends Item {
|
||||||
private String getPropertyString(Entry<Property<?>, Comparable<?>> entryIn) {
|
private String getPropertyString(Entry<Property<?>, Comparable<?>> entryIn) {
|
||||||
Property<?> iproperty = entryIn.getKey();
|
Property<?> iproperty = entryIn.getKey();
|
||||||
Comparable<?> comparable = entryIn.getValue();
|
Comparable<?> comparable = entryIn.getValue();
|
||||||
String s = SystemUtil.getValueAsString(iproperty, comparable);
|
String s = Util.getValueAsString(iproperty, comparable);
|
||||||
if (Boolean.TRUE.equals(comparable)) {
|
if (Boolean.TRUE.equals(comparable)) {
|
||||||
s = Formatting.GREEN + s;
|
s = Formatting.GREEN + s;
|
||||||
} else if (Boolean.FALSE.equals(comparable)) {
|
} else if (Boolean.FALSE.equals(comparable)) {
|
||||||
|
|
|
@ -26,6 +26,7 @@ package techreborn.items.tool;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.block.Material;
|
||||||
import net.minecraft.enchantment.EnchantmentHelper;
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
import net.minecraft.enchantment.Enchantments;
|
import net.minecraft.enchantment.Enchantments;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
@ -61,7 +62,7 @@ public class ItemJackhammer extends PickaxeItem implements EnergyHolder, ItemDur
|
||||||
// ItemPickaxe
|
// ItemPickaxe
|
||||||
@Override
|
@Override
|
||||||
public float getMiningSpeed(ItemStack stack, BlockState state) {
|
public float getMiningSpeed(ItemStack stack, BlockState state) {
|
||||||
if (Block.isNaturalStone(state.getBlock()) && Energy.of(stack).getEnergy() >= cost) {
|
if (state.getMaterial() == Material.STONE && Energy.of(stack).getEnergy() >= cost) {
|
||||||
return miningSpeed;
|
return miningSpeed;
|
||||||
} else {
|
} else {
|
||||||
return 0.5F;
|
return 0.5F;
|
||||||
|
|
|
@ -141,9 +141,9 @@ public class ItemIndustrialChainsaw extends ItemChainsaw {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new TypedActionResult<>(ActionResult.SUCCESS, stack, true);
|
return new TypedActionResult<>(ActionResult.SUCCESS, stack);
|
||||||
}
|
}
|
||||||
return new TypedActionResult<>(ActionResult.PASS, stack, true);
|
return new TypedActionResult<>(ActionResult.PASS, stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -197,9 +197,9 @@ public class ItemIndustrialDrill extends ItemDrill {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new TypedActionResult<>(ActionResult.SUCCESS, stack, true);
|
return new TypedActionResult<>(ActionResult.SUCCESS, stack);
|
||||||
}
|
}
|
||||||
return new TypedActionResult<>(ActionResult.PASS, stack, true);
|
return new TypedActionResult<>(ActionResult.PASS, stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -134,9 +134,9 @@ public class ItemNanosaber extends SwordItem implements EnergyHolder, ItemDurabi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new TypedActionResult<>(ActionResult.SUCCESS, stack, true);
|
return new TypedActionResult<>(ActionResult.SUCCESS, stack);
|
||||||
}
|
}
|
||||||
return new TypedActionResult<>(ActionResult.PASS, stack, true);
|
return new TypedActionResult<>(ActionResult.PASS, stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class StackWIPHandler {
|
||||||
private static void addHead(String name) {
|
private static void addHead(String name) {
|
||||||
ItemStack head = new ItemStack(Items.PLAYER_HEAD, 3);
|
ItemStack head = new ItemStack(Items.PLAYER_HEAD, 3);
|
||||||
head.setTag(new CompoundTag());
|
head.setTag(new CompoundTag());
|
||||||
head.getTag().put("SkullOwner", new StringTag(name));
|
head.getTag().put("SkullOwner", StringTag.of(name));
|
||||||
devHeads.add(head);
|
devHeads.add(head);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,15 +25,18 @@
|
||||||
package techreborn.world;
|
package techreborn.world;
|
||||||
|
|
||||||
import net.minecraft.block.sapling.SaplingGenerator;
|
import net.minecraft.block.sapling.SaplingGenerator;
|
||||||
import net.minecraft.world.gen.feature.AbstractTreeFeature;
|
import net.minecraft.world.gen.feature.BranchedTreeFeatureConfig;
|
||||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class RubberSaplingGenerator extends SaplingGenerator {
|
public class RubberSaplingGenerator extends SaplingGenerator {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
protected AbstractTreeFeature<DefaultFeatureConfig> createTreeFeature(Random random) {
|
@Override
|
||||||
return new RubberTreeFeature(DefaultFeatureConfig::deserialize, true);
|
protected ConfiguredFeature<BranchedTreeFeatureConfig, ?> createTreeFeature(Random random) {
|
||||||
|
return null; //new RubberTreeFeature(DefaultFeatureConfig::deserialize, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,145 +1,157 @@
|
||||||
/*
|
///*
|
||||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
// * This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||||
*
|
// *
|
||||||
* Copyright (c) 2018 TechReborn
|
// * Copyright (c) 2018 TechReborn
|
||||||
*
|
// *
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
// * Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
// * of this software and associated documentation files (the "Software"), to deal
|
||||||
* in the Software without restriction, including without limitation the rights
|
// * in the Software without restriction, including without limitation the rights
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
// * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
// * copies of the Software, and to permit persons to whom the Software is
|
||||||
* furnished to do so, subject to the following conditions:
|
// * furnished to do so, subject to the following conditions:
|
||||||
*
|
// *
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
// * The above copyright notice and this permission notice shall be included in all
|
||||||
* copies or substantial portions of the Software.
|
// * copies or substantial portions of the Software.
|
||||||
*
|
// *
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
// * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
// * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
// * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
* SOFTWARE.
|
// * SOFTWARE.
|
||||||
*/
|
// */
|
||||||
|
//
|
||||||
package techreborn.world;
|
//package techreborn.world;
|
||||||
|
//
|
||||||
import java.util.Random;
|
//import java.util.Random;
|
||||||
import java.util.Set;
|
//import java.util.Set;
|
||||||
import java.util.function.Function;
|
//import java.util.function.Function;
|
||||||
|
//
|
||||||
import com.mojang.datafixers.Dynamic;
|
//import com.mojang.datafixers.Dynamic;
|
||||||
|
//
|
||||||
import net.minecraft.block.BlockState;
|
//import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.util.math.BlockBox;
|
//import net.minecraft.util.math.BlockBox;
|
||||||
import net.minecraft.util.math.BlockPos;
|
//import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Direction;
|
//import net.minecraft.util.math.Direction;
|
||||||
import net.minecraft.world.ModifiableTestableWorld;
|
//import net.minecraft.world.IWorld;
|
||||||
import net.minecraft.world.gen.feature.AbstractTreeFeature;
|
//import net.minecraft.world.ModifiableTestableWorld;
|
||||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
//import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||||
import techreborn.blocks.misc.BlockRubberLog;
|
//import net.minecraft.world.gen.chunk.ChunkGeneratorConfig;
|
||||||
import techreborn.init.TRContent;
|
//import net.minecraft.world.gen.feature.AbstractTreeFeature;
|
||||||
|
//import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||||
/**
|
//import techreborn.blocks.misc.BlockRubberLog;
|
||||||
* @author drcrazy
|
//import techreborn.init.TRContent;
|
||||||
*
|
//
|
||||||
*/
|
///**
|
||||||
public class RubberTreeFeature extends AbstractTreeFeature<DefaultFeatureConfig> {
|
// * @author drcrazy
|
||||||
|
// *
|
||||||
// TODO: Configs
|
// */
|
||||||
private int treeBaseHeight = 5;
|
//public class RubberTreeFeature extends AbstractTreeFeature<DefaultFeatureConfig> {
|
||||||
private int sapRarity = 10;
|
//
|
||||||
private int spireHeight = 4;
|
// // TODO: Configs
|
||||||
|
// private int treeBaseHeight = 5;
|
||||||
|
// private int sapRarity = 10;
|
||||||
public RubberTreeFeature(Function<Dynamic<?>, ? extends DefaultFeatureConfig> featureConfig, boolean notify) {
|
// private int spireHeight = 4;
|
||||||
super(featureConfig, notify);
|
//
|
||||||
}
|
//
|
||||||
|
// public RubberTreeFeature(Function<Dynamic<?>, ? extends DefaultFeatureConfig> featureConfig, boolean notify) {
|
||||||
@Override
|
// super(featureConfig, notify);
|
||||||
protected boolean generate(Set<BlockPos> changedBlocks, ModifiableTestableWorld worldIn, Random rand,
|
// }
|
||||||
BlockPos saplingPos, BlockBox mutableBoundingBox) {
|
//
|
||||||
int treeHeight = rand.nextInt(5) + treeBaseHeight;
|
// @Override
|
||||||
int baseY = saplingPos.getY();
|
// protected boolean generate(Set<BlockPos> changedBlocks, ModifiableTestableWorld worldIn, Random rand,
|
||||||
int baseX = saplingPos.getX();
|
// BlockPos saplingPos, BlockBox mutableBoundingBox) {
|
||||||
int baseZ = saplingPos.getZ();
|
// int treeHeight = rand.nextInt(5) + treeBaseHeight;
|
||||||
if (baseY <= 1 && baseY + treeHeight + spireHeight + 1 >= 256) {
|
// int baseY = saplingPos.getY();
|
||||||
return false;
|
// int baseX = saplingPos.getX();
|
||||||
}
|
// int baseZ = saplingPos.getZ();
|
||||||
|
// if (baseY <= 1 && baseY + treeHeight + spireHeight + 1 >= 256) {
|
||||||
if (!isDirtOrGrass(worldIn, saplingPos.down())) {
|
// return false;
|
||||||
return false;
|
// }
|
||||||
}
|
//
|
||||||
|
// if (!isDirtOrGrass(worldIn, saplingPos.down())) {
|
||||||
int yOffset;
|
// return false;
|
||||||
int xOffset;
|
// }
|
||||||
int zOffset;
|
//
|
||||||
for (yOffset = baseY; yOffset <= baseY + 1 + treeHeight; ++yOffset) {
|
// int yOffset;
|
||||||
byte radius = 1;
|
// int xOffset;
|
||||||
if (yOffset == baseY) {
|
// int zOffset;
|
||||||
radius = 0;
|
// for (yOffset = baseY; yOffset <= baseY + 1 + treeHeight; ++yOffset) {
|
||||||
}
|
// byte radius = 1;
|
||||||
if (yOffset >= baseY + 1 + treeHeight - 2) {
|
// if (yOffset == baseY) {
|
||||||
radius = 2;
|
// radius = 0;
|
||||||
}
|
// }
|
||||||
|
// if (yOffset >= baseY + 1 + treeHeight - 2) {
|
||||||
BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable();
|
// radius = 2;
|
||||||
for (xOffset = baseX - radius; xOffset <= baseX + radius; ++xOffset) {
|
// }
|
||||||
for (zOffset = baseZ - radius; zOffset <= baseZ + radius; ++zOffset) {
|
//
|
||||||
if (!isAirOrLeaves(worldIn, blockpos$mutable.set(xOffset, yOffset, zOffset))) {
|
// BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable();
|
||||||
return false;
|
// for (xOffset = baseX - radius; xOffset <= baseX + radius; ++xOffset) {
|
||||||
}
|
// for (zOffset = baseZ - radius; zOffset <= baseZ + radius; ++zOffset) {
|
||||||
}
|
// if (!isAirOrLeaves(worldIn, blockpos$mutable.set(xOffset, yOffset, zOffset))) {
|
||||||
}
|
// return false;
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
// Ok, we are cleared for take off!
|
// }
|
||||||
this.setToDirt(worldIn, saplingPos.down());
|
// }
|
||||||
|
//
|
||||||
// Leaves
|
// // Ok, we are cleared for take off!
|
||||||
BlockState leafState = TRContent.RUBBER_LEAVES.getDefaultState();
|
// this.setToDirt(worldIn, saplingPos.down());
|
||||||
for (yOffset = baseY - 3 + treeHeight; yOffset <= baseY + treeHeight; ++yOffset) {
|
//
|
||||||
int var12 = yOffset - (baseY + treeHeight), center = 1 - var12 / 2;
|
// // Leaves
|
||||||
for (xOffset = baseX - center; xOffset <= baseX + center; ++xOffset) {
|
// BlockState leafState = TRContent.RUBBER_LEAVES.getDefaultState();
|
||||||
int xPos = xOffset - baseX, t = xPos >> 15;
|
// for (yOffset = baseY - 3 + treeHeight; yOffset <= baseY + treeHeight; ++yOffset) {
|
||||||
xPos = (xPos + t) ^ t;
|
// int var12 = yOffset - (baseY + treeHeight), center = 1 - var12 / 2;
|
||||||
for (zOffset = baseZ - center; zOffset <= baseZ + center; ++zOffset) {
|
// for (xOffset = baseX - center; xOffset <= baseX + center; ++xOffset) {
|
||||||
int zPos = zOffset - baseZ;
|
// int xPos = xOffset - baseX, t = xPos >> 15;
|
||||||
zPos = (zPos + (t = zPos >> 31)) ^ t;
|
// xPos = (xPos + t) ^ t;
|
||||||
if ((xPos != center | zPos != center) || rand.nextInt(2) != 0 && var12 != 0) {
|
// for (zOffset = baseZ - center; zOffset <= baseZ + center; ++zOffset) {
|
||||||
BlockPos leafPos = new BlockPos(xOffset, yOffset, zOffset);
|
// int zPos = zOffset - baseZ;
|
||||||
if (isAirOrLeaves(worldIn, leafPos) || isReplaceablePlant(worldIn, leafPos)) {
|
// zPos = (zPos + (t = zPos >> 31)) ^ t;
|
||||||
this.setBlockState(changedBlocks, worldIn, leafPos, leafState, mutableBoundingBox);
|
// if ((xPos != center | zPos != center) || rand.nextInt(2) != 0 && var12 != 0) {
|
||||||
}
|
// BlockPos leafPos = new BlockPos(xOffset, yOffset, zOffset);
|
||||||
}
|
// if (isAirOrLeaves(worldIn, leafPos) || isReplaceablePlant(worldIn, leafPos)) {
|
||||||
}
|
// this.setBlockState(changedBlocks, worldIn, leafPos, leafState, mutableBoundingBox);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
// Trunk
|
// }
|
||||||
BlockPos currentLogPos = null;
|
// }
|
||||||
BlockState logState = TRContent.RUBBER_LOG.getDefaultState();
|
//
|
||||||
for (yOffset = 0; yOffset < treeHeight; ++yOffset) {
|
// // Trunk
|
||||||
currentLogPos = saplingPos.up(yOffset);
|
// BlockPos currentLogPos = null;
|
||||||
if (!isAirOrLeaves(worldIn, currentLogPos)) {
|
// BlockState logState = TRContent.RUBBER_LOG.getDefaultState();
|
||||||
continue;
|
// for (yOffset = 0; yOffset < treeHeight; ++yOffset) {
|
||||||
}
|
// currentLogPos = saplingPos.up(yOffset);
|
||||||
if (rand.nextInt(sapRarity) == 0) {
|
// if (!isAirOrLeaves(worldIn, currentLogPos)) {
|
||||||
logState = logState.with(BlockRubberLog.HAS_SAP, true).with(BlockRubberLog.SAP_SIDE,
|
// continue;
|
||||||
Direction.fromHorizontal(rand.nextInt(4)));
|
// }
|
||||||
}
|
// if (rand.nextInt(sapRarity) == 0) {
|
||||||
this.setBlockState(changedBlocks, worldIn, currentLogPos, logState, mutableBoundingBox);
|
// logState = logState.with(BlockRubberLog.HAS_SAP, true).with(BlockRubberLog.SAP_SIDE,
|
||||||
}
|
// Direction.fromHorizontal(rand.nextInt(4)));
|
||||||
|
// }
|
||||||
// Spire
|
// this.setBlockState(changedBlocks, worldIn, currentLogPos, logState, mutableBoundingBox);
|
||||||
if (currentLogPos != null) {
|
// }
|
||||||
for (int i = 0; i < spireHeight; i++) {
|
//
|
||||||
BlockPos blockpos = currentLogPos.up(i);
|
// // Spire
|
||||||
this.setBlockState(changedBlocks, worldIn, blockpos, leafState, mutableBoundingBox);
|
// if (currentLogPos != null) {
|
||||||
}
|
// for (int i = 0; i < spireHeight; i++) {
|
||||||
}
|
// BlockPos blockpos = currentLogPos.up(i);
|
||||||
|
// this.setBlockState(changedBlocks, worldIn, blockpos, leafState, mutableBoundingBox);
|
||||||
return true;
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// return true;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// protected boolean generate(ModifiableTestableWorld modifiableTestableWorld, Random random, BlockPos blockPos, Set<BlockPos> set, Set<BlockPos> set2, BlockBox blockBox, DefaultFeatureConfig treeFeatureConfig) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public boolean generate(IWorld world, ChunkGenerator<? extends ChunkGeneratorConfig> generator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
|
@ -95,23 +95,23 @@ public class WorldGenerator {
|
||||||
addOre(biome, OreFeatureConfig.Target.NATURAL_STONE, TRContent.Ores.TIN);
|
addOre(biome, OreFeatureConfig.Target.NATURAL_STONE, TRContent.Ores.TIN);
|
||||||
|
|
||||||
if (biome.getCategory() == Category.FOREST || biome.getCategory() == Category.TAIGA) {
|
if (biome.getCategory() == Category.FOREST || biome.getCategory() == Category.TAIGA) {
|
||||||
biome.addFeature(GenerationStep.Feature.VEGETAL_DECORATION,
|
// biome.addFeature(GenerationStep.Feature.VEGETAL_DECORATION,
|
||||||
Biome.configureFeature(new RubberTreeFeature(DefaultFeatureConfig::deserialize, false),
|
// Biome.configureFeature(new RubberTreeFeature(DefaultFeatureConfig::deserialize, false),
|
||||||
FeatureConfig.DEFAULT, Decorator.COUNT_EXTRA_HEIGHTMAP,
|
// FeatureConfig.DEFAULT, Decorator.COUNT_EXTRA_HEIGHTMAP,
|
||||||
new CountExtraChanceDecoratorConfig(1, 0.1F, 1)));
|
// new CountExtraChanceDecoratorConfig(1, 0.1F, 1)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addOre(Biome biome, Target canReplaceIn, TRContent.Ores ore) {
|
private static void addOre(Biome biome, Target canReplaceIn, TRContent.Ores ore) {
|
||||||
biome.addFeature(GenerationStep.Feature.UNDERGROUND_ORES, Biome.configureFeature(Feature.ORE,
|
biome.addFeature(GenerationStep.Feature.UNDERGROUND_ORES, Feature.ORE.configure(
|
||||||
new OreFeatureConfig(canReplaceIn, ore.block.getDefaultState(), ore.veinSize), Decorator.COUNT_RANGE,
|
new OreFeatureConfig(canReplaceIn, ore.block.getDefaultState(), ore.veinSize)).createDecoratedFeature(Decorator.COUNT_RANGE.configure(
|
||||||
new RangeDecoratorConfig(ore.veinsPerChunk, ore.minY, ore.minY, ore.maxY)));
|
new RangeDecoratorConfig(ore.veinsPerChunk, ore.minY, ore.minY, ore.maxY))));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addEndOre(Biome biome, TRContent.Ores ore) {
|
private static void addEndOre(Biome biome, TRContent.Ores ore) {
|
||||||
biome.addFeature(GenerationStep.Feature.UNDERGROUND_ORES, Biome.configureFeature(CustomOreFeature.CUSTOM_ORE_FEATURE,
|
biome.addFeature(GenerationStep.Feature.UNDERGROUND_ORES, CustomOreFeature.CUSTOM_ORE_FEATURE.configure(
|
||||||
new CustomOreFeatureConfig(blockState -> blockState.getBlock() == Blocks.END_STONE, ore.block.getDefaultState(), ore.veinSize), Decorator.COUNT_RANGE,
|
new CustomOreFeatureConfig(blockState -> blockState.getBlock() == Blocks.END_STONE, ore.block.getDefaultState(), ore.veinSize)).createDecoratedFeature(Decorator.COUNT_RANGE.configure(
|
||||||
new RangeDecoratorConfig(ore.veinsPerChunk, ore.minY, ore.minY, ore.maxY)));
|
new RangeDecoratorConfig(ore.veinsPerChunk, ore.minY, ore.minY, ore.maxY))));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue