This commit is contained in:
Boblet 2024-09-13 13:17:51 +02:00
parent f806dee99f
commit 2a81e2c5a7
8 changed files with 464 additions and 459 deletions

View File

@ -1,5 +1,12 @@
## Added
* Settings tool
* Allows settings of blocks and machines to be copied
* Uses settings such as conveyor item filters, fluid types and liquid metal types
## Changed ## Changed
* Most loot piles now have configurable loot pools * Most loot piles now have configurable loot pools
* The ntmsatellites command now has the "list" parameter which shows all active satellites in orbit
* Burning in the nether in 528 mode now has a config option, and it no longer affects NPCs
## Fixed ## Fixed
* Fixed some things not using variable max charge for armor mods, like static pads and DNT nanosuit tooltips * Fixed some things not using variable max charge for armor mods, like static pads and DNT nanosuit tooltips

View File

@ -34,6 +34,7 @@ import com.hbm.util.ArmorUtil;
import api.hbm.energymk2.IEnergyHandlerMK2; import api.hbm.energymk2.IEnergyHandlerMK2;
import cofh.api.energy.IEnergyProvider; import cofh.api.energy.IEnergyProvider;
@Spaghetti("this sucks ass")
public class ExplosionNukeGeneric { public class ExplosionNukeGeneric {
private final static Random random = new Random(); private final static Random random = new Random();

File diff suppressed because it is too large Load Diff

View File

@ -4,9 +4,11 @@ import com.hbm.extprop.HbmPlayerProps;
import com.hbm.handler.HbmKeybinds; import com.hbm.handler.HbmKeybinds;
import com.hbm.interfaces.ICopiable; import com.hbm.interfaces.ICopiable;
import com.hbm.packet.PacketDispatcher; import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.PlayerInformPacket; import com.hbm.packet.toclient.PlayerInformPacket;
import com.hbm.util.ChatBuilder; import com.hbm.util.ChatBuilder;
import com.hbm.util.Either; import com.hbm.util.Either;
import com.hbm.util.I18nUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -17,7 +19,6 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -66,16 +67,15 @@ public class ItemSettingsTool extends Item {
list.add("Can copy the settings (filters, fluid ID, etc) of machines"); list.add("Can copy the settings (filters, fluid ID, etc) of machines");
list.add("Shift right-click to copy, right click to paste"); list.add("Shift right-click to copy, right click to paste");
list.add("Ctrl click on pipes to paste settings to multiple pipes"); list.add("Ctrl click on pipes to paste settings to multiple pipes");
/*if(stack.stackTagCompound != null) { if(stack.stackTagCompound != null) {
NBTTagCompound nbt = stack.stackTagCompound; NBTTagCompound nbt = stack.stackTagCompound;
if (nbt.hasKey("tileName")){ if (nbt.hasKey("tileName")){
list.add(ChatBuilder.startTranslation(nbt.getString("tileName")).color(EnumChatFormatting.BLUE).flush().getFormattedText()); list.add(EnumChatFormatting.BLUE + I18nUtil.resolveKey(nbt.getString("tileName") + ".name"));
} else { } else {
list.add(EnumChatFormatting.RED + " None "); list.add(EnumChatFormatting.RED + " None ");
} }
}*/ }
//the translation wont fucking work I swear to allah
} }
@Override @Override
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fX, float fY, float fZ) { public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fX, float fY, float fZ) {

View File

@ -14,8 +14,10 @@ import net.minecraft.world.World;
import java.util.ArrayList; import java.util.ArrayList;
public interface IFluidCopiable extends ICopiable { public interface IFluidCopiable extends ICopiable {
/** /**
* @return First type for the normal paste, second type for the alt paste, none if there is no alt paste support * @return First type for the normal paste, second type for the alt paste,
* none if there is no alt paste support
*/ */
default int[] getFluidIDToCopy() { default int[] getFluidIDToCopy() {
IFluidUser tile = (IFluidUser) this; IFluidUser tile = (IFluidUser) this;
@ -41,8 +43,7 @@ public interface IFluidCopiable extends ICopiable {
@Override @Override
default NBTTagCompound getSettings(World world, int x, int y, int z) { default NBTTagCompound getSettings(World world, int x, int y, int z) {
NBTTagCompound tag = new NBTTagCompound(); NBTTagCompound tag = new NBTTagCompound();
if(getFluidIDToCopy().length > 0) if(getFluidIDToCopy().length > 0) tag.setIntArray("fluidID", getFluidIDToCopy());
tag.setIntArray("fluidID", getFluidIDToCopy());
return tag; return tag;
} }

View File

@ -7,26 +7,24 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World; import net.minecraft.world.World;
public interface IMetalCopiable extends ICopiable { public interface IMetalCopiable extends ICopiable {
int[] getMatsToCopy(); int[] getMatsToCopy();
@Override @Override
default NBTTagCompound getSettings(World world, int x, int y, int z) { default NBTTagCompound getSettings(World world, int x, int y, int z) {
NBTTagCompound tag = new NBTTagCompound(); NBTTagCompound tag = new NBTTagCompound();
if(getMatsToCopy().length > 0) if(getMatsToCopy().length > 0) tag.setIntArray("matFilter", getMatsToCopy());
tag.setIntArray("matFilter", getMatsToCopy());
return tag; return tag;
} }
@Override @Override
default String[] infoForDisplay(World world, int x, int y, int z) { default String[] infoForDisplay(World world, int x, int y, int z) {
int[] ids = getMatsToCopy(); int[] ids = getMatsToCopy();
String[] names = new String[ids.length]; String[] names = new String[ids.length];
for (int i = 0; i < ids.length; i++) { for(int i = 0; i < ids.length; i++) names[i] = Mats.matById.get(ids[i]).getUnlocalizedName();
names[i] = Mats.matById.get(ids[i]).getUnlocalizedName();
}
return names; return names;
} }
@Override
default void pasteSettings(NBTTagCompound nbt, int index, World world, EntityPlayer player, int x, int y, int z){
}; @Override
default void pasteSettings(NBTTagCompound nbt, int index, World world, EntityPlayer player, int x, int y, int z) { };
} }

View File

@ -8,6 +8,7 @@ import java.util.function.Function;
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public final class Either<L, R> { public final class Either<L, R> {
public static <L, R> Either<L, R> left(L value) { public static <L, R> Either<L, R> left(L value) {
return new Either<>(value, true); return new Either<>(value, true);
} }