Skip to content

Commit

Permalink
changed config
Browse files Browse the repository at this point in the history
  • Loading branch information
onysd128 committed Jun 11, 2023
1 parent ae82be1 commit db7afe6
Show file tree
Hide file tree
Showing 18 changed files with 107 additions and 95 deletions.
167 changes: 88 additions & 79 deletions src/main/java/com/mrcrayfish/vehicle/VehicleConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,88 +79,97 @@ public static class Server
@Config.RangeDouble(min = 0.0)
public double fuelConsumptionFactor = 1.0;

@Config.Name("Aluminum Boat Key")
@Config.Comment("Depends on value will enable/disable key system for Aluminum Boat")
@Config.LangKey(Reference.MOD_ID + ".config.server.aluminumBoatKey")
public boolean aluminumBoatKey = true;

@Config.Name("ATV Key")
@Config.Comment("Depends on value will enable/disable key system for ATV")
@Config.LangKey(Reference.MOD_ID + ".config.server.atvKey")
public boolean atvKey = true;

@Config.Name("Bumper Car Key")
@Config.Comment("Depends on value will enable/disable key system for Bumper Car")
@Config.LangKey(Reference.MOD_ID + ".config.server.bumperCarKey")
public boolean bumperCarKey = true;

@Config.Name("Dirt Bike Key")
@Config.Comment("Depends on value will enable/disable key system for Dirt Bike")
@Config.LangKey(Reference.MOD_ID + ".config.server.dirtBikeKey")
public boolean dirtBikeKey = true;

@Config.Name("Go Kart Key")
@Config.Comment("Depends on value will enable/disable key system for Go Kart")
@Config.LangKey(Reference.MOD_ID + ".config.server.goKartKey")
public boolean goKartKey = true;

@Config.Name("Golf Cart Key")
@Config.Comment("Depends on value will enable/disable key system for Golf Cart")
@Config.LangKey(Reference.MOD_ID + ".config.server.golfCartKey")
public boolean golfCartKey = true;

@Config.Name("Jet Ski Key")
@Config.Comment("Depends on value will enable/disable key system for Jet Ski")
@Config.LangKey(Reference.MOD_ID + ".config.server.jetSkiKey")
public boolean jetSkiKey = true;

@Config.Name("Lawn Mower Key")
@Config.Comment("Depends on value will enable/disable key system for Lawn Mower")
@Config.LangKey(Reference.MOD_ID + ".config.server.lawnMowerKey")
public boolean lawnMowerKey = true;

@Config.Name("Mini Bike Key")
@Config.Comment("Depends on value will enable/disable key system for Mini Bike")
@Config.LangKey(Reference.MOD_ID + ".config.server.miniBikeKey")
public boolean miniBikeKey = true;

@Config.Name("Mini Bus Key")
@Config.Comment("Depends on value will enable/disable key system for Mini Bus")
@Config.LangKey(Reference.MOD_ID + ".config.server.miniBusKey")
public boolean miniBusKey = true;

@Config.Name("Moped Key")
@Config.Comment("Depends on value will enable/disable key system for Moped")
@Config.LangKey(Reference.MOD_ID + ".config.server.mopedKey")
public boolean mopedKey = true;

@Config.Name("OffRoader Key")
@Config.Comment("Depends on value will enable/disable key system for OffRoader")
@Config.LangKey(Reference.MOD_ID + ".config.server.offRoaderKey")
public boolean offRoaderKey = true;

@Config.Name("SmartCar Key")
@Config.Comment("Depends on value will enable/disable key system for SmartCar")
@Config.LangKey(Reference.MOD_ID + ".config.server.smartCarKey")
public boolean smartCarKey = true;

@Config.Name("Speed Boat Key")
@Config.Comment("Depends on value will enable/disable key system for Speed Boat")
@Config.LangKey(Reference.MOD_ID + ".config.server.speedBoatKey")
public boolean speedBoatKey = true;

