mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-25 08:28:34 +01:00
Compare commits
2 commits
ec2606f470
...
b0c1e8e8cc
Author | SHA1 | Date | |
---|---|---|---|
|
b0c1e8e8cc | ||
|
fdda08b593 |
19 changed files with 54 additions and 52 deletions
|
@ -7,7 +7,7 @@ mod_version=1.1.52
|
||||||
|
|
||||||
# Forge
|
# Forge
|
||||||
game_version=1.16.5
|
game_version=1.16.5
|
||||||
forge_version=36.2.22
|
forge_version=36.2.30
|
||||||
|
|
||||||
# Parchment (Mappings)
|
# Parchment (Mappings)
|
||||||
parchment_version=2021.10.17
|
parchment_version=2021.10.17
|
||||||
|
|
|
@ -141,10 +141,10 @@ public class ActuallyAdditions {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onConfigReload(ModConfig.ModConfigEvent event) {
|
private void onConfigReload(ModConfig.ModConfigEvent event) {
|
||||||
Item item1 = ForgeRegistries.ITEMS.getValue(new ResourceLocation(CommonConfig.OTHER.REDSTONECONFIGURATOR.get()));
|
Item item1 = ForgeRegistries.ITEMS.getValue(new ResourceLocation(CommonConfig.Other.REDSTONECONFIGURATOR.get()));
|
||||||
Item item2 = ForgeRegistries.ITEMS.getValue(new ResourceLocation(CommonConfig.OTHER.RELAYCONFIGURATOR.get()));
|
Item item2 = ForgeRegistries.ITEMS.getValue(new ResourceLocation(CommonConfig.Other.RELAYCONFIGURATOR.get()));
|
||||||
CommonConfig.OTHER.redstoneConfigureItem = item1 != null?item1: Items.AIR;
|
CommonConfig.Other.redstoneConfigureItem = item1 != null?item1: Items.AIR;
|
||||||
CommonConfig.OTHER.relayConfigureItem = item2 != null?item2: Items.AIR;
|
CommonConfig.Other.relayConfigureItem = item2 != null?item2: Items.AIR;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clientSetup(FMLClientSetupEvent event) {
|
private void clientSetup(FMLClientSetupEvent event) {
|
||||||
|
|
|
@ -15,7 +15,6 @@ import de.ellpeck.actuallyadditions.api.lens.ILensItem;
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.base.FullyDirectionalBlock;
|
import de.ellpeck.actuallyadditions.mod.blocks.base.FullyDirectionalBlock;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.Lang;
|
import de.ellpeck.actuallyadditions.mod.util.Lang;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||||
|
@ -73,7 +72,7 @@ public class BlockAtomicReconstructor extends FullyDirectionalBlock.Container im
|
||||||
player.inventory.removeItem(player.inventory.selected, 1);
|
player.inventory.removeItem(player.inventory.selected, 1);
|
||||||
}
|
}
|
||||||
//Shush, don't tell anyone!
|
//Shush, don't tell anyone!
|
||||||
else if (CommonConfig.OTHER.ELEVEN.get() == 11 && item == Items.MUSIC_DISC_11) {
|
else if (CommonConfig.Other.ELEVEN.get() == 11 && item == Items.MUSIC_DISC_11) {
|
||||||
reconstructor.counter++;
|
reconstructor.counter++;
|
||||||
reconstructor.setChanged();
|
reconstructor.setChanged();
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,7 +188,7 @@ public class BlockLaserRelay extends FullyDirectionalBlock.Container implements
|
||||||
if (compass) {
|
if (compass) {
|
||||||
expl = relay.getCompassDisplayString();
|
expl = relay.getCompassDisplayString();
|
||||||
} else {
|
} else {
|
||||||
expl = TextFormatting.GRAY.toString() + TextFormatting.ITALIC + StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".laserRelay.mode.noCompasss", StringUtil.localize(CommonConfig.OTHER.relayConfigureItem.getDescriptionId() + ".name"));
|
expl = TextFormatting.GRAY.toString() + TextFormatting.ITALIC + StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".laserRelay.mode.noCompasss", StringUtil.localize(CommonConfig.Other.relayConfigureItem.getDescriptionId() + ".name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
StringUtil.drawSplitString(minecraft.font, expl, resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 15, Integer.MAX_VALUE, StringUtil.DECIMAL_COLOR_WHITE, true);
|
StringUtil.drawSplitString(minecraft.font, expl, resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 15, Integer.MAX_VALUE, StringUtil.DECIMAL_COLOR_WHITE, true);
|
||||||
|
|
|
@ -2,20 +2,39 @@ package de.ellpeck.actuallyadditions.mod.config;
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.Items;
|
import net.minecraft.item.Items;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraftforge.common.ForgeConfigSpec;
|
import net.minecraftforge.common.ForgeConfigSpec;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CommonConfig {
|
public class CommonConfig {
|
||||||
private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
|
private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
|
||||||
public static ForgeConfigSpec COMMON_CONFIG;
|
public static ForgeConfigSpec COMMON_CONFIG;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
OTHER.build();
|
Other.build();
|
||||||
MACHINES.build();
|
Machines.build();
|
||||||
|
ItemSettings.build();
|
||||||
COMMON_CONFIG = BUILDER.build();
|
COMMON_CONFIG = BUILDER.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MACHINES {
|
public static class ItemSettings {
|
||||||
|
public static ForgeConfigSpec.ConfigValue<List<String>> DRILL_EXTRA_MINING_WHITELIST;
|
||||||
|
|
||||||
|
public static void build() {
|
||||||
|
BUILDER.comment("Item settings").push("itemsSettings");
|
||||||
|
|
||||||
|
DRILL_EXTRA_MINING_WHITELIST = BUILDER
|
||||||
|
.comment("By default, the Drill can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.")
|
||||||
|
.define("Drill Extra Whitelist", new ArrayList<String>() {{
|
||||||
|
add("TConstruct:GravelOre");
|
||||||
|
}});
|
||||||
|
|
||||||
|
BUILDER.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Machines {
|
||||||
public static ForgeConfigSpec.IntValue FARMER_AREA;
|
public static ForgeConfigSpec.IntValue FARMER_AREA;
|
||||||
public static ForgeConfigSpec.IntValue RECONSTRUCTOR_POWER;
|
public static ForgeConfigSpec.IntValue RECONSTRUCTOR_POWER;
|
||||||
|
|
||||||
|
@ -29,8 +48,7 @@ public class CommonConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class Other {
|
||||||
public static class OTHER {
|
|
||||||
public static ForgeConfigSpec.BooleanValue SOLID_XP_ALWAYS_ORBS;
|
public static ForgeConfigSpec.BooleanValue SOLID_XP_ALWAYS_ORBS;
|
||||||
public static ForgeConfigSpec.BooleanValue DO_UPDATE_CHECK;
|
public static ForgeConfigSpec.BooleanValue DO_UPDATE_CHECK;
|
||||||
public static ForgeConfigSpec.BooleanValue UPDATE_CHECK_VERSION_SPECIFIC;
|
public static ForgeConfigSpec.BooleanValue UPDATE_CHECK_VERSION_SPECIFIC;
|
||||||
|
|
|
@ -49,11 +49,7 @@ public enum ConfigStringListValues {
|
||||||
ConfigCategories.TOOL_VALUES,
|
ConfigCategories.TOOL_VALUES,
|
||||||
new String[] { "TConstruct:GravelOre" },
|
new String[] { "TConstruct:GravelOre" },
|
||||||
"By default, the AIOT can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command."),
|
"By default, the AIOT can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command."),
|
||||||
DRILL_EXTRA_MINING_WHITELIST(
|
|
||||||
"Drill Extra Whitelist",
|
|
||||||
ConfigCategories.TOOL_VALUES,
|
|
||||||
new String[] { "TConstruct:GravelOre" },
|
|
||||||
"By default, the Drill can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command."),
|
|
||||||
MINER_EXTRA_WHITELIST(
|
MINER_EXTRA_WHITELIST(
|
||||||
"Vertical Digger Extra Whitelist",
|
"Vertical Digger Extra Whitelist",
|
||||||
ConfigCategories.MACHINE_VALUES,
|
ConfigCategories.MACHINE_VALUES,
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class EntityWorm extends Entity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int dieTime = CommonConfig.OTHER.WORMS_DIE_TIME.get();
|
int dieTime = CommonConfig.Other.WORMS_DIE_TIME.get();
|
||||||
if (dieTime > 0 && this.timer >= dieTime) {
|
if (dieTime > 0 && this.timer >= dieTime) {
|
||||||
this.removeAfterChangingDimensions();
|
this.removeAfterChangingDimensions();
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,7 +200,7 @@ public class ClientEvents {
|
||||||
if (StackUtil.isValid(stack) && stack.getItem() == ConfigValues.itemRedstoneTorchConfigurator) {
|
if (StackUtil.isValid(stack) && stack.getItem() == ConfigValues.itemRedstoneTorchConfigurator) {
|
||||||
expl = TextFormatting.GREEN + StringUtil.localize("info." + ActuallyAdditions.MODID + ".redstoneMode.validItem");
|
expl = TextFormatting.GREEN + StringUtil.localize("info." + ActuallyAdditions.MODID + ".redstoneMode.validItem");
|
||||||
} else {
|
} else {
|
||||||
expl = TextFormatting.GRAY.toString() + TextFormatting.ITALIC + StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".redstoneMode.invalidItem", StringUtil.localize(CommonConfig.OTHER.redstoneConfigureItem.getDescriptionId() + ".name"));
|
expl = TextFormatting.GRAY.toString() + TextFormatting.ITALIC + StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".redstoneMode.invalidItem", StringUtil.localize(CommonConfig.Other.redstoneConfigureItem.getDescriptionId() + ".name"));
|
||||||
}
|
}
|
||||||
font.drawShadow(event.getMatrixStack(), expl, event.getWindow().getGuiScaledWidth() / 2f + 5, event.getWindow().getGuiScaledHeight() / 2f + 15, StringUtil.DECIMAL_COLOR_WHITE);
|
font.drawShadow(event.getMatrixStack(), expl, event.getWindow().getGuiScaledWidth() / 2f + 5, event.getWindow().getGuiScaledHeight() / 2f + 15, StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ public class CommonEvents {
|
||||||
public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event) {
|
public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event) {
|
||||||
//checkAchievements(event.crafting, event.player, InitAchievements.Type.CRAFTING);
|
//checkAchievements(event.crafting, event.player, InitAchievements.Type.CRAFTING);
|
||||||
|
|
||||||
if (CommonConfig.OTHER.GIVE_BOOKLET_ON_FIRST_CRAFT.get()) {
|
if (CommonConfig.Other.GIVE_BOOKLET_ON_FIRST_CRAFT.get()) {
|
||||||
if (!event.getPlayer().level.isClientSide && StackUtil.isValid(event.getCrafting()) && event.getCrafting().getItem() != ActuallyItems.ITEM_BOOKLET.get()) {
|
if (!event.getPlayer().level.isClientSide && StackUtil.isValid(event.getCrafting()) && event.getCrafting().getItem() != ActuallyItems.ITEM_BOOKLET.get()) {
|
||||||
|
|
||||||
String name = event.getCrafting().getItem().getRegistryName().toString();
|
String name = event.getCrafting().getItem().getRegistryName().toString();
|
||||||
|
|
|
@ -13,7 +13,7 @@ package de.ellpeck.actuallyadditions.mod.items;
|
||||||
import com.google.common.collect.ArrayListMultimap;
|
import com.google.common.collect.ArrayListMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues;
|
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDrill;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDrill;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy;
|
import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase;
|
||||||
|
@ -458,7 +458,7 @@ public class DrillItem extends ItemEnergy {
|
||||||
if (location != null) {
|
if (location != null) {
|
||||||
String name = location.toString();
|
String name = location.toString();
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
for (String s : ConfigStringListValues.DRILL_EXTRA_MINING_WHITELIST.getValue()) {
|
for (String s : CommonConfig.ItemSettings.DRILL_EXTRA_MINING_WHITELIST.get()) {
|
||||||
if (s != null && s.equals(name)) {
|
if (s != null && s.equals(name)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.*;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
|
|
||||||
|
@ -42,9 +41,9 @@ public class ItemHairBall extends ItemBase {
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void livingUpdateEvent(LivingEvent.LivingUpdateEvent event) {
|
public void livingUpdateEvent(LivingEvent.LivingUpdateEvent event) {
|
||||||
//Ocelots dropping Hair Balls
|
//Ocelots dropping Hair Balls
|
||||||
if (CommonConfig.OTHER.DO_CAT_DROPS.get() && event.getEntityLiving() != null && event.getEntityLiving().level != null && !event.getEntityLiving().level.isClientSide) {
|
if (CommonConfig.Other.DO_CAT_DROPS.get() && event.getEntityLiving() != null && event.getEntityLiving().level != null && !event.getEntityLiving().level.isClientSide) {
|
||||||
if (event.getEntityLiving() instanceof OcelotEntity && catIsTamedReflection((OcelotEntity) event.getEntityLiving()) || event.getEntityLiving() instanceof PlayerEntity && event.getEntityLiving().getUUID().equals(this.KittyVanCatUUID)) {
|
if (event.getEntityLiving() instanceof OcelotEntity && catIsTamedReflection((OcelotEntity) event.getEntityLiving()) || event.getEntityLiving() instanceof PlayerEntity && event.getEntityLiving().getUUID().equals(this.KittyVanCatUUID)) {
|
||||||
if (event.getEntityLiving().level.random.nextInt(CommonConfig.OTHER.FUR_CHANCE.get()) == 0) {
|
if (event.getEntityLiving().level.random.nextInt(CommonConfig.Other.FUR_CHANCE.get()) == 0) {
|
||||||
ItemEntity item = new ItemEntity(event.getEntityLiving().level, event.getEntityLiving().getX() + 0.5, event.getEntityLiving().getY() + 0.5, event.getEntityLiving().getZ() + 0.5, new ItemStack(ActuallyItems.HAIRY_BALL.get()));
|
ItemEntity item = new ItemEntity(event.getEntityLiving().level, event.getEntityLiving().getX() + 0.5, event.getEntityLiving().getY() + 0.5, event.getEntityLiving().getZ() + 0.5, new ItemStack(ActuallyItems.HAIRY_BALL.get()));
|
||||||
event.getEntityLiving().level.addFreshEntity(item);
|
event.getEntityLiving().level.addFreshEntity(item);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.world.GameRules;
|
import net.minecraft.world.GameRules;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.common.util.FakePlayer;
|
import net.minecraftforge.common.util.FakePlayer;
|
||||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
|
@ -70,7 +69,7 @@ public class ItemSolidifiedExperience extends ItemBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CommonConfig.OTHER.SOLID_XP_ALWAYS_ORBS.get() || player instanceof FakePlayer) {
|
if (CommonConfig.Other.SOLID_XP_ALWAYS_ORBS.get() || player instanceof FakePlayer) {
|
||||||
ExperienceOrbEntity orb = new ExperienceOrbEntity(world, player.getX() + 0.5, player.getY() + 0.5, player.getZ() + 0.5, amount);
|
ExperienceOrbEntity orb = new ExperienceOrbEntity(world, player.getX() + 0.5, player.getY() + 0.5, player.getZ() + 0.5, amount);
|
||||||
orb.getPersistentData().putBoolean(ActuallyAdditions.MODID + "FromSolidified", true);
|
orb.getPersistentData().putBoolean(ActuallyAdditions.MODID + "FromSolidified", true);
|
||||||
world.addFreshEntity(orb);
|
world.addFreshEntity(orb);
|
||||||
|
|
|
@ -18,10 +18,9 @@ import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.SoundCategory;
|
import net.minecraft.util.SoundCategory;
|
||||||
import net.minecraft.util.SoundEvents;
|
import net.minecraft.util.SoundEvents;
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.BlockRayTraceResult;
|
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraft.util.math.vector.Vector3d;
|
import net.minecraft.util.math.vector.Vector3d;
|
||||||
|
import net.minecraft.util.math.vector.Vector3i;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemTeleStaff extends ItemEnergy {
|
public class ItemTeleStaff extends ItemEnergy {
|
||||||
|
@ -34,14 +33,14 @@ public class ItemTeleStaff extends ItemEnergy {
|
||||||
public ActionResult<ItemStack> use(World world, PlayerEntity player, Hand hand) {
|
public ActionResult<ItemStack> use(World world, PlayerEntity player, Hand hand) {
|
||||||
ItemStack stack = player.getItemInHand(hand);
|
ItemStack stack = player.getItemInHand(hand);
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
RayTraceResult rayTraceResult = player.pick(100,0,false);
|
RayTraceResult rayTraceResult = player.pick(100,1F,false);
|
||||||
if (rayTraceResult != null && (rayTraceResult.getType() == RayTraceResult.Type.BLOCK || player.xRot >= -5)) {
|
if (rayTraceResult.getType() == RayTraceResult.Type.BLOCK || player.xRot >= -5) {
|
||||||
BlockRayTraceResult res = (BlockRayTraceResult)rayTraceResult;
|
Vector3d location = rayTraceResult.getLocation();
|
||||||
BlockPos pos = res.getBlockPos().relative(res.getDirection());
|
Vector3d pos = Vector3d.atBottomCenterOf(new Vector3i(location.x, location.y, location.z));
|
||||||
int baseUse = 200;
|
int baseUse = 200;
|
||||||
int use = baseUse + (int) (baseUse * rayTraceResult.getLocation().distanceTo(new Vector3d(player.getX(), player.getY() + (player.getEyeHeight() - player.getEyeHeight()), player.getZ())));
|
int use = baseUse + (int) (baseUse * player.blockPosition().distSqr(new Vector3i(pos.x, pos.y, pos.z)));
|
||||||
if (this.getEnergyStored(stack) >= use) {
|
if (this.getEnergyStored(stack) >= use) {
|
||||||
((ServerPlayerEntity) player).connection.teleport(pos.getX(), pos.getY(), pos.getY(), player.yRot, player.xRot);
|
((ServerPlayerEntity) player).connection.teleport(pos.x, pos.y + 1F, pos.z, player.yRot, player.xRot);
|
||||||
player.removeVehicle();
|
player.removeVehicle();
|
||||||
world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 1.0F, 1.0F);
|
world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 1.0F, 1.0F);
|
||||||
if (!player.isCreative()) {
|
if (!player.isCreative()) {
|
||||||
|
|
|
@ -31,7 +31,6 @@ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.BlockRayTraceResult;
|
import net.minecraft.util.math.BlockRayTraceResult;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
|
@ -46,7 +45,7 @@ public class ItemWaterBowl extends ItemBase {
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onPlayerInteractEvent(PlayerInteractEvent.RightClickItem event) {
|
public void onPlayerInteractEvent(PlayerInteractEvent.RightClickItem event) {
|
||||||
if (event.getWorld() != null) {
|
if (event.getWorld() != null) {
|
||||||
if (CommonConfig.OTHER.WATER_BOWL.get()) {
|
if (CommonConfig.Other.WATER_BOWL.get()) {
|
||||||
if (StackUtil.isValid(event.getItemStack()) && event.getItemStack().getItem() == Items.BOWL) {
|
if (StackUtil.isValid(event.getItemStack()) && event.getItemStack().getItem() == Items.BOWL) {
|
||||||
RayTraceResult rayTrace = WorldUtil.getNearestBlockWithDefaultReachDistance(event.getWorld(), event.getPlayer(), true, false, false);
|
RayTraceResult rayTrace = WorldUtil.getNearestBlockWithDefaultReachDistance(event.getWorld(), event.getPlayer(), true, false, false);
|
||||||
if (rayTrace.getType() != RayTraceResult.Type.BLOCK) {
|
if (rayTrace.getType() != RayTraceResult.Type.BLOCK) {
|
||||||
|
@ -126,7 +125,7 @@ public class ItemWaterBowl extends ItemBase {
|
||||||
@Override
|
@Override
|
||||||
public void inventoryTick(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected) {
|
public void inventoryTick(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
if (CommonConfig.OTHER.WATER_BOWL_LOSS.get()) {
|
if (CommonConfig.Other.WATER_BOWL_LOSS.get()) {
|
||||||
if (world.getGameTime() % 10 == 0 && world.random.nextFloat() >= 0.5F) {
|
if (world.getGameTime() % 10 == 0 && world.random.nextFloat() >= 0.5F) {
|
||||||
int lastX = 0;
|
int lastX = 0;
|
||||||
int lastY = 0;
|
int lastY = 0;
|
||||||
|
|
|
@ -23,7 +23,6 @@ import net.minecraft.util.ActionResultType;
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||||
import net.minecraftforge.eventbus.api.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraftforge.eventbus.api.EventPriority;
|
import net.minecraftforge.eventbus.api.EventPriority;
|
||||||
|
@ -68,7 +67,7 @@ public class ItemWorm extends ItemBase {
|
||||||
|
|
||||||
@SubscribeEvent(priority = EventPriority.LOW)
|
@SubscribeEvent(priority = EventPriority.LOW)
|
||||||
public void onHoe(UseHoeEvent event) {
|
public void onHoe(UseHoeEvent event) {
|
||||||
if (CommonConfig.OTHER.WORMS.get() && event.getResult() != Event.Result.DENY) {
|
if (CommonConfig.Other.WORMS.get() && event.getResult() != Event.Result.DENY) {
|
||||||
World world = event.getEntity().level;
|
World world = event.getEntity().level;
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
BlockPos pos = event.getContext().getClickedPos();
|
BlockPos pos = event.getContext().getClickedPos();
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class LensDisruption extends Lens {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean invoke(BlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile) {
|
public boolean invoke(BlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile) {
|
||||||
if (CommonConfig.OTHER.ELEVEN.get() == 11 && tile.getEnergy() >= ENERGY_USE && hitBlock != null && !hitState.getBlock().isAir(hitState, tile.getWorldObject(), hitBlock)) {
|
if (CommonConfig.Other.ELEVEN.get() == 11 && tile.getEnergy() >= ENERGY_USE && hitBlock != null && !hitState.getBlock().isAir(hitState, tile.getWorldObject(), hitBlock)) {
|
||||||
int range = 2;
|
int range = 2;
|
||||||
ArrayList<ItemEntity> items = (ArrayList<ItemEntity>) tile.getWorldObject().getEntitiesOfClass(ItemEntity.class, new AxisAlignedBB(hitBlock.getX() - range, hitBlock.getY() - range, hitBlock.getZ() - range, hitBlock.getX() + range, hitBlock.getY() + range, hitBlock.getZ() + range));
|
ArrayList<ItemEntity> items = (ArrayList<ItemEntity>) tile.getWorldObject().getEntitiesOfClass(ItemEntity.class, new AxisAlignedBB(hitBlock.getX() - range, hitBlock.getY() - range, hitBlock.getZ() - range, hitBlock.getX() + range, hitBlock.getY() + range, hitBlock.getZ() + range));
|
||||||
for (ItemEntity item : items) {
|
for (ItemEntity item : items) {
|
||||||
|
|
|
@ -16,11 +16,9 @@ import de.ellpeck.actuallyadditions.api.lens.ILensItem;
|
||||||
import de.ellpeck.actuallyadditions.api.lens.Lens;
|
import de.ellpeck.actuallyadditions.api.lens.Lens;
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.misc.SoundHandler;
|
import de.ellpeck.actuallyadditions.mod.misc.SoundHandler;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -33,8 +31,6 @@ import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.LazyOptional;
|
import net.minecraftforge.common.util.LazyOptional;
|
||||||
import net.minecraftforge.energy.IEnergyStorage;
|
import net.minecraftforge.energy.IEnergyStorage;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
|
||||||
|
|
||||||
public class TileEntityAtomicReconstructor extends TileEntityInventoryBase implements IEnergyDisplay, IAtomicReconstructor {
|
public class TileEntityAtomicReconstructor extends TileEntityInventoryBase implements IEnergyDisplay, IAtomicReconstructor {
|
||||||
|
|
||||||
public static final int ENERGY_USE = 1000;
|
public static final int ENERGY_USE = 1000;
|
||||||
|
@ -48,7 +44,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
|
||||||
|
|
||||||
public TileEntityAtomicReconstructor() {
|
public TileEntityAtomicReconstructor() {
|
||||||
super(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.getTileEntityType(), 1);
|
super(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.getTileEntityType(), 1);
|
||||||
int power = CommonConfig.MACHINES.RECONSTRUCTOR_POWER.get();
|
int power = CommonConfig.Machines.RECONSTRUCTOR_POWER.get();
|
||||||
int recieve = MathHelper.ceil(power * 0.016666F);
|
int recieve = MathHelper.ceil(power * 0.016666F);
|
||||||
this.storage = new CustomEnergyStorage(power, recieve, 0);
|
this.storage = new CustomEnergyStorage(power, recieve, 0);
|
||||||
this.lazyEnergy = LazyOptional.of(() -> this.storage);
|
this.lazyEnergy = LazyOptional.of(() -> this.storage);
|
||||||
|
|
|
@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.api.farmer.IFarmerBehavior;
|
||||||
import de.ellpeck.actuallyadditions.api.internal.IFarmer;
|
import de.ellpeck.actuallyadditions.api.internal.IFarmer;
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFarmer;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFarmer;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
|
||||||
|
@ -33,7 +32,6 @@ import net.minecraft.state.properties.BlockStateProperties;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.text.StringTextComponent;
|
|
||||||
import net.minecraft.util.text.TranslationTextComponent;
|
import net.minecraft.util.text.TranslationTextComponent;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.server.ServerWorld;
|
import net.minecraft.world.server.ServerWorld;
|
||||||
|
@ -95,7 +93,7 @@ public class TileEntityFarmer extends TileEntityInventoryBase implements IFarmer
|
||||||
this.waitTime--;
|
this.waitTime--;
|
||||||
|
|
||||||
if (this.waitTime <= 0) {
|
if (this.waitTime <= 0) {
|
||||||
int area = CommonConfig.MACHINES.FARMER_AREA.get();
|
int area = CommonConfig.Machines.FARMER_AREA.get();
|
||||||
if (area % 2 == 0) {
|
if (area % 2 == 0) {
|
||||||
area++;
|
area++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class ThreadUpdateChecker extends Thread {
|
||||||
updateProperties.load(new InputStreamReader(newestURL.openStream()));
|
updateProperties.load(new InputStreamReader(newestURL.openStream()));
|
||||||
|
|
||||||
String currentMcVersion = Util.getMcVersion();
|
String currentMcVersion = Util.getMcVersion();
|
||||||
if (CommonConfig.OTHER.UPDATE_CHECK_VERSION_SPECIFIC.get()) {
|
if (CommonConfig.Other.UPDATE_CHECK_VERSION_SPECIFIC.get()) {
|
||||||
String newestVersionProp = updateProperties.getProperty(currentMcVersion);
|
String newestVersionProp = updateProperties.getProperty(currentMcVersion);
|
||||||
|
|
||||||
UpdateChecker.updateVersionInt = Integer.parseInt(newestVersionProp);
|
UpdateChecker.updateVersionInt = Integer.parseInt(newestVersionProp);
|
||||||
|
|
Loading…
Reference in a new issue