Skip to content

Commit

Permalink
Merge branch '1.16' into release-1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed May 11, 2024
2 parents 157d680 + 2d18ab9 commit cbd3dde
Show file tree
Hide file tree
Showing 10 changed files with 582 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ dependencies {
compileOnly fg.deobf("dev.ftb.mods:ftb-library-forge:1605.3.1-build.48")
compileOnly fg.deobf("dev.ftb.mods:ftb-teams-forge:1605.2.1-build.17")
compileOnly fg.deobf("dev.ftb.mods:ftb-ranks-forge:1605.1.4-build.6")
runtimeOnly fg.deobf("curse.maven:refined-storage-243076:3400575")
//runtimeOnly fg.deobf("curse.maven:refined-storage-243076:3400575")
}

afterEvaluate {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
org.gradle.jvmargs=-Xmx8G
mod_version=2.0
minecraftVersion=1.16.5
api_version=3.2.14.7
api_version=3.2.14.8
jei_version=6.0.0.10
redstoneflux_version=2.0.+
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -104,7 +103,7 @@ public class IndustrialForegoing extends ModuleController {

public IndustrialForegoing() {
proxy = new CommonProxy();
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> EventManager.mod(FMLClientSetupEvent.class).process(fmlClientSetupEvent -> new ClientProxy().run()).subscribe());
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> EventManager.mod(FMLClientSetupEvent.class).process(fmlClientSetupEvent -> fmlClientSetupEvent.enqueueWork(() -> new ClientProxy().run())).subscribe());
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> EventManager.mod(ModelRegistryEvent.class).process(modelRegistryEvent -> ModelLoader.addSpecialModel(new ResourceLocation(Reference.MOD_ID, "block/catears"))).subscribe());

EventManager.mod(FMLCommonSetupEvent.class).process(fmlCommonSetupEvent -> proxy.run()).subscribe();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public int getSlotSize() {

@Override
public List<MycelialGeneratorRecipe> getRecipes() {
return ForgeRegistries.ITEMS.getValues().stream().filter(Item::isFood).map(ItemStack::new).map(item -> new MycelialGeneratorRecipe(Collections.singletonList(Collections.singletonList(Ingredient.fromStacks(item))), new ArrayList<>(), calculate(item).getLeft(), calculate(item).getRight())).collect(Collectors.toList());
return ForgeRegistries.ITEMS.getValues().stream().filter(item -> item.isFood() && item.getFood() != null).map(ItemStack::new).map(item -> new MycelialGeneratorRecipe(Collections.singletonList(Collections.singletonList(Ingredient.fromStacks(item))), new ArrayList<>(), calculate(item).getLeft(), calculate(item).getRight())).collect(Collectors.toList());
}

private Pair<Integer,Integer> calculate(ItemStack stack){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public static FireworkRocketItem.Shape get(int indexIn) {

private Pair<Integer, Integer> calculate(ItemStack stack) {
CompoundNBT nbt = stack.getChildTag("Fireworks");
if (nbt == null || !nbt.contains("Flight")) return Pair.of(0, 0);
int flight = nbt.getInt("Flight");
double power = 1;
ListNBT listnbt = nbt.getList("Explosions", 10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public EnchantmentApplicatorTile() {
super(ModuleMisc.ENCHANTMENT_APPLICATOR, 112, 40);
this.addTank(tank = (SidedFluidTankComponent<EnchantmentApplicatorTile>) new SidedFluidTankComponent<EnchantmentApplicatorTile>("essence", EnchantmentApplicatorConfig.tankSize, 34, 20, 0).
setColor(DyeColor.LIME).
setOnContentChange(() -> syncObject(tank)).
setComponentHarness(this).
setValidator(fluidStack -> fluidStack.getFluid().isIn(IndustrialTags.Fluids.EXPERIENCE))
);
Expand Down Expand Up @@ -89,7 +90,13 @@ public boolean canIncrease() {
long amount = this.tank.getFluidAmount();
TileEntity tileEntity = this.world.getTileEntity(this.pos.up());
if (tileEntity != null && tileEntity.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY).isPresent()){
amount += tileEntity.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY).map(iFluidHandler -> iFluidHandler.drain(new FluidStack(ModuleCore.ESSENCE.getSourceFluid(), Integer.MAX_VALUE), IFluidHandler.FluidAction.SIMULATE).getAmount()).orElse(0);
amount += tileEntity.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY).map(iFluidHandler -> {
FluidStack fluidStack = iFluidHandler.drain(Integer.MAX_VALUE, IFluidHandler.FluidAction.SIMULATE);
if (fluidStack.getFluid().isIn(IndustrialTags.Fluids.EXPERIENCE)) {
return fluidStack.getAmount();
}
return 0;
}).orElse(0);
}
return !output.getLeft().isEmpty() && amount >= getEssenceConsumed(output.getRight()) && this.output.getStackInSlot(0).isEmpty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,13 @@ private void onWork(){
if (laserDrillOreRecipe.catalyst.test(lens.getStackInSlot(i))) weight += OreLaserBaseConfig.catalystModifier;
}
ItemStack stack = laserDrillOreRecipe.output.getMatchingStacks()[0];
boolean hasFound = false;
for (String modid : TagConfig.ITEM_PREFERENCE) {
if (hasFound) break;
for (ItemStack matchingStack : laserDrillOreRecipe.output.getMatchingStacks()) {
if (matchingStack.getItem().getRegistryName().getNamespace().equals(modid)){
stack = matchingStack;
hasFound = true;
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public TileEntity createTileEntity(BlockState state, IBlockReader world) {
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
FluidState ifluidstate = context.getWorld().getFluidState(context.getPos());
return this.getDefaultState().with(FACING, context.getPlayer().getHorizontalFacing()).with(WATERLOGGED, Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER));
return this.getDefaultState().with(FACING, context.getPlayer() == null ? Direction.NORTH : context.getPlayer().getHorizontalFacing()).with(WATERLOGGED, Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void setEnergyStored(long power) {

@Override
public int getMaxEnergyStored() {
return (int) capacity;
return Integer.MAX_VALUE;
}

@Override
Expand Down
Loading

0 comments on commit cbd3dde

Please sign in to comment.