@Config.Name("Sports Plane Key")
@Config.Comment("Depends on value will enable/disable key system for Sports Plane")
@Config.LangKey(Reference.MOD_ID + ".config.server.sportsPlaneKey")
public boolean sportsPlaneKey = true;

@Config.Name("Tractor Key")
@Config.Comment("Depends on value will enable/disable key system for Tractor")
@Config.LangKey(Reference.MOD_ID + ".config.server.tractorKey")
public boolean tractorKey = true;
@Config.Name("Vehicles")
@Config.Comment("Config for separate vehicle")
@Config.LangKey(Reference.MOD_ID + ".config.server")
public final Vehicles VEHICLES = new Vehicles();

public class Vehicles{
@Config.Name("Aluminum Boat Key")
@Config.Comment("Depends on value will enable/disable key system for Aluminum Boat")
@Config.LangKey(Reference.MOD_ID + ".config.server.aluminumBoatKey")
public boolean aluminumBoatKey = true;

@Config.Name("ATV Key")
@Config.Comment("Depends on value will enable/disable key system for ATV")
@Config.LangKey(Reference.MOD_ID + ".config.server.atvKey")
public boolean atvKey = true;

@Config.Name("Bumper Car Key")
@Config.Comment("Depends on value will enable/disable key system for Bumper Car")
@Config.LangKey(Reference.MOD_ID + ".config.server.bumperCarKey")
public boolean bumperCarKey = true;

@Config.Name("Dirt Bike Key")
@Config.Comment("Depends on value will enable/disable key system for Dirt Bike")
@Config.LangKey(Reference.MOD_ID + ".config.server.dirtBikeKey")
public boolean dirtBikeKey = true;

@Config.Name("Go Kart Key")
@Config.Comment("Depends on value will enable/disable key system for Go Kart")
@Config.LangKey(Reference.MOD_ID + ".config.server.goKartKey")
public boolean goKartKey = true;

@Config.Name("Golf Cart Key")
@Config.Comment("Depends on value will enable/disable key system for Golf Cart")
@Config.LangKey(Reference.MOD_ID + ".config.server.golfCartKey")
public boolean golfCartKey = true;

@Config.Name("Jet Ski Key")
@Config.Comment("Depends on value will enable/disable key system for Jet Ski")
@Config.LangKey(Reference.MOD_ID + ".config.server.jetSkiKey")
public boolean jetSkiKey = true;

@Config.Name("Lawn Mower Key")
@Config.Comment("Depends on value will enable/disable key system for Lawn Mower")
@Config.LangKey(Reference.MOD_ID + ".config.server.lawnMowerKey")
public boolean lawnMowerKey = true;

@Config.Name("Mini Bike Key")
@Config.Comment("Depends on value will enable/disable key system for Mini Bike")
@Config.LangKey(Reference.MOD_ID + ".config.server.miniBikeKey")
public boolean miniBikeKey = true;

@Config.Name("Mini Bus Key")
@Config.Comment("Depends on value will enable/disable key system for Mini Bus")
@Config.LangKey(Reference.MOD_ID + ".config.server.miniBusKey")
public boolean miniBusKey = true;

@Config.Name("Moped Key")
@Config.Comment("Depends on value will enable/disable key system for Moped")
@Config.LangKey(Reference.MOD_ID + ".config.server.mopedKey")
public boolean mopedKey = true;

@Config.Name("OffRoader Key")
@Config.Comment("Depends on value will enable/disable key system for OffRoader")
@Config.LangKey(Reference.MOD_ID + ".config.server.offRoaderKey")
public boolean offRoaderKey = true;

@Config.Name("SmartCar Key")
@Config.Comment("Depends on value will enable/disable key system for SmartCar")
@Config.LangKey(Reference.MOD_ID + ".config.server.smartCarKey")
public boolean smartCarKey = true;

@Config.Name("Speed Boat Key")
@Config.Comment("Depends on value will enable/disable key system for Speed Boat")
@Config.LangKey(Reference.MOD_ID + ".config.server.speedBoatKey")
public boolean speedBoatKey = true;

@Config.Name("Sports Plane Key")
@Config.Comment("Depends on value will enable/disable key system for Sports Plane")
@Config.LangKey(Reference.MOD_ID + ".config.server.sportsPlaneKey")
public boolean sportsPlaneKey = true;

@Config.Name("Tractor Key")
@Config.Comment("Depends on value will enable/disable key system for Tractor")
@Config.LangKey(Reference.MOD_ID + ".config.server.tractorKey")
public boolean tractorKey = true;

}
}



