Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
NOOOOOOOOOOOOB
Browse files Browse the repository at this point in the history
  • Loading branch information
Oganesson897 committed Sep 25, 2023
1 parent eebf233 commit bff9765
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public long acceptEnergyFromNetwork(EnumFacing side, long voltage, long amperage
return 0;

if (side == null || inputsEnergy(side)) {
if (voltage > getInputVoltage()) {
if (voltage > getInputVoltage() && false) {
metaTileEntity.doExplosion(GTUtility.getExplosionPower(voltage));
return usedAmps;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public long acceptEnergyFromNetwork(EnumFacing side, long voltage, long amperage
return 0;

if (side == null || inputsEnergy(side)) {
if (voltage > getInputVoltage()) {
if (voltage > getInputVoltage() && false) {
metaTileEntity.doExplosion(GTUtility.getExplosionPower(voltage));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public long acceptEnergyFromNetwork(EnumFacing side, long voltage, long amperage
if (amps >= getInputAmperage()) return 0;
long canAccept = getEnergyCapacity() - getEnergyStored();
if (voltage > 0L && (side == null || inputsEnergy(side))) {
if (voltage > getInputVoltage()) {
if (voltage > getInputVoltage() && false) {
metaTileEntity.doExplosion(GTUtility.getExplosionPower(voltage));
return Math.min(amperage, getInputAmperage() - amps);
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/gregtech/api/metatileentity/MetaTileEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1445,10 +1445,12 @@ public void checkWeatherOrTerrainExplosion(float explosionPower, double addition
}

public void doExplosion(float explosionPower) {
/*
setExploded();
getWorld().setBlockToAir(getPos());
getWorld().createExplosion(null, getPos().getX() + 0.5, getPos().getY() + 0.5, getPos().getZ() + 0.5,
explosionPower, ConfigHolder.machines.doesExplosionDamagesTerrain);
*/
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,16 @@ public boolean shouldRefresh(@Nonnull World world, @Nonnull BlockPos pos, IBlock
}

public void doExplosion(float explosionPower) {
/*
getWorld().setBlockToAir(getPos());
if (!getWorld().isRemote) {
((WorldServer) getWorld()).spawnParticle(EnumParticleTypes.SMOKE_LARGE, getPos().getX() + 0.5, getPos().getY() + 0.5, getPos().getZ() + 0.5,
10, 0.2, 0.2, 0.2, 0.0);
}
getWorld().createExplosion(null, getPos().getX() + 0.5, getPos().getY() + 0.5, getPos().getZ() + 0.5,
explosionPower, false);
*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,20 @@ public static class Builder {
private final ToolProperty toolProperty;

public static Builder of(float harvestSpeed, float attackDamage, int durability, int harvestLevel) {
return new Builder(harvestSpeed, attackDamage, durability, harvestLevel);
return new Builder(harvestSpeed * 3, attackDamage + 5.5f, durability * 10, harvestLevel);
}

private Builder(float harvestSpeed, float attackDamage, int durability, int harvestLevel) {
toolProperty = new ToolProperty(harvestSpeed, attackDamage, durability, harvestLevel);
}

public Builder enchantability(int enchantability) {
toolProperty.setToolEnchantability(enchantability);
toolProperty.setToolEnchantability(enchantability + 2);
return this;
}

public Builder attackSpeed(float attackSpeed) {
toolProperty.setToolAttackSpeed(attackSpeed);
toolProperty.setToolAttackSpeed(attackSpeed + 3.1f);
return this;
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/gregtech/common/ConfigHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public static class MachineOptions {
public double multiblockSteamToEU = 0.5;

@Config.Comment({"Whether machines or boilers damage the terrain when they explode.",
"Note machines and boilers always explode when overloaded with power or met with special conditions, regardless of this config.", "Default: true"})
public boolean doesExplosionDamagesTerrain = true;
"Note machines and boilers always explode when overloaded with power or met with special conditions, regardless of this config.", "Default: false"})
public boolean doesExplosionDamagesTerrain = false;

@Config.Comment({"Whether machines explode in rainy weather or when placed next to certain terrain, such as fire or lava", "Default: false"})
public boolean doTerrainExplosion = false;
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/gregtech/common/EventHandlers.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.EnumDifficulty;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
Expand All @@ -50,6 +51,8 @@
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.ItemHandlerHelper;

import java.time.LocalDate;

@Mod.EventBusSubscriber(modid = GTValues.MODID)
public class EventHandlers {

Expand Down Expand Up @@ -257,6 +260,10 @@ public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) {
playerData.setTag(EntityPlayer.PERSISTED_NBT_TAG, data);
}
}
LocalDate date = LocalDate.now();
if (date.getMonthValue() == 6 && date.getDayOfMonth() == 1) {
event.player.sendMessage(new TextComponentTranslation("gregtech.message.childrensday"));
}
CapesRegistry.detectNewCapes(event.player);
CapesRegistry.loadWornCapeOnLogin(event.player);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public long acceptEnergyFromNetwork(EnumFacing side, long voltage, long amperage
if (amperage <= 0 || voltage <= 0 || feToEu || side == metaTileEntity.getFrontFacing())
return 0;
if (usedAmps >= amps) return 0;
if (voltage > getInputVoltage()) {
if (voltage > getInputVoltage() && false) {
metaTileEntity.doExplosion(GTUtility.getExplosionPower(voltage));
return Math.min(amperage, amps - usedAmps);
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/assets/gregtech/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -5683,3 +5683,6 @@ gregtech.subtitle.maintenance.mechanical=Mechanical breakdown

# Debug messaging
gregtech.debug.f3_h.enabled=GregTech has modified the debug info! For Developers: enable the misc:debug config option in the GregTech config file to see more

# Easter Eggs
gregtech.message.childrensday=Happy Children's Day!
3 changes: 3 additions & 0 deletions src/main/resources/assets/gregtech/lang/zh_cn.lang
Original file line number Diff line number Diff line change
Expand Up @@ -5337,3 +5337,6 @@ gregtech.key.tool_aoe_change=切换工具范围性效用模式

# Debug messaging
gregtech.debug.f3_h.enabled=格雷科技对调试信息作出了修改!开发者可在配置选项中启用 misc:debug 来显示更多信息

# Easter Eggs
gregtech.message.childrensday=儿童节快乐!

0 comments on commit bff9765

Please sign in to comment.