Compare commits

...
4 Commits
Author SHA1 Message Date
Martin Robertz fb4c9bde59 update 2024-05-09 10:02:46 +02:00
Oleg Ivanov bd47a39c83 Add config entries for Farming Station particles (#162)
* Decrease number of Farming Station particles

* Set default values for range & number of particles to original
2024-05-08 20:48:35 +02:00
Martin Robertz 43d74c9a7a update 2024-04-24 21:47:04 +02:00
PT400C Jomcraft 6d3a631bb0 Improve FarmingStation portal texture rendering (#157) 2024-04-24 21:26:51 +02:00
7 changed files with 72 additions and 29 deletions

No files matched your search

+7 -7
View File
@@ -2,21 +2,21 @@
dependencies {
api('com.github.GTNewHorizons:EnderCore:0.4.6:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ForestryMC:4.8.9:dev')
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.5.25-GTNH:dev')
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.0:dev')
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev')
compileOnly("com.github.GTNewHorizons:GTNHLib:0.2.11:dev")
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:dev')
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
shadowImplementation('cglib:cglib-nodep:3.3.0')
compileOnly('com.github.GTNewHorizons:waila:1.7.3:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-348-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-400-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.153:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.7:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.05:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.8:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.13.5-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Chisel:2.14.1-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.10-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.11-GTNH:api') {transitive = false}
compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('curse.maven:ee3-65509:2305023') // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
@@ -24,5 +24,5 @@ dependencies {
compileOnly(rfg.deobf('curse.maven:mekanism-268560:2475797')) // https://www.curseforge.com/minecraft/mc-mods/mekanism/files/2475797
compileOnly(rfg.deobf('maven.modrinth:immibis-microblocks:59.1.2')) // https://modrinth.com/mod/immibis-microblocks/version/59.1.2
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha36a:api') {transitive = false}
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha45:api') {transitive = false}
}
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.21'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.22'
}
@@ -361,6 +361,8 @@ public final class Config {
"TwilightForest:item.steeleafHoe", "TwilightForest:item.ironwoodHoe", "IC2:itemToolBronzeHoe" };
public static List<ItemStack> farmHoes = new ArrayList<ItemStack>();
public static int farmSaplingReserveAmount = 8;
public static double farmParticlesMaxRange = 64;
public static int farmParticlesCount = 15;
public static int magnetPowerUsePerSecondRF = 1;
public static int magnetPowerCapacityRF = 100000;
@@ -2060,6 +2062,18 @@ public final class Config {
+ "always shear all leaves.")
.getInt(farmSaplingReserveAmount);
farmParticlesMaxRange = config.get(
sectionFarm.name,
"farmParticlesMaxRange",
farmParticlesMaxRange,
"The max range of the farm action particles.").getDouble(farmParticlesMaxRange);
farmParticlesCount = config.get(
sectionFarm.name,
"farmParticlesCount",
farmParticlesCount,
"The number of particles produces by farm action.").getInt(farmParticlesCount);
combustionGeneratorUseOpaqueModel = config
.get(
sectionAesthetic.name,
@@ -35,7 +35,12 @@ public class FarmingStationRenderer extends TechneMachineRenderer<TileFarmStatio
bb = bb.translate(x, y, z);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.setBrightness(0xF000F0);
CubeRenderer.get().render(bb, override != null ? override : Blocks.portal.getBlockTextureFromSide(1));
IIcon ico = override != null ? override : Blocks.portal.getBlockTextureFromSide(1);
float x1 = ico.getInterpolatedU(3);
float x2 = ico.getInterpolatedU(13);
float y1 = ico.getInterpolatedV(6);
float y2 = ico.getInterpolatedV(10);
CubeRenderer.get().render(bb, x1, x2, y1, y2);
}
}
@@ -9,6 +9,7 @@ import com.enderio.core.common.util.BlockCoord;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import crazypants.enderio.config.Config;
import crazypants.util.ClientUtil;
import io.netty.buffer.ByteBuf;
@@ -51,11 +52,7 @@ public class PacketFarmAction implements IMessage, IMessageHandler<PacketFarmAct
@Override
public IMessage onMessage(PacketFarmAction message, MessageContext ctx) {
for (BlockCoord bc : message.coords) {
for (int i = 0; i < 15; i++) {
ClientUtil.spawnFarmParcticles(rand, bc);
}
}
ClientUtil.spawnFarmParticles(rand, message.coords, Config.farmParticlesCount);
return null;
}
}
@@ -458,8 +458,9 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
IHarvestResult harvest = FarmersCommune.instance.harvestBlock(this, bc, block, meta);
if (harvest != null && harvest.getDrops() != null) {
PacketFarmAction pkt = new PacketFarmAction(harvest.getHarvestedBlocks());
PacketHandler.INSTANCE
.sendToAllAround(pkt, new TargetPoint(worldObj.provider.dimensionId, bc.x, bc.y, bc.z, 64));
PacketHandler.INSTANCE.sendToAllAround(
pkt,
new TargetPoint(worldObj.provider.dimensionId, bc.x, bc.y, bc.z, Config.farmParticlesMaxRange));
for (EntityItem ei : harvest.getDrops()) {
if (ei != null) {
insertHarvestDrop(ei, bc);
@@ -487,7 +488,12 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
inventory[minFirtSlot] = farmerJoe.inventory.mainInventory[0];
PacketHandler.INSTANCE.sendToAllAround(
new PacketFarmAction(bc),
new TargetPoint(worldObj.provider.dimensionId, bc.x, bc.y, bc.z, 64));
new TargetPoint(
worldObj.provider.dimensionId,
bc.x,
bc.y,
bc.z,
Config.farmParticlesMaxRange));
if (inventory[minFirtSlot] != null && inventory[minFirtSlot].stackSize == 0) {
inventory[minFirtSlot] = null;
}
+33 -12
View File
@@ -1,10 +1,14 @@
package crazypants.util;
import java.util.List;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.particle.EntityPortalFX;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import com.enderio.core.common.util.BlockCoord;
@@ -47,18 +51,35 @@ public class ClientUtil {
con.readFromNBT(pkt.tc, TileConduitBundle.NBT_VERSION);
}
public static void spawnFarmParcticles(Random rand, BlockCoord bc) {
double xOff = 0.5 + (rand.nextDouble() - 0.5) * 1.1;
double yOff = 0.5 + (rand.nextDouble() - 0.5) * 0.2;
double zOff = 0.5 + (rand.nextDouble() - 0.5) * 1.1;
Minecraft.getMinecraft().theWorld.spawnParticle(
"portal",
bc.x + xOff,
bc.y + yOff,
bc.z + zOff,
(rand.nextDouble() - 0.5) * 1.5,
-rand.nextDouble(),
(rand.nextDouble() - 0.5) * 1.5);
public static void spawnFarmParticles(Random rand, List<BlockCoord> coords, int particlesCount) {
// 0 = All, 1 = Decreased, 2 = Minimal
int particleSetting = Minecraft.getMinecraft().gameSettings.particleSetting;
if (particleSetting >= 2 /* Minimal */) {
return;
}
int particles = particleSetting == 0 ? particlesCount /* All */
: (particlesCount / 2) /* Decreased */;
World world = Minecraft.getMinecraft().theWorld;
EffectRenderer effectRenderer = Minecraft.getMinecraft().effectRenderer;
for (BlockCoord bc : coords) {
for (int i = 0; i < particles; i++) {
double xOff = 0.5 + (rand.nextDouble() - 0.5) * 1.1;
double yOff = 0.5 + (rand.nextDouble() - 0.5) * 0.2;
double zOff = 0.5 + (rand.nextDouble() - 0.5) * 1.1;
effectRenderer.addEffect(
new EntityPortalFX(
world,
bc.x + xOff,
bc.y + yOff,
bc.z + zOff,
(rand.nextDouble() - 0.5) * 1.5,
-rand.nextDouble(),
(rand.nextDouble() - 0.5) * 1.5));
}
}
}
public static void setTankNBT(PacketCombustionTank message, int x, int y, int z) {