Compare commits

...
3 Commits
Author SHA1 Message Date
TotallyNotOndre 5b551eb8ec "fix" compartment tab name input field (#63) 2025-07-15 19:39:33 +02:00
Martin Robertz f497114579 update 2025-07-08 12:11:02 +02:00
Alexdoru ea547df4d0 Properly apply hunger effect (#62) 2025-07-07 21:42:49 +02:00
3 changed files with 28 additions and 30 deletions

No files matched your search

+4 -4
View File
@@ -1,12 +1,12 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:ForestryMC:4.10.7:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.6.21:dev')
api('com.github.GTNewHorizons:ForestryMC:4.10.13:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.6.36:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.7.40-GTNH:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.7.60-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.42:api')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.44:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
}
@@ -488,7 +488,9 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
public void updateTabs() {
CompartmentTab tab = getCurrentTab();
tabName.setValue(tab.getName());
if (!tabName.isFocused()) {
tabName.setValue(tab.getName());
}
tabIcon.setItemStack(tab.getIcon());
tabColour.setValue(tab.getColor());
}
@@ -389,34 +389,27 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
}
private void onFoodEffect(IBeeGenome genome, IBeeHousing housing) {
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
if (entity instanceof EntityPlayer player) {
player.getFoodStats().addStats(2, 0.2f);
}
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
player.getFoodStats().addStats(2, 0.2f);
}
}
private void onHungerEffect(IBeeGenome genome, IBeeHousing housing, World world) {
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
if (entity instanceof EntityPlayer player) {
if (world.rand.nextInt(4) < wearsItems(player)) {
continue;
}
player.getFoodStats().addExhaustion(4.0f);
player.addPotionEffect(new PotionEffect(Potion.hunger.id, 100));
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
if (world.rand.nextInt(4) < wearsItems(player)) {
continue;
}
player.addExhaustion(4.0f);
player.addPotionEffect(new PotionEffect(Potion.hunger.id, 100));
}
}
private void onPotionEffect(IBeeGenome genome, IBeeHousing housing, World world, PotionEffect potion) {
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
if (entity instanceof EntityPlayer player) {
if (world.rand.nextInt(4) < wearsItems(player)) {
continue;
}
player.addPotionEffect(potion);
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
if (world.rand.nextInt(4) < wearsItems(player)) {
continue;
}
player.addPotionEffect(potion);
}
}
@@ -611,13 +604,16 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
public <T extends Entity> List<T> getEntities(Class<T> eClass, IBeeGenome genome, IBeeHousing housing) {
int[] area = genome.getTerritory();
int[] offset = { -Math.round(area[0] / 2f), -Math.round(area[1] / 2f), -Math.round(area[2] / 2f) };
int[] min = { housing.getCoordinates().posX + offset[0], housing.getCoordinates().posY + offset[1],
housing.getCoordinates().posZ + offset[2] };
int[] max = { housing.getCoordinates().posX + offset[0] + area[0],
housing.getCoordinates().posY + offset[1] + area[1],
housing.getCoordinates().posZ + offset[2] + area[2] };
AxisAlignedBB box = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]);
int offsetX = -Math.round(area[0] / 2f);
int offsetY = -Math.round(area[1] / 2f);
int offsetZ = -Math.round(area[2] / 2f);
int minX = housing.getCoordinates().posX + offsetX;
int minY = housing.getCoordinates().posY + offsetY;
int minZ = housing.getCoordinates().posZ + offsetZ;
int maxX = housing.getCoordinates().posX + offsetX + area[0];
int maxY = housing.getCoordinates().posY + offsetY + area[1];
int maxZ = housing.getCoordinates().posZ + offsetZ + area[2];
AxisAlignedBB box = AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ);
return housing.getWorld().getEntitiesWithinAABB(eClass, box);
}