public static class Client
{
@Config.Name("Debug")
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/mrcrayfish/vehicle/common/CommonEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import com.mrcrayfish.vehicle.network.message.MessageThrowVehicle;
import com.mrcrayfish.vehicle.tileentity.TileEntityGasPump;
import com.mrcrayfish.vehicle.tileentity.TileEntityJack;
import com.mrcrayfish.vehicle.util.CommonUtils;

import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
Expand Down Expand Up @@ -114,6 +116,7 @@ public void onPlayerInteract(PlayerInteractEvent.EntityInteractSpecific event)

public static boolean pickUpVehicle(World world, EntityPlayer player, EnumHand hand, Entity targetEntity)
{
//CommonUtils.sendInfoMessage(player, targetEntity.getName());
if(hand == EnumHand.MAIN_HAND && !world.isRemote && player.isSneaking() && !player.isSpectator() && VehicleConfig.SERVER.pickUpVehicles)
{
if(!HeldVehicleDataHandler.isHoldingVehicle(player))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ public boolean canTowTrailer()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.atvKey;
return VehicleConfig.SERVER.VEHICLES.atvKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public EntityAluminumBoat(World worldIn)
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.aluminumBoatKey;
return VehicleConfig.SERVER.VEHICLES.aluminumBoatKey;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ public boolean canBeColored()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.bumperCarKey;
return VehicleConfig.SERVER.VEHICLES.bumperCarKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ public FuelPort getFuelPort()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.dirtBikeKey;
return VehicleConfig.SERVER.VEHICLES.dirtBikeKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ public boolean shouldRenderFuelPort()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.goKartKey;
return VehicleConfig.SERVER.VEHICLES.goKartKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ public boolean canMountTrailer()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.golfCartKey;
return VehicleConfig.SERVER.VEHICLES.golfCartKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ public boolean canBeColored()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.jetSkiKey;
return VehicleConfig.SERVER.VEHICLES.jetSkiKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ public boolean canTowTrailer()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.lawnMowerKey;
return VehicleConfig.SERVER.VEHICLES.lawnMowerKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ public boolean shouldRenderFuelPort()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.miniBikeKey;
return VehicleConfig.SERVER.VEHICLES.miniBikeKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ public boolean canTowTrailer()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.miniBusKey;
return VehicleConfig.SERVER.VEHICLES.miniBusKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,6 @@ public void removeChest()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.mopedKey;
return VehicleConfig.SERVER.VEHICLES.mopedKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ public boolean canMountTrailer()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.offRoaderKey;
return VehicleConfig.SERVER.VEHICLES.offRoaderKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ public boolean canMountTrailer()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.smartCarKey;
return VehicleConfig.SERVER.VEHICLES.smartCarKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public boolean canBeColored()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.speedBoatKey;
return VehicleConfig.SERVER.VEHICLES.speedBoatKey;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@ public boolean canMountTrailer()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.sportsPlaneKey;
return VehicleConfig.SERVER.VEHICLES.sportsPlaneKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ public boolean canBeColored()
@Override
public boolean isLockable()
{
return VehicleConfig.SERVER.tractorKey;
return VehicleConfig.SERVER.VEHICLES.tractorKey;
}
}

0 comments on commit db7afe6

Please sign in to comment.